aspose file tools*
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
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Getting javax naming NameNotFoundException" Watch "Getting javax naming NameNotFoundException" New topic
Author

Getting javax naming NameNotFoundException

Prasanthi Polavarapu
Greenhorn

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:

Web.xml

<resource-ref id="ResourceRef_1230540192864">
<res-ref-name>cache/StarsCache</res-ref-name>
<res-type>com.ibm.websphere.cache.DistributedMap</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>

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

Exception
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: com.ibm.ws.util.ResRefJndiLookupObjectFactory
Reference Factory Class Location URLs: <null>
Reference Class Name: java.lang.Object
Type: ResRefJndiLookupInfo
Content: com.ibm.ws.util.ResRefJndiLookupInfo@3b86816f 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 mg.org/CosNaming/NamingContext/NotFound:1.0
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.handleNameNotFound(WsnOptimizedNamingImpl.java:1983)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.getNextWsnOptimizedNamingContext(WsnOptimizedNamingImpl.java:1320)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.getTargetContext(WsnOptimizedNamingImplBase.java:2425)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase$LeafOperationData.<init>(WsnOptimizedNamingImplBase.java:2890)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:1391)

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

Regards,
Prasanthi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting javax naming NameNotFoundException