我们正在使用以下设置
1)使用客户端模式连接到Websphere MQ的Java代码
<bean id="murexJmsConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="hostName" value="${mx.mq.hostName}" />
<property name="port" value="${mx.mq.port}" />
<property name="queueManager" value="${mx.mq.queueManager}" />
<property name="channel" value="${mx.mq.channel}" />
<property name="SSLCipherSuite" value="${mx.mq.cipher.suite}"/>
<property name="transportType">
<util:constant static-field="com.ibm.mq.jms.JMSC.MQJMS_TP_CLIENT_MQ_TCPIP"/>
</property>
</bean>
2)Linux服务器中已安装Open JDK 1.7
3)Websphere MQ版本-MQ 7.0.1.13
4)我们已配置SSL证书进行连接。
我们正在低于例外
retrying in 5000 ms. Cause: JMSWMQ0018: Failed to connect to queue manager 'Q3TEST' with connection mode 'Client' and host name 'myhost'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2397' ('MQRC_JSSE_ERROR').
com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'Q3TEST' with connection mode 'Client' and host name 'myhost'. Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:608)
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:236)
at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:421)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6807)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6204)
at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:278)
at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6155)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:115)
at com.ibm.mq.jms.MQQueueConnectionFactory.createConnection(MQQueueConnectionFactory.java:198)
at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
at org.springframework.jms.listener.AbstractJmsListeningContainer.createSharedConnection(AbstractJmsListeningContainer.java:403)
at org.springframework.jms.listener.AbstractJmsListeningContainer.refreshSharedConnection(AbstractJmsListeningContainer.java:388)
at com.abnamro.nl.marrs.utilities.spring.jms.OmDefaultMessageListenerContainer.refreshConnectionUntilSuccessful(OmDefaultMessageListenerContainer.java:1046)
at com.abnamro.nl.marrs.utilities.spring.jms.OmDefaultMessageListenerContainer.recoverAfterListenerSetupFailure(OmDefaultMessageListenerContainer.java:1026)
at com.abnamro.nl.marrs.utilities.spring.jms.OmDefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(OmDefaultMessageListenerContainer.java:1193)
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 '2397' ('MQRC_JSSE_ERROR').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)
... 14 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9204: Connection to host 'myhost(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeException[No appropriate protocol (protocol is disabled or cipher suites are inappropriate)],3=myhost/1.1.1.1:1414 (myhost),4=SSLSocket.startHandshake,5=default]],3=myhost(1414),5=RemoteTCPConnection.protocolConnect]
at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1809)
at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:336)
... 13 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeException[No appropriate protocol (protocol is disabled or cipher suites are inappropriate)],3=myhost/1.1.1.1:1414 (myhost),4=SSLSocket.startHandshake,5=default]
at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:950)
at com.ibm.mq.jmqi.remote.internal.system.RemoteConnection.connect(RemoteConnection.java:1075)
at com.ibm.mq.jmqi.remote.internal.system.RemoteConnectionPool.getConnection(RemoteConnectionPool.java:338)
at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1488)
... 14 more
Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at sun.security.ssl.Handshaker.activate(Handshaker.java:470)
at sun.security.ssl.SSLSocketImpl.kickstartHandshake(SSLSocketImpl.java:1438)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1308)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343)
at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:944)
... 17 more
最佳答案
我们能够解决这个问题。
之前我们使用的是以下客户端库版本
从我们的应用程序中删除了以下与MQ相关的jar(及其依赖项):
1) jmqi-7.0.jar
2) mq-7.0.jar
3) mqjms-7.0.jar
4) commonservices-7.0.jar
5) headers-7.0.jar
我们改为
从IBM站点下载了此MQ客户端发行版:mqc8_8.0.0.4_linuxx86-64.tar.gz
Added 2 jars from this distribution:
1) com.ibm.mq.allclient.jar
2) jms.jar
Added their dependency as follows:
<dependency>
<groupId>com.ibm.mq</groupId>
<artifactId>allclient</artifactId>
<version>8.0.0.4</version>
</dependency>
<dependency>
<groupId>com.ibm.mq</groupId>
<artifactId>jms</artifactId>
<version>8.0.0.4</version>
</dependency>