This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes context lookup() from a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "context lookup() from a servlet" Watch "context lookup() from a servlet" New topic
Author

context lookup() from a servlet

c hart
Greenhorn

Joined: Jul 26, 2001
Posts: 3
Hello all,
I have an application that works properly, in that it sucessfully looks up an EJB using the JNDI name. However when I attempt to run the same code in a servlet the lookup() fails and says "myBean not defined in this context" I am using Tomcat. Is there any security or other configurations that are needed for my servlet to be able to see my JNDI names?
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1850

Welcome to Javaranch. We follow certain conventions with respect to the User name as given in the document here .
Your user name does not follow these conventions. Please re-register with a name following these conventions.
Thanks.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16022
    
  20

Tomcat is not an EJB server. For that, you have to pair it with something like the JOnAS EJB system (http://www.objectweb.org). JOnAS provides a JNDI registry service and EJB server.


Customer surveys are for companies who didn't pay proper attention to begin with.
c hart
Greenhorn

Joined: Jul 26, 2001
Posts: 3
The EJB is running in the borland appserver. The issue is from an application I can do the lookup no problem, but when I take the code that does the lookup and make it a servlet and run it in the webserver with the ejb still on the appserver then the lookup fails.
Originally posted by Tim Holloway:
Tomcat is not an EJB server. For that, you have to pair it with something like the JOnAS EJB system (http://www.objectweb.org). JOnAS provides a JNDI registry service and EJB server.

 
wood burning stoves
 
subject: context lookup() from a servlet