• Post Reply Bookmark Topic Watch Topic
  • New Topic

Malformed URL exception (looking up JNDI )  RSS feed

 
Manish Malhotra
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
This is my code.
private static final String PROVIDER_URL = "corbaloc:iiop:localhost:2809";
private static final String INITIAL_CONTEXT_FACTORY = "com.ibm.websphere.naming.WsnInitialContextFactory";
Hashtable htAppProperties = new Hashtable(2);
htAppProperties.put(Context.PROVIDER_URL, PROVIDER_URL);
htAppProperties.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY);
System.out.println("Looking up : " + PROVIDER_URL + " : " + INITIAL_CONTEXT_FACTORY);
Context lookupContext = new InitialContext(htAppProperties);
Object obj = lookupContext.lookup("jms/gvstopic");
System.out.println("Lookup is successful : " + obj);
Object objFac = lookupContext.lookup("jms/gvstopicfactory");
System.out.println("Lookup is successful new : " + objFac);
System.out.println("--------------------------------");
System.out.println("Topic is : " + (Topic)obj);
System.out.println("TopicConnectionFactory is : " +(TopicConnectionFactory)objFac);
-------------------------------
Im running this code on WSAD. The JMS factory & topic is already added at (wesphere5.00)test environment of WSAD.
But its giving this exception..
...
javax.naming.ConfigurationException: Malformed provider URL: corbaloc:iiop:localhost:2809/NameServiceServerRoot
at com.ibm.ws.naming.util.WsnInitCtxFactory.parseBootstrapURL(WsnInitCtxFactory.java:1422)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:368)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:102)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:408)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:131)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at TestConfig.publishRefreshCache(TestConfig.java:116)
at TestConfig.main(TestConfig.java:56)
----------------------
And if Im running this code from ouside the WSAD envrionment and on the WSAD server itself is running fine.
Please , help me Im running out of time.
Thanks in advance.
regards,
Manish Malhotra
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!