2017-06-24 23 views
1

Javaクライアントを使用してIBM MQに接続しようとしています。以下のチュートリアルに従って、必要なkeydatabase、keystoreおよびtruststoreファイルをセットアップしました。JavaクライアントとWebSphere MQのSSLサポートの使用

https://qadeer786.wordpress.com/2013/10/08/using-ssl-support-for-java-clients-websphere-mq/

私はJavaクライアントを実行すると、それは私に、次のエラーが発生します。

com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2397'. 
    at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:249) 
    at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:450) 
    at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:487) 
    at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:97) 
    at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:194) 
    at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:868) 
    at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:816) 
    at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:758) 
    at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:200) 
    at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:682) 
    at esb.wso2.org.client.MQConnectionBuilder.<init>(MQConnectionBuilder.java:52) 
    at esb.wso2.org.client.MQConnectionBuilder.getInstance(MQConnectionBuilder.java:60) 
    at esb.wso2.org.client.MQProducer.<init>(MQProducer.java:20) 
    at esb.wso2.org.client.MQClient.main(MQClient.java:7) 
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9204: Connection to host '127.0.0.1(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeException[Remote host closed connection during handshake],3=localhost/127.0.0.1:1414 (localhost),4=SSLSocket.startHandshake,5=default]],3=127.0.0.1(1414),5=RemoteTCPConnection.protocolConnect] 
    at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2282) 
    at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1294) 
    at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:376) 
    at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:560) 
    at com.ibm.mq.MQSESSION.MQCONNX_j(MQSESSION.java:916) 
    at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:235) 
    ... 13 more 
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeException[Remote host closed connection during handshake],3=localhost/127.0.0.1:1414 (localhost),4=SSLSocket.startHandshake,5=default] 
    at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1329) 
    at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:863) 
    at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:409) 
    at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:305) 
    at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:146) 
    at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1730) 
    ... 18 more 
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake 
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:992) 
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) 
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403) 
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387) 
    at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$6.run(RemoteTCPConnection.java:1298) 
    at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$6.run(RemoteTCPConnection.java:1290) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1290) 
    ... 23 more 
Caused by: java.io.EOFException: SSL peer shut down incorrectly 
    at sun.security.ssl.InputRecord.read(InputRecord.java:505) 
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973) 
    ... 30 more 
com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2397'. 
    at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:249) 
    at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:450) 
    at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:487) 
    at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:97) 
    at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:194) 
    at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:868) 
    at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:816) 
    at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:758) 
    at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:200) 
    at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:682) 
    at esb.wso2.org.client.MQConnectionBuilder.getQueueManager(MQConnectionBuilder.java:68) 
    at esb.wso2.org.client.MQProducer.<init>(MQProducer.java:22) 
    at esb.wso2.org.client.MQClient.main(MQClient.java:7) 
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9204: Connection to host '127.0.0.1(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeException[Remote host closed connection during handshake],3=localhost/127.0.0.1:1414 (localhost),4=SSLSocket.startHandshake,5=default]],3=127.0.0.1(1414),5=RemoteTCPConnection.protocolConnect] 
    at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2282) 
    at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1294) 
    at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:376) 
    at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:560) 
    at com.ibm.mq.MQSESSION.MQCONNX_j(MQSESSION.java:916) 
    at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:235) 
    ... 12 more 
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeException[Remote host closed connection during handshake],3=localhost/127.0.0.1:1414 (localhost),4=SSLSocket.startHandshake,5=default] 
    at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1329) 
    at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:863) 
    at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:409) 
    at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:305) 
    at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:146) 
    at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1730) 
    ... 17 more 
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake 
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:992) 
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) 
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403) 
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387) 
    at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$6.run(RemoteTCPConnection.java:1298) 
    at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection$6.run(RemoteTCPConnection.java:1290) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:1290) 
    ... 22 more 
Caused by: java.io.EOFException: SSL peer shut down incorrectly 
    at sun.security.ssl.InputRecord.read(InputRecord.java:505) 
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973) 
    ... 29 more 

以下は、キューマネージャ(qmanager)のログファイルです。

2017-06-24 11:31:11 - Process(25266.5) User(root) Program(amqrmppa) 
        Host(hasitha-HP-Pavilion-g6-Notebook-PC) Installation(Installation1) 
        VRMF(8.0.0.4) QMgr(qmanager) 

