This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "lookup problem on SunOne 8" Watch "lookup problem on SunOne 8" New topic

lookup problem on SunOne 8

Nilesh Yawale

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<br />SCJP<br />IBM certified for OOAD using UML
Aleks V. Pascoal
Ranch Hand

Joined: Apr 21, 2002
Posts: 73
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!
I agree. Here's the link:
subject: lookup problem on SunOne 8
jQuery in Action, 3rd edition