Troubleshooting
Problem
When writing a J2SE program that performs java:comp lookups using the embeddable EJB container, you must remember that java:comp is only accessible within an EJB method. If you attempt to lookup a java:comp name directly from the main method, you will get an NMSV0307E error.
Symptom
NMSV0307E: A java: URL name was used, but Naming was not configured to handle java: URL names. The likely cause is a user in error attempting to specify a java: URL name in a non-J2EE client or server environment. Throwing ConfigurationException.
javax.naming.ConfigurationException: Name space accessor for the java: name space has not been set. Possible cause is that the user is specifying a java: URL name in a JNDI Context method call but is not running in a J2EE client or server environment.
at com.ibm.ws.naming.java.javaURLContextFactory.isNameSpaceAccessable
at com.ibm.ws.naming.urlbase.UrlContextFactory.getObjectInstance
at javax.naming.spi.NamingManager.getURLContext
at javax.naming.InitialContext.getURLOrDefaultInitCtx
at javax.naming.InitialContext.lookup
at com.ibm.test.EmbeddableEJBTest.main
Log InLog in to view more of this document
Was this topic helpful?
Document Information
Modified date:
03 March 2025
UID
swg21580598