Exception in thread “main” java.lang.NoClassDefFoundError: com/ibm/mq/MQException

前端 未结 2 1242
深忆病人
深忆病人 2021-01-21 02:58

I\'m getting below exception when i run my program as below,

java -jar MQprogram.jar

I have set classpath correctly which is referri

相关标签:
2条回答
  • 2021-01-21 03:42

    This is almost always caused by a combination of an incomplete client install and/or a CLASSPATH issue. Many people grab the jar files rather than performing the complete install and do not necessarily get all of them. Sometimes they just keep looking up jar files and grabbing them, without regard to different versions. IBM performed a major refactor of the Java/JMS classes as of V7.0 and made some updates since then as well. As of V7.0.1, WMQ can be installed to arbitrary directory paths and multiple installs on a server. This meant that there can now be multiple JRE/s, multiple client installs, etc. This didn't affect the CLASSPATH so much but did change dependencies such as NLS support, tracing and other things the Java classes depend on/interact with.

    The recommendation is to install a full WMQ client and point the CLASSPATH at the install directory. If that is not possible, then install a full client somewhere and grab the complere set of jars from the known-good installation. Then at least you know you have all the same version, etc.

    Should you decide to install the full client from IBM's distribution media, you get several additional capabilities such as diagnostics and low-level trace. It also assures that maintenance can be applied. For example, you have a problem that is corrected in a Fix Pack, you simply install the Fix Pack over top of the existing client install. The Fix Pack won't install if all you have are the jar files.

    The WMQ clients are available as SupportPacs. You can download one of the following:

    • WMQ V7.0 Client == SupportPac MQC7
    • WMQ V7.1 Client == SupportPac MQC71
    • WMQ V7.5 Client == SupportPac MQC75

    Be sure to use the Infocenter for the version of client you are using!

    • WMQ V7.0 Infocenter
    • WMQ V7.1 Infocenter
    • WMQ V7.5 Infocenter
    0 讨论(0)
  • 2021-01-21 03:51

    It means there's no JAR in your CLASSPATH that contains a .class file for com.ibm.mq.MQException.

    This is Java 101.

    This explains what to do about it.

    Finding this link was Google 101.

    0 讨论(0)
提交回复
热议问题