• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Local EJB lookup problem

 
Gavi Raaghav
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34860
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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."
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic