wood burning stoves 2.0*
The moose likes Websphere and the fly likes JMS CommunicationException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "JMS CommunicationException" Watch "JMS CommunicationException" New topic
Author

JMS CommunicationException

Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
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.


RR Kumaran
SCJP 1.4
Roland Barcia
author
Ranch Hand

Joined: Apr 15, 2004
Posts: 181
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.


Roland Barcia: IBM Distinguished Engineer, CTO Mobile for Lab Services
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JMS CommunicationException