You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kenneth Roper <ke...@ihavemoved.com> on 2001/12/14 17:25:43 UTC

Multiple naming contexts

I am having a problem accessing EJBs in my App Server (BES 5.0) from a
servlet running in Tomcat, because the code:

Context ctx= new InitialContext();
ctx.lookup("MyEJB"); // throws exception

Returns the exception:

javax.naming.NameNotFoundException: Name MyEJB is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:811) ...

However, running the same code from a standalone application (instead of a
servlet) successfully connects to the EJB.  There seems to be one naming
context (on the AppServer) if I use a standalone application as a client,
but 2 contexts when I use a servlet in Tomcat.

One solution that has been suggested to me would be to stop the nameserver
that Tomcat 4.0 starts up, so that it uses the same nameserver as BES.

Question 1: Does anyone know how to force tomcat to use an existing naming
context instead of starting up it's own?

Question 2: Is there another way of doing the same thing? How do servlets
normally contact EJBs when running in Tomcat?

Thanks
Kenneth



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>