AMQ9660: SSL key repository: password stash file absent or unusable. 

EXPLANATION: 

The SSL key repository cannot be used because MQ cannot obtain a password to access 
it. Reasons giving rise to this error include: 

(a) the key database file and password stash file are not present in the 
     location configured for the key repository, 

(b) the key database file exists in the correct place but that no password 
     stash file has been created for it, 

(c) the files are present in the correct place but the userid under which MQ is 
     running does not have permission to read them, 

(d) one or both of the files are corrupt. 


The channel is '????'; in some cases its name cannot be determined and so is 
shown as '????'. The channel did not start. 
ACTION: 
Ensure that the key repository variable is set to where the key database file 
is. Ensure that a password stash file has been associated with the key database 
file in the same directory, and that the userid under which MQ is running has 
read access to both files. If both are already present and readable in the 
correct place, delete and recreate them. Restart the channel. 
----- amqccisa.c : 6283 ------------------------------------------------------- 
2017-06-24 11:31:11 - Process(25266.5) User(root) Program(amqrmppa) 
        Host(hasitha-HP-Pavilion-g6-Notebook-PC) Installation(Installation1) 
        VRMF(8.0.0.4) QMgr(qmanager) 

AMQ9999: Channel '????' to host 'localhost (127.0.0.1)' ended abnormally. 

EXPLANATION: 
The channel program running under process ID 25266 for channel '????' ended 
abnormally. The host name is 'localhost (127.0.0.1)'; in some cases the host 
name cannot be determined and so is shown as '????'. 
ACTION: 
Look at previous error messages for the channel program in the error logs to 
determine the cause of the failure. Note that this message can be excluded 
completely or suppressed by tuning the "ExcludeMessage" or "SuppressMessage" 
attributes under the "QMErrorLog" stanza in qm.ini. Further information can be 
found in the System Administration Guide. 
----- amqrmrsa.c : 930 -------------------------------------------------------- 
2017-06-24 11:33:54 - Process(25266.6) User(root) Program(amqrmppa) 
        Host(hasitha-HP-Pavilion-g6-Notebook-PC) Installation(Installation1) 
        VRMF(8.0.0.4) QMgr(qmanager) 

AMQ9660: SSL key repository: password stash file absent or unusable. 

EXPLANATION: 
The SSL key repository cannot be used because MQ cannot obtain a password to 
access it. Reasons giving rise to this error include: 
(a) the key database file and password stash file are not present in the 
    location configured for the key repository, 
(b) the key database file exists in the correct place but that no password 
    stash file has been created for it, 
(c) the files are present in the correct place but the userid under which MQ is 
    running does not have permission to read them, 
(d) one or both of the files are corrupt. 

The channel is '????'; in some cases its name cannot be determined and so is 
shown as '????'. The channel did not start. 
ACTION: 
Ensure that the key repository variable is set to where the key database file 
is. Ensure that a password stash file has been associated with the key database 
file in the same directory, and that the userid under which MQ is running has 
read access to both files. If both are already present and readable in the 
correct place, delete and recreate them. Restart the channel. 
----- amqccisa.c : 6283 ------------------------------------------------------- 
2017-06-24 11:33:54 - Process(25266.6) User(root) Program(amqrmppa) 
        Host(hasitha-HP-Pavilion-g6-Notebook-PC) Installation(Installation1) 
        VRMF(8.0.0.4) QMgr(qmanager) 

AMQ9999: Channel '????' to host 'localhost (127.0.0.1)' ended abnormally. 

EXPLANATION: 
The channel program running under process ID 25266 for channel '????' ended 
abnormally. The host name is 'localhost (127.0.0.1)'; in some cases the host 
name cannot be determined and so is shown as '????'. 
ACTION: 
Look at previous error messages for the channel program in the error logs to 
determine the cause of the failure. Note that this message can be excluded 
completely or suppressed by tuning the "ExcludeMessage" or "SuppressMessage" 
attributes under the "QMErrorLog" stanza in qm.ini. Further information can be 
found in the System Administration Guide. 
----- amqrmrsa.c : 930 -------------------------------------------------------- 
2017-06-24 11:33:55 - Process(25266.7) User(root) Program(amqrmppa) 
        Host(hasitha-HP-Pavilion-g6-Notebook-PC) Installation(Installation1) 
        VRMF(8.0.0.4) QMgr(qmanager) 

