我遇到了IBM MQ 8.0.0.4的一个奇怪问题。我的命令行应用程序(Java 8)从windows环境连接到安装在linux服务器上的MQ服务器。应用程序在到达时从特定队列中读取消息。我使用以下jar作为客户端库(8.0.0.4-WS-MQ-Install-Java-All.jar): -
com.ibm.mq.allclient.jar
com.ibm.mq.traceControl.jar
fscontext.jar
jms.jar
JSON4J.jar
providerutil.jar
应用程序像往常一样运行,没有任何问题。它可以通过“control + c”停止。完成后,调用ThreadGroup.interrupt()并按预期停止应用程序。 不期望的是: -
1)以下堆栈跟踪
[2016-05-26 14:13:14,023]-[DEBUG]-[ Thread-7]-[com.xyz.app.inf.DecoratorBase.invoke(){106}]-not overridden
[2016-05-26 14:13:14,316]-[ERROR]-[ Thread-7]-[com.xyz.app.inf.console.launcher.ServiceRunnerBase.serviceInternal(){230}]-Unhanled exception
com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ2002: Failed to get a message from destination 'QNAME'.
WebSphere MQ classes for JMS attempted to perform an MQGET; however WebSphere MQ reported an error.
Use the linked exception to determine the cause of this error.
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:595)
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:215)
at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:213)
at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:261)
at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1835)
at com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.receiveInternal(WMQSyncConsumerShadow.java:231)
at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.receive(WMQConsumerShadow.java:1471)
at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.receive(WMQMessageConsumer.java:659)
at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receiveInboundMessage(JmsMessageConsumerImpl.java:1036)
at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receive(JmsMessageConsumerImpl.java:671)
at com.ibm.mq.jms.MQMessageConsumer.receive(MQMessageConsumer.java:209)
at com.xyz.app.inf.XQueueReceiver.receive(XQueueReceiver.java:141)
at com.xyz.app.inf.XQueueReceiver.receive(XQueueReceiver.java:100)
at com.xyz.app.cli.services.impl.MessageRunner.read(MessageRunner.java:440)
at com.xyz.app.cli.services.impl.MessageRunner.task(MessageRunner.java:201)
at com.xyz.app.inf.console.launcher.ServiceRunnerBase.serviceInternal(ServiceRunnerBase.java:227)
at com.xyz.app.inf.console.launcher.ServiceRunnerBase.run(ServiceRunnerBase.java:127)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2195' ('MQRC_UNEXPECTED_ERROR').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)
... 16 more
Caused by: com.ibm.mq.jmqi.local.LocalMQ$4: CC=2;RC=2495;AMQ8598: Failed to load the WebSphere MQ native JNI library: 'mqjbnd'.
at com.ibm.mq.jmqi.local.LocalMQ.loadLib(LocalMQ.java:1268)
at com.ibm.mq.jmqi.local.LocalMQ$1.run(LocalMQ.java:309)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.mq.jmqi.local.LocalMQ.initialise_inner(LocalMQ.java:259)
at com.ibm.mq.jmqi.local.LocalMQ.initialise(LocalMQ.java:221)
at com.ibm.mq.jmqi.local.LocalMQ.<init>(LocalMQ.java:1350)
at com.ibm.mq.jmqi.local.LocalServer.<init>(LocalServer.java:230)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:706)
at com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:640)
at com.ibm.msg.client.wmq.factories.WMQComponent.getImplementationInfo(WMQComponent.java:251)
at com.ibm.msg.client.commonservices.trace.Trace.getVersion(Trace.java:2092)
at com.ibm.msg.client.commonservices.trace.Trace.createFFSTString(Trace.java:2050)
at com.ibm.msg.client.commonservices.trace.Trace.ffstInternal(Trace.java:1935)
at com.ibm.msg.client.commonservices.trace.Trace.ffst(Trace.java:1736)
at com.ibm.mq.jmqi.remote.impl.RemoteProxyQueue.proxyMQGET(RemoteProxyQueue.java:2540)
at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiGetInternalWithRecon(RemoteFAP.java:7169)
at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiGetInternal(RemoteFAP.java:7054)
at com.ibm.mq.jmqi.internal.JmqiTools.getMessage(JmqiTools.java:1217)
at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiGet(RemoteFAP.java:7001)
at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiGet(InterceptedJmqiImpl.java:1325)
at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiGet(ESEJMQI.java:600)
at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1775)
... 13 more
Caused by: java.lang.UnsatisfiedLinkError: no mqjbnd in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at com.ibm.mq.jmqi.local.LocalMQ.loadLib(LocalMQ.java:1240)
... 38 more
[2016-05-26 14:13:14,326]-[INFO ]-[ Thread-5]-[com.xyz.app.startup.Application.destroy(){433}]-Application shutting down
[2016-05-26 14:13:14,326]-[INFO ]-[ Thread-5]-[com.xyz.app.startup.Application.cleanup(){608}]-Application.cleanup() called------
2)创建一个名为FFDC的文件夹,其中包含名为JMSCC0001.FDC,JMSCC0002.FDC等的文件。
我之所以说堆栈跟踪是意外的是它说“java.library.path中没有mqjbnd”这意味着应用程序 正在以绑定模式连接MQ服务器。但我正在以客户端模式连接,你可以看到:
com.ibm.mq.jms.MQQueueConnectionFactory@c79b6829 :-
| | XMSC_ADMIN_OBJECT_TYPE :- 17
| | XMSC_ASYNC_EXCEPTIONS :- 1
| | XMSC_CLIENT_ID :- <null>
| | XMSC_CONNECTION_TYPE :- 1
| | XMSC_CONNECTION_TYPE_NAME :- com.ibm.msg.client.wmq
| | XMSC_RTT_DIRECT_AUTH :- 0
| | XMSC_RTT_PROXY_HOSTNAME :- <null>
| | XMSC_RTT_PROXY_PORT :- 443
| | XMSC_WMQ_BROKER_CC_SUBQ :- SYSTEM.JMS.ND.CC.SUBSCRIBER.QUEUE
| | XMSC_WMQ_BROKER_CONTROLQ :- SYSTEM.BROKER.CONTROL.QUEUE
| | XMSC_WMQ_BROKER_PUBQ :- SYSTEM.BROKER.DEFAULT.STREAM
| | XMSC_WMQ_BROKER_QMGR :-
| | XMSC_WMQ_BROKER_SUBQ :- SYSTEM.JMS.ND.SUBSCRIBER.QUEUE
| | XMSC_WMQ_CCDTURL :- <null>
| | XMSC_WMQ_CF_DESCRIPTION :- <null>
| | XMSC_WMQ_CHANNEL :- NSICHL
| | XMSC_WMQ_CLEANUP_INTERVAL :- 3600000
| | XMSC_WMQ_CLEANUP_LEVEL :- 1
| | XMSC_WMQ_CLIENT_RECONNECT_OPTIONS :- 0
| | XMSC_WMQ_CLIENT_RECONNECT_TIMEOUT :- 1800
| | XMSC_WMQ_CLONE_SUPPORT :- 0
| | XMSC_WMQ_CONNECTION_MODE :- 1
| | XMSC_WMQ_CONNECTION_NAME_LIST_INT :-
| | | 0 :- 172.16.31.29(1414)
| | XMSC_WMQ_CONNECTION_TAG :- [B@161c410
| | XMSC_WMQ_CONNECT_OPTIONS :- 0
| | XMSC_WMQ_HEADER_COMP :-
| | | 0 :- 0
| | XMSC_WMQ_LOCAL_ADDRESS :-
| | XMSC_WMQ_MAP_NAME_STYLE :- true
| | XMSC_WMQ_MAX_BUFFER_SIZE :- 1000
| | XMSC_WMQ_MESSAGE_RETENTION :- 1
| | XMSC_WMQ_MESSAGE_SELECTION :- 0
| | XMSC_WMQ_MSG_BATCH_SIZE :- 10
| | XMSC_WMQ_MSG_COMP :-
| | | 0 :- 0
| | XMSC_WMQ_OPT_PUB :- false
| | XMSC_WMQ_OUTCOME_NOTIFICATION :- true
| | XMSC_WMQ_POLLING_INTERVAL :- 5000
| | XMSC_WMQ_PROCESS_DURATION :- 0
| | XMSC_WMQ_PROVIDER_VERSION :- unspecified
| | XMSC_WMQ_PUB_ACK_INTERVAL :- 25
| | XMSC_WMQ_QMGR_CCSID :- 819
| | XMSC_WMQ_QUEUE_MANAGER :- NSI
| | XMSC_WMQ_RECEIVE_EXIT :- <null>
| | XMSC_WMQ_RECEIVE_EXIT_INIT :- <null>
| | XMSC_WMQ_RECEIVE_ISOLATION :- 0
| | XMSC_WMQ_RESCAN_INTERVAL :- 5000
| | XMSC_WMQ_SECURITY_EXIT :- <null>
| | XMSC_WMQ_SECURITY_EXIT_INIT :- <null>
| | XMSC_WMQ_SEND_CHECK_COUNT :- 0
| | XMSC_WMQ_SEND_EXIT :- <null>
| | XMSC_WMQ_SEND_EXIT_INIT :- <null>
| | XMSC_WMQ_SHARE_CONV_ALLOWED :- 1
| | XMSC_WMQ_SPARSE_SUBSCRIPTIONS :- false
| | XMSC_WMQ_SSL_CERT_STORES_COL :- <null>
| | XMSC_WMQ_SSL_CERT_STORES_STR :- <null>
| | XMSC_WMQ_SSL_CIPHER_SUITE :- <null>
| | XMSC_WMQ_SSL_FIPS_REQUIRED :- false
| | XMSC_WMQ_SSL_KEY_RESETCOUNT :- 0
| | XMSC_WMQ_SSL_PEER_NAME :- <null>
| | XMSC_WMQ_SSL_SOCKET_FACTORY :- <null>
| | XMSC_WMQ_STATUS_REFRESH_INTERVAL :- 60000
| | XMSC_WMQ_SUBSCRIPTION_STORE :- 1
| | XMSC_WMQ_SYNCPOINT_ALL_GETS :- false
| | XMSC_WMQ_TARGET_CLIENT_MATCHING :- true
| | XMSC_WMQ_TEMPORARY_MODEL :- SYSTEM.DEFAULT.MODEL.QUEUE
| | XMSC_WMQ_TEMP_Q_PREFIX :-
| | XMSC_WMQ_TEMP_TOPIC_PREFIX :-
| | XMSC_WMQ_USE_CONNECTION_POOLING :- true
| | brokerVersion :- -1
| | failIfQuiesce :- 1
| | multicast :- 0
| | version :- 7
| | wildcardFormat :- 0
当我使用属于Websphere MQ 7.0的客户端库时,不会遇到上述堆栈跟踪。请帮忙。
答案 0 :(得分:1)
您拥有MQRC_UNEXPECTED_ERROR和FDC文件意味着您应该真正为IBM打开PMR。这并不意味着发生。
答案 1 :(得分:0)
应用程序像往常一样运行,没有任何问题。它可以停止 通过“控制+ c”。完成后,调用ThreadGroup.interrupt() 并且应用程序按预期停止。
所以你的应用程序在MQGET中间,然后你崩溃了然后你想知道为什么你会得到奇怪的结果!!
代码需要等待MQGET API完成,然后您的应用程序需要关闭队列并断开与队列管理器的连接。
答案 2 :(得分:0)
问题结论
JMS的MQ类已更新,以确保 生成FDC时发生的任何内部异常是 没有添加为任何MQExceptions本身的原因 将JMSExceptions抛回应用程序的原因。后果 这些更改是内部异常:
com.ibm.mq.jmqi.JmqiException:CC = 2; RC = 2495; AMQ8568:本机JNI 找不到库“ mqjbnd”。对于客户端安装,这是 预期的。
不再添加为包含MQ的MQException的原因 原因代码2195,如果出现以下情况,则会引发JMSException: 应用程序在调用方法之一时中断线程 如下所示:
- MessageConsumer.receive()
- MessageConsumer.receive(长时间超时)
- MessageConsumer.receiveNoWait()
在以下版本和更高版本中已修复此问题:
The fix is targeted for delivery in the following PTFs: Version Maintenance Level v8.0 8.0.0.7 v9.0 CD 9.0.2 v9.0 LTS 9.0.0.1