wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Local EJB lookup problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Local EJB lookup problem" Watch "Local EJB lookup problem" New topic
Author

Local EJB lookup problem

Gavi Raaghav
Ranch Hand

Joined: Apr 28, 2005
Posts: 82
I have created a local stateless ejb using WSAD5.1.2
The default jndi name given by WSAD is ejb/com/gaurav/MyEJBLocalHome.
I am using the following line of code for lookup:
InitialContext ctx = new InitialContext();
MyEJBLocalHome home = (MyEJBLocalHome)ctx.lookup("java:comp/env/ejb/com/gaurav/MyEJBLocalHome");

It throws the following error during lookup:
[7/9/05 20:06:18:965 IST] 52b56f8c SystemErr R javax.naming.NameNotFoundException: Context: localhost/nodes/localhost/servers/server1, name: ejb/com/gaurav/MyEJBLocalHome: First component in name ejb/com/gaurav/MyEJBLocalHome not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL mg.org/CosNaming/NamingContext/NotFound:1.0

I have tried looking up the ejb by this jndi name through the UTC but i get the same error. Prefixing java:comp/env also gives me an error.

What is the problem,where am i going wrong.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29220
    
135

Gavi,
An undocumented featured of WSAD is that it adds local:ejb to the beginning of the JNDI name.

So if your remote JNDI name is "ejb/MyBean", the local one is "local:ejb/ejb/MyBean."


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Local EJB lookup problem
 
Similar Threads
Look up error....URGENT
Distributed EJB lookup problem
How to do lookup for local ejb's in WSAD?
ejb-ref lookup does not work with JBoss 4.2.0GA _CP07, pleas help.
Jboss and Ejb 2.1 ejb-ref lookup