javax.naming.NameNotFoundException. Root exception is org.omg.CosNaming.Na
843829May 22 2003 — edited May 22 2003Hi,
I was wondering if you could help me with a problem I am having deploying a multi-tiered application. Currently I am deploying a sub-set of the entire application as a test. I have a EJB representing a warehouse clerk and one representing a sales representative. Each EJBs has two public data members - username and password which are populated for the database. I am using container managed persistance. I have managed to deploy the two EJBs and a web component which comprises a servlet and a static html page. The servlet takes the type of user - warehouse clerk or sales representative, and the username and password entered. Depending on the user type the appropriate EJB is looked-up and the actual instance is located using a finder method.
However, when I enter the username and password details into the form on the static HTML page, select the user type and then submit the details I get the following error message:
javax.naming.NameNotFoundException. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound
at com.sun.corba.ee.internal.CosNaming.NamingContextImpl.resolveFirstAsContext(NamingContextImpl.java:666)
at com.sun.corba.ee.internal.CosNaming.NamingContextImpl.doResolve(NamingContextImpl.java:568)
at com.sun.corba.ee.internal.CosNaming.NamingContextImpl.resolve(NamingContextImpl.java:265)
at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:368)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:417)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:395)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at com.sun.enterprise.naming.factory.IIOPObjectFactory.getObjectInstance(IIOPObjectFactory.java:43)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:121)
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:58)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at act.cg165.aadij.warehouse.servlets.LoginServlet.doPost(LoginServlet.java:121)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java:626)
at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java:534)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:378)
at org.apache.tomcat.core.Context.handleRequest(Context.java:644)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:440)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:144)
at org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java:310)
at java.lang.Thread.run(Thread.java:484)
=========================================================================
Below is the line of my LoginServlet class which is referred to in the stack trace - Object object = context.lookup
( "java:comp/env/ejb/WarehouseClerk" );
=========================================================================
Finally I have given the earlier deployment messages below: -
rmic act.cg165.aadij.warehouse.ejb.WarehouseClerkHomeImpl...
rmic act.cg165.aadij.warehouse.ejb.WarehouseClerkEJB_EJBObjectImpl...
rmic act.cg165.aadij.warehouse.ejb.SalesRepresentativeHomeImpl...
rmic act.cg165.aadij.warehouse.ejb.SalesRepresentativeEJB_EJBObjectImpl...
C:\j2sdkee1.2.1\repository\sean-o1badlc71b\applications\Aurora1053636151735Server.jar
Binding name:`java:comp/env/jdbc/Aurora`
Looking up authenticator...
Binding name:`java:comp/env/jdbc/Aurora`
Created Context:/warehouse
Binding name:`java:comp/env/ejb/WarehouseClerk`
Binding name:`java:comp/env/ejb/SalesRepresentative`
Binding name:`java:comp/env/jdbc/Aurora`
Application Aurora deployed.
Any help would be most appreciated.
Sean