当前位置: 首页 > 知识库问答 >
问题:

IBM MQ调用失败,compcode为“2”('mqcc_failed')原因为“2059”

阳英朗
2023-03-14
private static void foo() throws JMSException {
        Request request = new Request();
        request.setRequestKey("11-12347");
        request.setQueryString("This is a query string!");

        MQQueueConnectionFactory cf = new MQQueueConnectionFactory();
        cf.setHostName("192.168.1.107");
        cf.setPort(1414);
        cf.setAppName("WMQ Tester");
//        cf.createConnection(sccsid, sccsid)
        cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);
        cf.setQueueManager("SanctionManager");
        cf.setChannel("system.def.sanction");

        MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection("hanash", "hanash1");
        MQQueueSession session = (MQQueueSession) connection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);

        MQQueue queue = (MQQueue) session.createQueue("queue:///SanctionQueue");
        MQQueueSender sender = (MQQueueSender) session.createSender(queue);

        ObjectMessage objectMessage = session.createObjectMessage(request);
        connection.start();
        sender.send(objectMessage);
        session.commit();

    }
Exception in thread "main" com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'SanctionManager' with connection mode 'Client' and host name '192.168.1.107(1414)'.
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:595)
    at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:215)
    at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:422)
    at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:8475)
    at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7814)
    at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl._createConnection(JmsConnectionFactoryImpl.java:299)
    at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:236)
    at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6024)
    at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:136)
    at com.dgbi.cre.MQSample.foo(MQSample.java:135)
    at com.dgbi.cre.MQSample.main(MQSample.java:63)
Caused by: com.ibm.mq.MQException: JMSCMQ0001: IBM 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)
    ... 9 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9204: Connection to host '192.168.1.107(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2195;AMQ6047: Conversion not supported. [1=720,5=???]],3=192.168.1.107(1414),5=RemoteConnection.initSess]
    at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2280)
    at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1285)
    at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:376)
    at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:563)
    at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:355)
    ... 8 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ6047: Conversion not supported. [1=720,5=???]
    at com.ibm.mq.jmqi.remote.impl.RemoteConnection.initSess(RemoteConnection.java:1282)
    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:1721)
    ... 12 more
Caused by: java.io.UnsupportedEncodingException: 720
    at com.ibm.mq.jmqi.remote.impl.RemoteConnection.initSess(RemoteConnection.java:1268)
    ... 17 more

共有1个答案

宰父存
2023-03-14

异常中的主要错误是:

Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ6047: Conversion not supported. [1=720,5=???]
Caused by: java.io.UnsupportedEncodingException: 720

这似乎是IBM MQ V9.0.0.0中的一个已知问题,以下APAR中对此进行了说明:

IT17154:Java客户端无法连接到z/OS,在非IBM Java运行时中出现异常“AMQ6047:不支持转换”

 类似资料: