2016-12-09 24 views
0

是否需要使用setConnectionNameList(String)方法中的任何額外jar文件或預配置來完成MQQueueConnectionFactory無法使用MQQueueConnectionFactory的SetConnectionNameList方法

import com.ibm.mq.jms.*; 
MQQueueConnectionFactory connectionFactory = new MQQueueConnectionFactory(); 
connectionFactory.setConnectionNameList("hostName(port),hostName(port)"); 
connectionFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP); 
connectionFactory.setQueueManager("queueManagerName"); 
connectionFactory.setChannel("CLIENTCONNECTION"); 

的Eclipse拋出下面所述的錯誤:

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method setConnectionNameList(String) is undefined for the type MQQueueConnectionFactory

回答

0

setConnectionNameList的WebSphere MQ的7.0.1 API中推出。是否有可能使用舊版本的MQ JAR?

+0

是的,我正在使用WebSphere MQ 7.0.1。我在google找到的最新JAR是com.ibm.mqjms-6.0.1.1.jar。你能告訴我你正在使用哪個版本的JAR嗎? – Ifthikar