问题描述
很直观的Jms程序如下.但是报错了,郁闷中.求大哥们指点一下.publicstaticvoidmain(Stringargs[]){try{MQQueueConnectionFactoryfactory=newMQQueueConnectionFactory();//factory.setChannel("CLIENT.QM_TEST");factory.setQueueManager("QM_TEST");factory.setSSLCipherSuite("SSL_RSA_WITH_NULL_MD5");----服务器连接通道用的是NULL_MD5,MCA为空factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);factory.setPort(2000);factory.setHostName("192.168.171.134");QueueConnectionconnection=factory.createQueueConnection("Administrator","***");QueueSessionsession=connection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);Queuedestination=session.createQueue("Q1");QueueSendersender=session.createSender(destination);TextMessagemsg=session.createTextMessage();msg.setText("HelloTheMQ!!");sender.send(msg);sender.close();//session.commit();session.close();connection.close();}catch(javax.jms.JMSExceptione){e.printStackTrace();System.out.println("**********************LinkExceptioninformation****************");e.getLinkedException().printStackTrace();System.out.println("******************************************************************");}catch(Exceptione){e.printStackTrace();}}我用keyman做的两个keyStore,一个是给Jms程序用的,一个是给MQmanager使用由于我没有找到可以使用的ca,我这两个keyStore中间都定义有用createnewself-singercertificate定义自己的ca,然后分别导出签证对于jms的keyStore我导入了别名是ibmwebspheremqqm_test的签证,对于mq使用的keystore(放在对应D:IBMWebSphereMQQmgrsQM_TESTssl)名字叫keyStore.jks我导入的是jmskeyStoreca生成的证书.在导入的时候也只有用singercertificate的add,是不是这样有错啊现在报如下错误(太长了贴不下,见附件),我能确定是ssl配置的问题,因为我在不使用ssl(使用密码和用户的时候),只用factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);的时候目的队列是可以受到消息的.
解决方案
解决方案二:
自己顶一个,大侠高手神仙们快来看看啊.小人很菜,刚刚开始了解MQ,我用的是v7,错误是:com.ibm.mq.MQException:JMSCMQ0001:WebSphereMQcallfailedwithcompcode'2'('MQCC_FAILED')reason'2397'('MQRC_JSSE_ERROR').atcom.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:206)atcom.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:410)**********************LinkExceptioninformation****************atcom.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:7855)atcom.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7331)atcom.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:276)atcom.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6055)atcom.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:144)atzsh_sender.main(zsh_sender.java:29)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atcom.intellij.rt.execution.application.AppMain.main(AppMain.java:90)Causedby:com.ibm.mq.jmqi.JmqiException:CC=2;RC=2397;AMQ9771:SSLhandshakefailed.[1=java.net.SocketException[java.security.NoSuchAlgorithmException:Errorconstructingimplementation(algorithm:Default,provider:SunJSSE,class:com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl)],3=SHIHUA.ncs.corp.int-ads/192.168.171.134:2000(SHIHUA.ncs.corp.int-ads),4=SSLSocket.createSocket,5=default]atcom.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.makeSocketSecure(RemoteTCPConnection.java:1544)atcom.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:643)atcom.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:980)atcom.ibm.mq.jmqi.remote.internal.system.RemoteConnection.connect(RemoteConnection.java:989)atcom.ibm.mq.jmqi.remote.internal.system.RemoteConnectionPool.getConnection(RemoteConnectionPool.java:293)atcom.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1371)atcom.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:331)...11moreCausedby:java.net.SocketException:java.security.NoSuchAlgorithmException:Errorconstructingimplementation(algorithm:Default,provider:SunJSSE,class:com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl)atjavax.net.ssl.DefaultSSLSocketFactory.throwException(SSLSocketFactory.java:179)atjavax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java:199)atcom.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.makeSocketSecure(RemoteTCPConnection.java:1537)...17moreCausedby:java.security.NoSuchAlgorithmException:Errorconstructingimplementation(algorithm:Default,provider:SunJSSE,class:com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl)atjava.security.Provider$Service.newInstance(Provider.java:1245)atsun.security.jca.GetInstance.getInstance(GetInstance.java:220)atsun.security.jca.GetInstance.getInstance(GetInstance.java:147)atjavax.net.ssl.SSLContext.getInstance(SSLContext.java:125)atjavax.net.ssl.SSLContext.getDefault(SSLContext.java:68)atjavax.net.ssl.SSLSocketFactory.getDefault(SSLSocketFactory.java:102)atcom.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.chooseSocketFactory(RemoteTCPConnection.java:1940)atcom.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.makeSocketSecure(RemoteTCPConnection.java:1527)...17moreCausedby:java.io.IOException:Keystorewastamperedwith,orpasswordwasincorrectatsun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:771)atsun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:38)atjava.security.KeyStore.load(KeyStore.java:1185)atcom.sun.net.ssl.internal.ssl.DefaultSSLContextImpl.getDefaultKeyManager(DefaultSSLContextImpl.java:150)atcom.sun.net.ssl.internal.ssl.DefaultSSLContextImpl.<init>(DefaultSSLContextImpl.java:40)atsun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeMethod)atsun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)atsun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)atjava.lang.reflect.Constructor.newInstance(Constructor.java:513)atjava.lang.Class.newInstance0(Class.java:355)atjava.lang.Class.newInstance(Class.java:308)atjava.security.Provider$Service.newInstance(Provider.java:1221)...24moreCausedby:java.security.UnrecoverableKeyException:Passwordverificationfailedatsun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:769)...35more
解决方案三:
在线等你们啊
解决方案四:
现在变成这个错误了,Remotehostclosedconnectionduringhandshake,刚才那个问题是在做密码库的时候换了密码,但是在运行程序的时候没有换回来.com.ibm.msg.client.jms.DetailedJMSException:JMSWMQ0018:Failedtoconnecttoqueuemanager'QM_TEST'withconnectionmode'Client'andhostname'192.168.171.134'.Checkthequeuemanagerisstartedandifrunninginclientmode,checkthereisalistenerrunning.Pleaseseethelinkedexceptionformoreinformation.atcom.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:599)atcom.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:219)atcom.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:410)atcom.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:7855)atcom.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7331)atcom.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:276)atcom.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6055)atcom.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:144)atzsh_sender.main(zsh_sender.java:29)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atcom.intellij.rt.execution.application.AppMain.main(AppMain.java:90)Causedby:com.ibm.mq.MQException:JMSCMQ0001:WebSphereMQcallfailedwithcompcode'2'('MQCC_FAILED')reason'2397'('MQRC_JSSE_ERROR').atcom.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:206)...12moreCausedby:com.ibm.mq.jmqi.JmqiException:CC=2;RC=2397;AMQ9771:SSLhandshakefailed.[1=javax.net.ssl.SSLHandshakeException[Remotehostclosedconnectionduringhandshake],3=SHIHUA.ncs.corp.int-ads/192.168.171.134:2000(SHIHUA.ncs.corp.int-ads),4=SSLSocket.startHandshake,5=default]atcom.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:995)atcom.ibm.mq.jmqi.remote.internal.system.RemoteConnection.connect(RemoteConnection.java:989)atcom.ibm.mq.jmqi.remote.internal.system.RemoteConnectionPool.getConnection(RemoteConnectionPool.java:293)atcom.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1371)atcom.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:331)...11moreCausedby:javax.net.ssl.SSLHandshakeException:Remotehostclosedconnectionduringhandshakeatcom.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:808)atcom.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1112)atcom.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1139)atcom.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)atcom.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:989)...15moreCausedby:java.io.EOFException:SSLpeershutdownincorrectlyatcom.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:333)atcom.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:789)...19morecom.ibm.mq.MQException:JMSCMQ0001:WebSphereMQcallfailedwithcompcode'2'('MQCC_FAILED')reason'2397'('MQRC_JSSE_ERROR').**********************LinkExceptioninformation****************atcom.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:206)atcom.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:410)atcom.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:7855)atcom.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7331)atcom.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:276)atcom.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6055)atcom.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:144)atzsh_sender.main(zsh_sender.java:29)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atcom.intellij.rt.execution.application.AppMain.main(AppMain.java:90)Causedby:com.ibm.mq.jmqi.JmqiException:CC=2;RC=2397;AMQ9771:SSLhandshakefailed.[1=javax.net.ssl.SSLHandshakeException[Remotehostclosedconnectionduringhandshake],3=SHIHUA.ncs.corp.int-ads/192.168.171.134:2000(SHIHUA.ncs.corp.int-ads),4=SSLSocket.startHandshake,5=default]atcom.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:995)atcom.ibm.mq.jmqi.remote.internal.system.RemoteConnection.connect(RemoteConnection.java:989)atcom.ibm.mq.jmqi.remote.internal.system.RemoteConnectionPool.getConnection(RemoteConnectionPool.java:293)atcom.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1371)atcom.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:331)...11moreCausedby:javax.net.ssl.SSLHandshakeException:Remotehostclosedconnectionduringhandshakeatcom.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:808)atcom.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1112)atcom.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1139)atcom.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)atcom.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:989)...15moreCausedby:java.io.EOFException:SSLpeershutdownincorrectlyatcom.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:333)atcom.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:789)...19more
解决方案五:
先去下载补丁打上去一下。
解决方案六:
我也遇到通道的错误。。楼主解决了吗?求指教啊。。
解决方案七:
先去下载补丁打上去一下。
解决方案八:
下载补丁打上去一下。
解决方案九:
顶一下。
解决方案十:
请问下下载什么补丁???
解决方案十一:
楼主这个问题解决了吗?我也被这个问题block住了