| 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: 177
|
|
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<br />STSM - ISSW Lead Web 2.0 Architect
|
 |
 |
|
|
subject: JMS CommunicationException
|
|
|