`

Exception in thread "main" java.lang.NoClassDefFoundError: javax/resource/Resour

 
阅读更多

今天在使用MQ API调用 MQ的时候,报如下错误:

原因是因为少了一个connector.jar.加上去即可.

 

--下面这些环境变量的信息,是用到了connector.jar中的Class.

MQEnvironment.hostname = esbQmgrInfo.getHostName();
MQEnvironment.port = esbQmgrInfo.getPort()!=null ?Integer.parseInt(esbQmgrInfo.getPort()):0;
MQEnvironment.channel = esbQmgrInfo.getSvrConn();
MQEnvironment.CCSID = 1383;

 

 

Exception in thread "main" java.lang.NoClassDefFoundError: javax/resource/ResourceException
 at com.ibm.mq.MQEnvironment.<clinit>(MQEnvironment.java:574)
 at com.huawei.ngbss.admin.mqmanager.MQManager.testQmgrConnection(MQManager.java:22)
 at com.huawei.ngbss.admin.mqmanager.MQManager.main(MQManager.java:60)
Caused by: java.lang.ClassNotFoundException: javax.resource.ResourceException
 at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
 ... 3 more
.

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics