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

空扰寡人 提交于 2019-12-01 21:49:53

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:

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

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!