• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Local EJB lookup problem

 
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.
 
author & internet detective
Posts: 40239
819
Eclipse IDE VI Editor Java
  • 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."
 
I'm just a poor boy, I need no sympathy, because I'm easy come, easy go, little high, little low, little ad
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic