Troubleshooting
Problem
Troubleshooting for problems with the WebSphere Application Server and Deployment Manager with NameNotFoundExceptions. This document helps address common issues with a JNDI naming lookup before calling IBM support and save you time.
Resolving The Problem
Getting background information on Naming
In WebSphere Application Server, the namespace is broken up from one large name space to a namespace for each WebSphere Application Server JVM, see its logical view.
The most common problem resulting in a NameNotFoundException is when the initial context is bootstrapped to the wrong server or namespace. Remember each Application Server, node agent, and deployment manager have its own namespace.
Ensure the bootstrap port for the server you are binding to is specified. The bootstrap port can be seen in the serverindex.xml as well as in the administrative console.
If no port is specified, port 2809 is used as a default. This port is the default for the Node Agent and does not have application or resource objects in its namespace.
Troubleshooting steps to help resolve common naming lookup problems
- Use the dumpNameSpace utility to display contents of a namespace, if possible, from the machine where application client is running. Can you see the object in the namespace?
- Which method is you using for lookup, corbaloc / corbaname or Java™:
See following example of a corbaloc providerURL and lookup code:
env.put(Context.PROVIDER_URL,"corbaloc::server.austin.ibm.com:9809");
ctx = new InitialContext(env);
Object obj = ctx.lookup(“jdbc/PlantsByWebSphereDataSource”);</code>]
How object is seen in the dumpNameSpace Output
...
39 (top)/nodes/server/servers/server1/jdbc/petstore/PetStoreDB PetStoreDB
40 (top)/nodes/server/servers/server1/jdbc/PlantsByWebSphereDataSource PLANTSDB
41 (top)/nodes/server/servers/server1/jdbc/CatalogDB CatalogDB
...
39 (top)/nodes/server/servers/server1/jdbc/petstore/PetStoreDB PetStoreDB
40 (top)/nodes/server/servers/server1/jdbc/PlantsByWebSphereDataSource PLANTSDB
41 (top)/nodes/server/servers/server1/jdbc/CatalogDB CatalogDB
...
See following example of a java: namespace lookup. It shows the mapping from the sample code with the resource.xml, the resource.xml with the resource-bnd.xmi, and finally with the object as seen in the namespace.
- Code Sample
ctx = new InitialContext();
Object obj = ctx.lookup(“java:comp/env/plantsby/PlantsDS”);
Object obj = ctx.lookup(“java:comp/env/plantsby/PlantsDS”);
- web.xml
<resource-ref id="ResourceRef_1">
<res-ref-name>plantsby/PlantsDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<res-ref-name>plantsby/PlantsDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
- ibm-web-bnd.xmi
<resRefBindings xmi:id="ResourceRefBinding_1" jndiName="jdbc/PlantsByWebSphereDataSource">
<bindingResourceRef href="WEB-INF/web.xml#ResourceRef_1"/>
</resRefBindings>
<bindingResourceRef href="WEB-INF/web.xml#ResourceRef_1"/>
</resRefBindings>
How object is seen in the dumpNameSpace output:
39 (top)/nodes/server/servers/server1/jdbc/petstore/PetStoreDB PetStoreDB
40 (top)/nodes/server/servers/server1/jdbc/PlantsByWebSphereDataSource PLANTSDB
41 (top)/nodes/server/servers/server1/jdbc/CatalogDB CatalogDB
39 (top)/nodes/server/servers/server1/jdbc/petstore/PetStoreDB PetStoreDB
40 (top)/nodes/server/servers/server1/jdbc/PlantsByWebSphereDataSource PLANTSDB
41 (top)/nodes/server/servers/server1/jdbc/CatalogDB CatalogDB
What to do Next?
If the preceding steps did not help solve your problem, see the MustGather for JNDI problems to continue investigation.
Document Location
Worldwide
[{"Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"ARM Category":[{"code":"a8m50000000CdTtAAK","label":"ORB-Naming-\u003EJNDI Naming-\u003ENameNotFoundException"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)"}]
Was this topic helpful?
Document Information
Modified date:
17 February 2022
UID
ibm16410244