on 08-09-2005 2:30 PM
I created my first project in J2EE, the Calculator Application. I followed tutorial the available one all in: http://help.sap.com/saphelp_nw04/helpdata/en/7d/cf0c8abcc34594ba9d3bbd5dd22155/frameset.htm
I obtained to publish the application but when I was to execute gave the following error:
Details: java.lang.InstantiationException: ID018236: Cannot instantiate bean. java.lang.ClassNotFoundException: class com.sap.examples.calculator.beans.CalcProxy : java.lang.Exception: Error instantiating Calculator EJBcom.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name webContainer/applications/sap.com/CalculatorEar/Calculator/java:comp/env/ejb/CalculatorBean, cannot resolve object reference. [Root exception is com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of CalculatorEjb.]
at jsp_Calculator1123589764696._jspService(jsp_Calculator1123589764696.java:6)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:537)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:186)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
thanks in Advanced
Hi Marcos,
it seems your lookup is defined somehow wrong. Please check if you really do lookup "webContainer/applications/sap.com/CalculatorEar/Calculator/java:comp/env/ejb/CalculatorBean"
It should only be java:comp/env/ejb/CalculatorBean as far as I remember.
Regards,
Benny
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Benny
In the CalcProxy.java i have this lookup:
public class CalcProxy {
private Calculator calc;
public void init() throws Exception {
//Lookup the enterprise bean
try {
InitialContext ctx = new InitialContext();
<b>Object ob = ctx.lookup("java:comp/env/ejb/CalculatorBean");</b>
CalculatorHome home = (CalculatorHome) PortableRemoteObject.narrow(ob, CalculatorHome.class);
//Initialize the enterprise bean
calc = home.create();
} catch (Exception e) {
throw new Exception(
"Error instantiating Calculator EJB" + e.toString());
}
}
Thanks in advanced,
Marcos
Message was edited by: Marcos Henrique Oliveira
Message was edited by: Marcos Henrique Oliveira
Hi Marcos,
can you please double check if you have set the refetence to the Calculator EJB correctly in the web.xml? A simple typo there could have caused that a different reference has been bound to the JNDI, and hence different lookup string to be used.
In addition, you can have a look at to find out how to check what reference is bound to the JNDI using the Visual Admin.
Hope that helps!
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.