I am new to NWDS and J2EE. I followed the steps in the tutorial as indicated in the below link:
I did everything inside up to the last moment after I deployed my EAR and tried to run from the portal but got Application error. I checked the defaultTrace log file from the portal server and notice these errors:
#1.5 #001A6431E0FE0020000000750000155C0004B9B284863A19#1330076285575#com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl#sap.com/CalculatorEar#com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl#Guest#0##40C36AF65ECB11E18721000000978DDA#40c36af65ecb11e18721000000978dda-0#40c36af65ecb11e18721000000978dda#SAPEngine_Application_Thread[impl:3]_21##0#0#Error#1#/System/Server/WebRequests#Plain###application [Calculator] Processing HTTP request to servlet [jsp] finished with error.
The error is: com.sap.engine.services.servlets_jsp.server.jsp.exceptions.CompilingException: Error while executing the compilation process: [G:/usr/sap/EPD/JC00/j2ee/cluster/server0/apps/sap.com/CalculatorEar/servlet_jsp/Calculator/work/jsp_Calculator1330076284538.java:41: package com.sap.examples.calculator.beans does not exist
com.sap.examples.calculator.beans.CalcProxy calc = null;
G:/usr/sap/EPD/JC00/j2ee/cluster/server0/apps/sap.com/CalculatorEar/servlet_jsp/Calculator/work/jsp_Calculator1330076284538.java:42: package com.sap.examples.calculator.beans does not exist
calc = (com.sap.examples.calculator.beans.CalcProxy)pageContext.getAttribute("calc", PageContext.SESSION_SCOPE);
G:/usr/sap/EPD/JC00/j2ee/cluster/server0/apps/sap.com/CalculatorEar/servlet_jsp/Calculator/work/jsp_Calculator1330076284538.java:48: package com.sap.examples.calculator.beans does not exist
calc = (com.sap.examples.calculator.beans.CalcProxy) Beans.instantiate(getClass().getClassLoader(), "com.sap.examples.calculator.beans.CalcProxy");
The thing I don't understand is the "comp.sap.examples.calculator.beans" class has already been included inside the EAR (I used my zip tool to check the EAR file and confirmed it's there), why did the compiler still complain that the package does not exist? Any great guys & gals out there can help this poor newbie who spent the past 5 hours searching for Google for answers but couldn't find any??
Perhaps I should give out more information about this problem.
The EAR file contains a WAR file and a JAR file.
The WAR file contains a JSP and it contains codes to refer to a java proxy class of package comp.sap.examples.calculator.beans.CalcProxy.
So it seems the compilation error is triggered when it tries to compile the WAR file.
I checked the structure of the WAR file using a zip tool.
At the base it contains this:
WEB-INF (a folder)
Calculator.jsp (the JSP file)
Inside the WEB-INF folder is these:
classes (a folder)
Inside the classes folder is a tree of subfolders to describe the structure of the CalcProxy class:
classes -> comp -> sap -> examples -> calculator -> beans -> CalcProxy.class
So the java class file and the JSP file is in the same bundle of the WAR file.
Why the compiler is not able to find the class file inside the JSP?