MQ连接被拒绝

时间:2017-06-12 15:08:31

标签: java ibm-mq aem

我正在尝试从AEM 6.1连接IBM MQ 8,以实现将来自AEM的内容XML在发布时传输到MQ的实现。

MQ java / lib安装文件夹中的所有jar都已复制到项目lib目录。

java实现使用以下包:

import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TextMessage;

import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ibm.mq.jms.MQQueue;
import com.ibm.mq.jms.MQQueueConnectionFactory;
import com.ibm.msg.client.wmq.WMQConstants;

代码段:

QueueSession qSession = null;
       QueueConnection qConn = null;
       try {
           LOGGER.info(“Sending XML message...“);
           final MQQueueConnectionFactory mqConnFact = new MQQueueConnectionFactory();
           mqConnFact.setHostName(queueServerUrl);
           mqConnFact.setPort(Integer.parseInt(queueServerUrlPort));
           mqConnFact.setQueueManager(queueManager);
           mqConnFact.setChannel(queueChannel);
           mqConnFact.setTransportType(WMQConstants.WMQ_CM_CLIENT);
           LOGGER.info(“MQQueueConnectionFactory: ” + mqConnFact);
           qConn = mqConnFact.createQueueConnection(queueUsername, queuePassword);
           LOGGER.info(“Queue Connection: ” + qConn);
           qConn.start();
           LOGGER.info(“Queue Connection after start: ” + qConn);
           final Queue queue = new MQQueue(queueName);
           LOGGER.info(“Queue: ” + queue);
           qSession = qConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
           LOGGER.info(“Queue Session: ” + qSession);
           final QueueSender qSender = qSession.createSender(queue);
           LOGGER.info(“Queue Sender: ” + qSender);
           final TextMessage message = qSession.createTextMessage();
           message.setText(xmlMessage);
           LOGGER.info(“Message: ” + message);
           qSender.send(message);
           LOGGER.info(“Message Sent...“);

错误代码段

12.06.2017 12:28:19.428 *ERROR* [pool-5-thread-17-<main queue>(com/sling/eventing/publish/job)] com.abc.wcs.service.impl.MSPagePublishControllerServiceImpl Exception occurred while processing publish job
com.abc.commons.exception.business.MSBusinessException: JMS Exception while sending message to Queue.
    at com.abc.wcs.service.impl.MSXmlGeneratorServiceImpl.convertVOtoXMLData(MSXmlGeneratorServiceImpl.java:135)
    at com.abc.wcs.service.impl.MSXmlGeneratorServiceImpl.generateXml(MSXmlGeneratorServiceImpl.java:108)
    at com.abc.wcs.service.impl.MSPagePublishControllerServiceImpl.initServices(MSPagePublishControllerServiceImpl.java:58)
    at com.abc.wcs.event.MSPagePublishEventHandler.process(MSPagePublishEventHandler.java:96)
    at org.apache.sling.event.jobs.JobUtil$1.run(JobUtil.java:366)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: null
    at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:608)
    at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:236)
    at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:440)
    at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:7062)
    at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6453)
    at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:295)
    at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6230)
    at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:144)
    at com.abc.wcs.service.impl.MSXmlMessageToQueueServiceImpl.send(MSXmlMessageToQueueServiceImpl.java:81)
    at com.abc.wcs.service.impl.MSXmlGeneratorServiceImpl.convertVOtoXMLData(MSXmlGeneratorServiceImpl.java:130)
    ... 7 common frames omitted
Caused by: com.ibm.mq.MQException: JMSCMQ0001: JMSCMQ0001, 2, MQCC_FAILED, 2195, MQRC_UNEXPECTED_ERROR
    at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)
    ... 15 common frames omitted
**Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9204: Connection to host 'WCS01.con.abccorp.net(11531)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2195],3=WCS01.con.abccorp.net(11531),5=WMQThreadPool.enqueue]**
    at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:2010)
    at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1227)
    at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:355)
    ... 14 common frames omitted
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195
    at com.ibm.msg.client.wmq.common.internal.WMQThreadPool.enqueue(WMQThreadPool.java:104)
    at com.ibm.mq.jmqi.remote.internal.system.RemoteConnection.setUpAsyncMode(RemoteConnection.java:1949)
    at com.ibm.mq.jmqi.remote.internal.system.RemoteConnection.initSess(RemoteConnection.java:1748)
    at com.ibm.mq.jmqi.remote.internal.system.RemoteConnection.connect(RemoteConnection.java:1115)
    at com.ibm.mq.jmqi.remote.internal.system.RemoteConnectionPool.getConnection(RemoteConnectionPool.java:350)
    at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1599)
    ... 16 common frames omitted
Caused by: com.ibm.msg.client.commonservices.CSIException: JMSCS0002
    at com.ibm.msg.client.commonservices.workqueue.PIWorkQueueManager.enqueueItem(PIWorkQueueManager.java:62)
    at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:220)
    at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:189)
    at com.ibm.msg.client.wmq.common.internal.WMQThreadPool.enqueue(WMQThreadPool.java:86)
    ... 21 common frames omitted

0 个答案:

没有答案