This week's book giveaway is in the Security forum.
We're giving away four copies of Penetration Testing Basics and have Ric Messier on-line!
See this thread for details.
Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting javax naming NameNotFoundException

Prasanthi Polavarapu
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic