Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JMS CommunicationException

 
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,


I am using WebSphere Application Server 5.0 on Windows 2000. I have created below using WAS 5.0 admin console:
a. JNDI Name "TopicConnectionFactory" using <node name>->Resources->WebSphere JMS Provider->WebSphere Topic Connection Factories
b. JNDI Name "ChatTopic" using <node name>->Resources->WebSphere JMS Provider->WebSphere Topic Destinations


I have written a standalone JMS client "Chat.java" whose partial is below:

...
Properties env = new Properties();
env.put("javax.naming.Context.INITIAL_CONTEXT_FACTORY", "com.ibm.websphere.naming.WsnInitialContextFactory");
env.put("javax.naming.Context.PROVIDER_URL", "iiop://localhost:900";);
env.put("org.omg.CORBA.ORBClass","com.ibm.rmi.iiop.ORB");
env.put("org.omg.CORBA.ORBSingletonClass","com.ibm.rmi.corba.ORBSingleton");
env.put("javax.rmi.CORBA.UtilClass","com.ibm.rmi.javax.rmi.CORBA.Util");
env.put("javax.rmi.CORBA.StubClass","com.ibm.rmi.javax.rmi.CORBA.StubDelegateImpl");
env.put("javax.rmi.CORBA.PortableRemoteObjectClass","com.ibm.rmi.javax.rmi.PortableRemoteObject");
env.put("java.naming.factory.url.pkgs","com.ibm.ws.naming");

TopicConnectionFactory conFactory = (TopicConnectionFactory)jndi.lookup("TopicConnectionFactory");

...




I started the server ran the Chat.java as "java Chat Topic admin welcome" then I am getting exception "javax.naming.CommunicationException: Can't find SerialContextProvider"
and I am not able to create conFactory object using above client code.

Can anybody tell what am I missing here. What all classpath and path settings I have to do ?




Thanks & Regards,
Kumar.
 
author
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a sample:

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "corbaloc:iiop:myhost.mycompany.com:2809");
Context initialContext = new InitialContext(env);

You are using the old iiop style which should work, but the port should be 2809 mandated by the J2EE spec as the default port for ORBS.
 
CAUTION! Do not touch the blades on your neck propeller while they are active. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic