my dog learned polymorphism*
The moose likes Other Java Products and Servers and the fly likes lookup problem on SunOne 8 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "lookup problem on SunOne 8" Watch "lookup problem on SunOne 8" New topic
Author

lookup problem on SunOne 8

Nilesh Yawale
Greenhorn

Joined: Dec 16, 2003
Posts: 11
Hello All,

I'm using SunOne 8 on Windows XP and trying to use the following code to lookup. Also I've verified the deployment of my application on the server.

Context initial = new InitialContext();
Object objref = initial.lookup("java:comp/env/ejb/test");

and appserv-rt.jar and j2ee.jar are in my classpath.

I'm getting javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/test exception.

Please let me know if anybody knows the probable reason or solution for the above issue.

Thanks for your time

Nilesh


Nilesh<br />SCJP<br />IBM certified for OOAD using UML
Aleks V. Pascoal
Ranch Hand

Joined: Apr 21, 2002
Posts: 73
Nilesh,
to use the context "java:comp/env" you have to map your ejb in any descriptor. If it's a servlet trying to get the reference this is done by ejb-ref in web.xml and the corresponding tag in sun proprietary descriptor.
If it's another ejb that's done in ejb-jar.xml and the sun proprietary descriptor.
If you don't wanna use this, you may get the reference using the absolute name, the JNDI name, withou the subcontext "java:comp/env".
For example, "ejb/MyDearEJB".

I hope it helps!
 
 
subject: lookup problem on SunOne 8
 
Similar Threads
java:comp/env - vs. - Global JNDI lookup - What is the difference?
URGENT Please!!! JNDI Naming :)
Accesing 3.0 bean from 2.0 bean
JNDI lookup problem with ejb local interfaces
When to use ejb-jar.xml?jboss.xml?