Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

javax .naming. ConfigurationException:

 
parvesh sharma
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am getting following error while performing look up.

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(javaURLContextFactory.java:98)
at com.ibm.ws.naming.urlbase.UrlContextFactory.getObjectInstance(UrlContextFactory.java:73)
at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:591)
at javax.naming.spi.NamingManager.getURLContext(NamingManager.java:540)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:287)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at messaging.MessageClient.main(MessageClient.java:72)




The code for the look up is as follows:

Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "iiop://localhost:2809");

Context context = new InitialContext(env);

QueueConnectionFactory qConnectionFactory = (QueueConnectionFactory)context.lookup("java:comp/env/jms/vendorCF");


JNDI name that I have specified in the server is jms/vendorCF.

I tried by giving exact jndi name that is :
context.lookup("jms/vendorCF");

but it throws a different exception as follows:
javax.naming.NameNotFoundException: Context: KC06015/nodes/KC06015/servers/server1, name: jms/vendorCF: First component in name jms/vendorCF not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound

Thanks

Parvesh
 
Yuan Ye
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is "jms/vendorCF" a queue name or queueConnectionFactory name? From my project, I didn't need to specify a queueConnectionFactory name, just use the standard "ConnectionFactory". How do you setup a ConnectionFactory and why?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!