Java错误堆栈的原因

Java错误堆栈的原因,java,jms,ibm-mq,Java,Jms,Ibm Mq,如何确定此错误堆栈的原因 它是在抱怨Jar文件丢失吗 谢谢 Caught Exception while Creating QueueConnection from QueueConnectionFactory com.ibm.msg.client.jms.DetailedJMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI. The Java(tm) MQI has thrown an exception des

如何确定此错误堆栈的原因

它是在抱怨Jar文件丢失吗

谢谢

Caught Exception while Creating QueueConnection from QueueConnectionFactory com.ibm.msg.client.jms.DetailedJMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI. The Java(tm) MQI has thrown an exception describing the problem. See the linked exception for further information. com.ibm.msg.client.jms.DetailedJMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI. The Java(tm) MQI has thrown an exception describing the problem. See the linked exception for further information.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)
        at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:233)
        at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6889)
        at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6277)
        at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:285)
        at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6233)
        at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:120)
        at connection.JMSConnection.makeQueueConnectionMQSeries(JMSConnection.java:228)
        at connection.JMSConnection.makeQueueConnection(JMSConnection.java:614)
        at testType.JMS_PTP.setupMsgTransportProtocol(JMS_PTP.java:335)
        at testType.JMS_PTP.run(JMS_PTP.java:806) Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9546: Error return code received. [1=java.lang.reflect.InvocationTargetException[null],3=NativeConstructorAccessorImpl.newInstance0]
        at com.ibm.mq.jmqi.JmqiEnvironment.processESESecurity(JmqiEnvironment.java:989)
        at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:809)
        at com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:615)
        at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6881)
        ... 8 more Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        at com.ibm.mq.jmqi.JmqiEnvironment.processESESecurity(JmqiEnvironment.java:896)
        ... 11 more Caused by: java.lang.NoClassDefFoundError: com/ibm/mq/headers/MQDataException
        at com.ibm.mq.ese.service.ServicesFactoryImpl.createPolicyService(ServicesFactoryImpl.java:173)
        at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.createServices(InterceptedJmqiImpl.java:224)
        at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.<init>(InterceptedJmqiImpl.java:184)
        at com.ibm.mq.ese.jmqi.ESEJMQI.<init>(ESEJMQI.java:117)
        ... 16 more Caused by: java.lang.ClassNotFoundException: com.ibm.mq.headers.MQDataException
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        ... 20 more Linked Exception: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9546: Error return code received. [1=java.lang.reflect.InvocationTargetException[null],3=NativeConstructorAccessorImpl.newInstance0]
-----------------------------------------------
从QueueConnectionFactory com.ibm.msg.client.jms.DetailedJMSException:JMSFMQ6312创建QueueConnection时捕获异常:Java(tm)MQI中发生异常。Java(tm)MQI引发了一个描述该问题的异常。有关更多信息,请参阅链接的异常。com.ibm.msg.client.jms.detailedjmscexception:JMSFMQ6312:Java(tm)MQI中发生异常。Java(tm)MQI引发了一个描述该问题的异常。有关更多信息,请参阅链接的异常。
位于sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)
位于sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
在sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
位于java.lang.reflect.Constructor.newInstance(Constructor.java:525)
位于com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)
位于com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:233)
位于com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6889)
位于com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6277)
位于com.ibm.msg.client.jms.admin.jmsconnectionfactorympl.createConnection(jmsconnectionfactorympl.java:285)
位于com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6233)
位于com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:120)
在connection.JMSConnection.makeQueueConnectionMQSeries上(JMSConnection.java:228)
在connection.JMSConnection.makeQueueConnection(JMSConnection.java:614)
位于testType.JMS_PTP.setupMsgTransportProtocol(JMS_PTP.java:335)
在testType.JMS_PTP.run(JMS_PTP.java:806)处,由以下原因引起:com.ibm.mq.jmqi.JmqiException:CC=2;RC=2195;AMQ9546:收到错误返回代码。[1=java.lang.reflect.InvocationTargetException[null],3=NativeConstructorAccessorImpl.newInstance0]
位于com.ibm.mq.jmqi.JmqiEnvironment.ProcesseSecurity(JmqiEnvironment.java:989)
位于com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:809)
位于com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:615)
位于com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6881)
... 8更多原因:java.lang.reflect.InvocationTargetException
位于sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)
位于sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
在sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
位于java.lang.reflect.Constructor.newInstance(Constructor.java:525)
位于com.ibm.mq.jmqi.JmqiEnvironment.ProcesseSecurity(JmqiEnvironment.java:896)
... 11更多原因:java.lang.NoClassDefFoundError:com/ibm/mq/headers/MQDataException
位于com.ibm.mq.ese.service.ServicesFactoryImpl.createPolicyService(ServicesFactoryImpl.java:173)
位于com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.createServices(InterceptedJmqiImpl.java:224)
在com.ibm.mq.ese.jmqi.InterceptedJmqiImpl。(InterceptedJmqiImpl.java:184)
位于com.ibm.mq.ese.jmqi.ESEJMQI.(ESEJMQI.java:117)
... 16更多原因:java.lang.ClassNotFoundException:com.ibm.mq.headers.MQDataException
在java.net.URLClassLoader$1.run(URLClassLoader.java:366)
在java.net.URLClassLoader$1.run(URLClassLoader.java:355)
位于java.security.AccessController.doPrivileged(本机方法)
位于java.net.URLClassLoader.findClass(URLClassLoader.java:354)
位于java.lang.ClassLoader.loadClass(ClassLoader.java:423)
位于java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 20多个链接异常:com.ibm.mq.jmqi.JmqiException:CC=2;RC=2195;AMQ9546:收到错误返回代码。[1=java.lang.reflect.InvocationTargetException[null],3=NativeConstructorAccessorImpl.newInstance0]
-----------------------------------------------

它正在抱怨缺少一个类文件。文件应该放在哪里取决于您。

它正在抱怨缺少类文件。文件应该放在哪里取决于您。

为了确定堆栈跟踪中错误的原因,通常从下到上读取堆栈,并查找由字引起的。这就是你问题的主要原因。在您的特殊情况下:

Caused by: java.lang.ClassNotFoundException: com.ibm.mq.headers.MQDataException

因此,这表明在类路径上找不到该类
MQDataException
。因此,您应该将包含此类的jar放在应用程序的类路径上,它应该可以正常工作。

为了确定StackTrace中错误的原因,通常从下到上读取堆栈,并查找由字引起的。这就是你问题的主要原因。在您的特殊情况下:

Caused by: java.lang.ClassNotFoundException: com.ibm.mq.headers.MQDataException

因此,这表明在类路径上找不到该类
MQDataException
。因此,您应该将包含此类的jar放在应用程序的类路径上,它应该可以正常工作。

如果它是一个独立的应用程序,只需将WebSphere MQ客户端安装在您选择的位置,并将几个jar添加到类路径中,如下所示:。我想这会更容易。

如果它是一个独立的应用程序,只需在您选择的位置安装WebSphere MQ客户端,并向类路径添加几个JAR,如下所示:。我想这会更容易些。

java.lang.ClassNotFoundException:com.ibm.mq.headers.MQDataException
java.lang