Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Stand-alone thin Client to Websphere MQ JMS with SUN JRE

843830Feb 12 2004 — edited Mar 25 2004
I am trying to implement a stand-alone client (without any IBM products installed) to Websphere MQ JMS, using SUN JRE. I tried to follow the instructions as specified in Portable Client Toolkit (from IBM) but run in to problems (see below). If i use the IBM JVM (which doesnt need the ORBs to be specified while invoking JVM) everything works fine. If anyone has implemented such a client, especially one that uses SUN JRE, may i know the steps used? As in, did you have to install a MQ Client on the Client machine, the classpath, properties used, what context factory was used, how the JNDI was setup on the server etc.

Thanks in advance.

Problem:
-----------
Code:
Context context = new InitialContext();
System.out.println("!!! Initial Context obtained:"+context.toString());
QueueConnectionFactory qcf = (QueueConnectionFactory)context.lookup("jms/qcf");
System.out.println("!!! QueueConnectionFactory obtained:"+qcf.toString());
QueueConnection qc = qcf.createQueueConnection();
QueueSession qs = qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
Queue q = (Queue)context.lookup("jms/q");
Batch File:
set CLASSPATH=%CLASSPATH%;%WEBSPHERE_ROOT%\lib\namingclient.jar
set CLASSPATH=%CLASSPATH%;%WEBSPHERE_ROOT%\lib\ecutils.jar
set CLASSPATH=%CLASSPATH%;%WEBSPHERE_ROOT%\lib\messagingImpl.jar
set CLASSPATH=%CLASSPATH%;%WEBSPHERE_ROOT%\java\jre\lib\ext\ibmorb.jar
set CLASSPATH=%CLASSPATH%;%WEBSPHERE_ROOT%\properties
set CLASSPATH=%CLASSPATH%;%MQ_ROOT%\Java\lib\com.ibm.mq.jar
set CLASSPATH=%CLASSPATH%;%MQ_ROOT%\Java\lib\com.ibm.mqjms.jar
set CLASSPATH=%CLASSPATH%;%MQ_ROOT%\Java\lib\jndi.jar

%JAVA_HOME%\bin\java
-Dorg.omg.CORBA.ORBClass=com.ibm.rmi.iiop.ORB
-Dorg.omg.CORBA.ORBSingletonClass=com.ibm.rmi.corba.ORBSingleton
-Djavax.rmi.CORBA.UtilClass=com.ibm.rmi.javax.rmi.CORBA.Util
-Djavax.rmi.CORBA.StubClass=com.ibm.rmi.javax.rmi.CORBA.StubDelegateImpl
-Djavax.rmi.CORBA.PortableRemoteObjectClass=com.ibm.rmi.javax.rmi.PortableRemoteObject
-Djava.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory
-Djava.naming.factory.url.pkgs=com.ibm.ws.naming
-Djava.naming.provider.url=iiop://sim2:2809
-Djava.ext.dirs=%WAS_EXT_DIRS%
QSender local_client_jms

Error:
!!! Initial Context obtained:javax.naming.InitialContext@632802
Exception:jms/qcf
javax.naming.NameNotFoundException: jms/qcf
at com.ibm.ejs.ns.jndi.CNContextImpl.doLookup(CNContextImpl.java:1435)
at com.ibm.ejs.ns.jndi.CNContextImpl.lookup(CNContextImpl.java:1115)
at javax.naming.InitialContext.lookup(InitialContext.java:345)
at QSender.main(QSender.java:19)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 22 2004
Added on Feb 12 2004
4 comments
488 views