tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kenneth Roper <>
Subject Multiple naming contexts
Date Fri, 14 Dec 2001 16:25:43 GMT
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( ...

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?


To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message