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 EJB and other Java EE Technologies and the fly likes Getting javax naming NameNotFoundException 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 » Java » EJB and other Java EE Technologies
Bookmark "Getting javax naming NameNotFoundException" Watch "Getting javax naming NameNotFoundException" New topic

Getting javax naming NameNotFoundException

Prasanthi Polavarapu

Joined: Dec 24, 2008
Posts: 4
Hi all,

I am getting the following javax.naming.NameNotFoundException when I try looking up for an object from the initial context.
This is my code:


<resource-ref id="ResourceRef_1230540192864">

Java class
private static DistributedMap dm1 = null;
InitialContext context=new InitialContext();
dm1 =(DistributedMap)context.lookup("java:comp/env/cache/StarsCache");

W NMSV0605W: A Reference object looked up from the context "java:" with the name "comp/env/cache/StarsCache" was sent to the JNDI Naming Manager and an exception resulted. Reference data follows:
Reference Factory Class Name:
Reference Factory Class Location URLs: <null>
Reference Class Name: java.lang.Object
Type: ResRefJndiLookupInfo
Content: ResRefJndiLookupInfo: Look up Name="cache/StarsCache";JndiLookupInfo: jndiName="cache/StarsCache"; providerURL=""; initialContextFactory=""

Exception data follows:
javax.naming.NameNotFoundException: Context: localhost/nodes/localhost/servers/server1, name: cache/StarsCache: First component in name cache/StarsCache not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL

Please let me know if I am missing something which is causing the exception.
Thanks´┐Ż in advance.

I agree. Here's the link:
subject: Getting javax naming NameNotFoundException
It's not a secret anymore!