• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Local EJB lookup problem

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author & internet detective
Posts: 42074
932
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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."
 
Run away! Run away! Here, take this tiny ad with you:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic