Java.lang.NoClassDefFoundError: com / ibm / mq / MQException

This is similar to the previous question. Exception in thread "main" java.lang.NoClassDefFoundError: com / ibm / mq / MQException

I ran into a similar problem on Linux. I installed the following:

MQSeriesRuntime-7.0.1-3.x86_64.rpm
MQSeriesSDK-7.0.1-3.x86_64.rpm
MQSeriesJava-7.0.1-3.x86_64.rpm
MQSeriesServer-7.0.1-3.x86_64.rpm

When I create an execution group, I get:
java.lang.ClassNotFoundException: com.ibm.mq.MQException

I have a CLASSPATH specified using this line of code:
export CLASSPATH=$CLASSPATH:/opt/mqm/java/lib/com.ibm.mq.jmqi.jar:/opt/mqm/java/lib/com.ibm.mq.jar:.

The broker version is 8.0.0.1, and the MQ version is 7.0.1.3. Could you suggest what is wrong? According to the previous answer, should I also install Client?

+6
source share
2 answers

No, you do not need to install the client. The answer in another question was based on custom installation of client banks. In this case, you have a standard installation of WMQ Server. In addition to the RPMs provided, there is also an RPM for the MQSeries JRE, although I do not expect this to be a problem here. You obviously have a JRE, presumably the one installed by Broker.

So, this should lead to a differential diagnosis. Divide and win.

  • Have you successfully launched the MQIVT program or any other Java program? If you did this and made an exception, what happened? This tells us whether it is a system-wide or limited broker environment.
  • Where do you export CLASSPATH? In the broker profile .profile? Running broker script? Are you sure that he figured out the launch of the broker?
  • Why not use the /opt/mqm/java/bin/setjmsenv as described in the WebSphere MQ Java Class Variables ? Searching for this script in the script broker launch will capture all the relevant classes and do it in such a way that it works sequentially when you upgrade to later versions.
  • Which JRE are you using? If this is not the one that is installed with the broker, it may be the wrong version or unsupported JRE provider.

There is not enough information in the posted question to give a confident answer, but the answer to these diagnostic questions should help narrow it down or solve it at all.

+3
source

You need to look at the WMQ manual using Java for WMQ v7.0.1. *, because you are missing MQ JAR files.

For MQ base Java (not MQ / JMS) you need at least 5 MAR JAR files:

  • com.ibm.mq.jar
  • connector.jar
  • com.ibm.mq.jmqi.jar
  • com.ibm.mq.headers.jar
  • com.ibm.mq.commonservices.jar
+5
source

All Articles