AMQ9660: SSL key repository: password stash file absent or unusable. 

EXPLANATION: 
The SSL key repository cannot be used because MQ cannot obtain a password to 
access it. Reasons giving rise to this error include: 
(a) the key database file and password stash file are not present in the 
    location configured for the key repository, 
(b) the key database file exists in the correct place but that no password 
    stash file has been created for it, 
(c) the files are present in the correct place but the userid under which MQ is 
    running does not have permission to read them, 
(d) one or both of the files are corrupt. 

The channel is '????'; in some cases its name cannot be determined and so is 
shown as '????'. The channel did not start. 
ACTION: 
Ensure that the key repository variable is set to where the key database file 
is. Ensure that a password stash file has been associated with the key database 
file in the same directory, and that the userid under which MQ is running has 
read access to both files. If both are already present and readable in the 
correct place, delete and recreate them. Restart the channel. 
----- amqccisa.c : 6283 ------------------------------------------------------- 
2017-06-24 11:33:55 - Process(25266.7) User(root) Program(amqrmppa) 
        Host(hasitha-HP-Pavilion-g6-Notebook-PC) Installation(Installation1) 
        VRMF(8.0.0.4) QMgr(qmanager) 

AMQ9999: Channel '????' to host 'localhost (127.0.0.1)' ended abnormally. 

EXPLANATION: 
The channel program running under process ID 25266 for channel '????' ended 
abnormally. The host name is 'localhost (127.0.0.1)'; in some cases the host 
name cannot be determined and so is shown as '????'. 
ACTION: 
Look at previous error messages for the channel program in the error logs to 
determine the cause of the failure. Note that this message can be excluded 
completely or suppressed by tuning the "ExcludeMessage" or "SuppressMessage" 
attributes under the "QMErrorLog" stanza in qm.ini. Further information can be 
found in the System Administration Guide. 
----- amqrmrsa.c : 930 -------------------------------------------------------- 

this.Iを解決する方法上の任意のアイデアは、ユーザグループMQMとの両方のルートと$ USER(hasitha)を持っていると、そのグループのユーザーです。

答えて

1

このチュートリアルはWindows上にあるようですが、あなたの最終的なコメントからは、あなたはUnixシステム上にいると思います。

キュー・マネージャーの鍵データベース・ファイルの所有権を検査する必要があります。この時

あなたのキュー・マネージャーのエラー・ログのヒントそれは言う: - :\ tempに\ ssldemo1 \チュートリアルでは、変更

(c) the files are present in the correct place but the userid under which MQ is 
     running does not have permission to read them, 

キュー・マネージャーの鍵データベース・ファイルを含むディレクトリ、Cに行きますそこに4つのファイルの所有権は、以下のコマンドでMQMします -

chown mqm TEST.QM1.* 
+0

をまだ同じエラーがup.I'veがユーザグループMQMにルートと$ USER(hasitha)を加えポップと私はMQを実行しています私は、キーデータベースとパスワードstashファイルを/ var/mqm/qmgrs/qmanager/sslディレクトリに追加する必要があると思う(私のキューマネージャー名はqmanagerです)。しかし、ユーザーhasithaから私はsslフォルダーを開くことができません。私はファイルssl(私はユーザーmithにhasithaを追加しましたが、私は)/ var/mqm/qmgrsを使用して、/qmanager/sslファイルを追加しました。これは正しい手順ですか? – Hussey123

+0

もう1つの問題は、rootからMQExplorerを起動したときにikeymanが起動しないことですが、$ USER(hasitha)でのみ起動されます。 IBM MQ 8.0にsslを追加する正しい方法を教えてください。私はhttp://sadockobeth.blogspot.com/2014/03/how-to-install-ibm-websphere-mq-75-on.htmlに従いました。はじめてIBM MQをインストールするとき – Hussey123

+0

@ Hussey123 mqmユーザーとして実行された次のコマンドの出力をポストする: 'ls -l/var/mqm/qmgrs/qmanager/ssl' – JoshMc

関連する問題