使用7.1 jars通过JMS连接到Websphere MQ中启用SSL的队列时,我遇到了以下错误。
代码:
public MQMessageSender(String channelName, String hostName,
String portNumber, String queueManagerName, String queueName) {
// Create a MQQueue Factory Object
try {
mqConnectionFact = new MQQueueConnectionFactory();
mqConnectionFact.setChannel("xxx.SVRCONN");
mqConnectionFact.setPort(Integer.parseInt("xxxx"));
mqConnectionFact.setHostName("host1");
//mqConnectionFact.setConnectionNameList("host2(port2)");
mqConnectionFact.setClientReconnectOptions(JMSC.MQCNO_RECONNECT_Q_MGR);
mqConnectionFact.setQueueManager("XXXXX");
mqConnectionFact.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
mqConnectionFact.setSSLCipherSuite("SSL_RSA_WITH_RC4_128_SHA");
qConnection = mqConnectionFact.createQueueConnection();
qConnection.start();
qSession = qConnection.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
requestQueue = qSession.createQueue(queueName);
} catch (Exception exception) {
exception.printStackTrace();
}
}
错误:
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with
compcode '2' ('MQCC_FAILED') reason '2399' ('MQRC_SSL_PEER_NAME_ERROR').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209)
... 8 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2399;
AMQ9204: Connection to host 'host1' rejected.
[1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2399;
AMQ9640: SSL invalid peer name, channel '?', attribute 'OID.2.5.4.17 (x2)'.
[5=OID.2.5.4.17 (x2)]],3=host1(port1),5=RemotePeerName.setValue]
答案 0 :(得分:1)
reason '2399' ('MQRC_SSL_PEER_NAME_ERROR')
报告的是错误。见2399 (095F) (RC2399): MQRC_SSL_PEER_NAME_ERROR。此外,您还有以下错误消息:
AMQ9640: SSL invalid peer name, channel '?', attribute 'OID.2.5.4.17 (x2)'.
[5=OID.2.5.4.17 (x2)]],3=host1(port1),5=RemotePeerName.setValue]
告诉你peerName的哪一部分未被识别。它说,OID.2.5.4.17
是邮政编码。
简短的互联网搜索显示APAR是否存在此问题,IC83494: WMQ V7.1: JMS CLIENT CONNECTION VIA SSL ENABLED CHANNEL FAILS WITH RC 2399 MQRC_SSL_PEER_NAME_ERROR.
此APAR包含在V7.1 FixPac 3中。
答案 1 :(得分:0)
本文中有一些很好的建议和指示链接。https://www.ibm.com/developerworks/community/blogs/aimsupport/entry/websphere_mq_v7_java_and_jms_ssl_problems_and_solutions?lang=en
您是否已启用重新连接,第一次连接或重新连接时出现问题?