I'm trying to send a message to IBM MQ (Version: 9.0.0.0), code bellow.
* I have tried with\without the userid and password. When I try the same code with IBM MQ installed on my machine (localhost) it works smoothly.
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();
}
This gives the following exception:
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
What does this exception mean? and how can I solve it?