问题描述
windows环境下访问Linux环境的MQ服务器通道编码819抛出异常com.ibm.mq.MQException:MQJE001:完成代码为“1”,原因为“2119”。atcom.ibm.mq.MQDestination.getInt(MQDestination.java:650)atcom.ibm.mq.MQDestination.get(MQDestination.java:445)atcom.ibm.mq.pcf.PCFAgent.getBasicQmgrInfo(PCFAgent.java:390)atcom.ibm.mq.pcf.PCFAgent.open(PCFAgent.java:352)atcom.ibm.mq.pcf.PCFAgent.open(PCFAgent.java:306)atcom.ibm.mq.pcf.PCFAgent.connect(PCFAgent.java:204)atcom.ibm.mq.pcf.PCFAgent.<init>(PCFAgent.java:156)atcom.ibm.mq.pcf.PCFMessageAgent.<init>(PCFMessageAgent.java:126)atcom.netstrong.platform.indicator.mq.MQChannelStatusByApiIndicatroCalculate.getSimpleValue(MQChannelStatusByApiIndicatroCalculate.java:76)atcom.netstrong.platform.indicator.AbstractIndicatorCalculate.getValue(AbstractIndicatorCalculate.java:128)atcom.netstrong.platform.polling.service.PollingService$1.run(PollingService.java:388)atcom.netstrong.platform.polling.timer.PollingTaskService.run(PollingTaskService.java:61)atjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)atjava.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)atjava.util.concurrent.FutureTask.run(FutureTask.java:138)atjava.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)atjava.lang.Thread.run(Thread.java:662)代码:MQEnvironment.CCSID=819;//要与队列管理器的一样MQEnvironment.hostname="192.168.101.246";//队列管理器所在的机器名,要能ping通MQEnvironment.port=Integer.parseInt("1410");//队列管理器的监听端口MQEnvironment.channel="SYSTEM.DEF.SVRCONN";PCFMessageAgentagent=null;try{MQQueueManagerqmgr=newMQQueueManager("A");//队列管理器名称agent=newPCFMessageAgent(qmgr);\异常处//agent=newPCFMessageAgent(ip,Integer.parseInt(port),"SYSTEM.DEF.SVRCONN");agent.setCharacterSet(1381);PCFMessagechannel_msg=newPCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);channel_msg.addParameter(CMQCFC.MQCACH_CHANNEL_NAME,"*");PCFMessage[]response=agent.send(channel_msg);for(inti=0;i<response.length;i++){Stringchannelname=response[i].getStringParameterValue(CMQCFC.MQCACH_CHANNEL_NAME);intchannelstautstype=response[i].getIntParameterValue(CMQCFC.MQIACH_CHANNEL_STATUS);if(channelname.trim().equalsIgnoreCase(channel)){simpleValue.setValue(tostauts(channelstautstype));returnsimpleValue;}}result="不活动的";}catch(Exceptione){e.printStackTrace();logger.warn(e,e);}
解决方案
解决方案二:
建议你先用amqsputc命令试试放个消息到QM,看看是否有错误
解决方案三:
建议你先用amqsputc命令试试放个消息到QM,看看是否有错误