|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Java Exception connecting via MQ Client |
« View previous topic :: View next topic » |
Author |
Message
|
mustang |
Posted: Tue Oct 04, 2016 7:37 am Post subject: Java Exception connecting via MQ Client |
|
|
Acolyte
Joined: 07 Feb 2006 Posts: 72
|
Hi. I am trying to connect to a Queue Manager via the MQ Client, but I am receiving a NullPointerException.
Any assistance would be much appreciated!
WebSphere MQ Version 7.5 (from client README.TXT file)
line of code:
JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);
According to the instructions(http://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q031560_.htm), I only need to reference com.ibm.mqjms.jar in the class path. However, when I do that, I get a ClassNotFoundException, looking for class com.ibm.msg.client.commonservices.Trace (which does not exist in com.ibm.mqjms.jar ).
When I add to the class path all jar files in directory %MQ_JAVA_INSTALL_PATH%/lib, I get the following exception:
FDC called in uninitialized Trace module
FDCTitle
Product :- ProductName
Date/Time :- Tue Oct 04 09:06:12 CDT 2016
System time :- 1475589972393
Operating System :- Windows 7
UserID :- myUserID
Java Vendor :- IBM Corporation
Java Version :- 2.6
Source Class :- JmsFactoryFactory
Source Method :- getIntance(int)
ProbeID :- XI001005
Thread :- name=main priority=5 group=main ccl=sun.misc.Launcher$AppClassLoader@bf897c4f
Data
----
| connectionTypeName :- com.ibm.msg.client.wmq
| exception :- ExceptionDepth is 2
| exception :-
| | Cause:1 :- java.lang.NullPointerException
| | StackTrace:1 :- java.lang.NullPointerException
| | at com.ibm.msg.client.jms.JmsFactoryFactory.getInstance(JmsFactoryFactory.java:180) |
|
Back to top |
|
 |
RogerLacroix |
Posted: Tue Oct 04, 2016 11:35 am Post subject: Re: Java Exception connecting via MQ Client |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
mustang wrote: |
WebSphere MQ Version 7.5 (from client README.TXT file) |
What is the exact version? I am using 7.5.0.5 without any issues.
mustang wrote: |
According to the instructions(http://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q031560_.htm), I only need to reference com.ibm.mqjms.jar in the class path. However, when I do that, I get a ClassNotFoundException, looking for class com.ibm.msg.client.commonservices.Trace (which does not exist in com.ibm.mqjms.jar ). |
I would think that at a minimum you would need com.ibm.mq.jar and com.ibm.mqjms.jar because they would reference & load the rest of MQ JAR files that it needs.
I don't rely on JVM's auto-load of the JAR files listed in the manifest under 'Class-path' - call me a skeptic. I prefer to explicitly set the MQ JAR files in the classpath.
Here's the MQ JAR files in the classpath for my JMS/MQ applcations:
com.ibm.mq.headers.jar
com.ibm.mq.jar
com.ibm.mq.jmqi.jar
com.ibm.mq.pcf.jar
connector.jar
com.ibm.mq.commonservices.jar
com.ibm.mqjms.jar
fscontext.jar
jms.jar
jndi.jar
jta.jar
ldap.jar
providerutil.jar
I probably don't need the last 3 but I include them just in case.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
mustang |
Posted: Fri Oct 07, 2016 5:08 am Post subject: |
|
|
Acolyte
Joined: 07 Feb 2006 Posts: 72
|
RogerLacroix wrote: |
What is the exact version? |
7.5.0.2
RogerLacroix wrote: |
I prefer to explicitly set the MQ JAR files in the classpath. |
Right now, I am running it as a JUnit test from RAD/Eclipse. Eventually, it will execute from an ant script. The MQ client jar files are referenced in the "Classpath" "Bootstrap Entries" of the RAD/Eclipse JUnit Run Configuration.
I have the same jar files referenced in the classpath as you have listed.
Thanks! |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|