• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Malformed URL exception (looking up JNDI )

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I'm sure glad that he's gone. Now I can read this tiny ad in peace!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic