希望您可以在编译示例程序MQIVP时遇到问题。将7.1.0.6的WebSphere MQ客户端下载到Windows 7 PC并添加外部jar引用后,出现以下错误:
MQSampleMessageManager messageMgr无法解析为一种类型
private MQSampleMessageManager messageMgr;
private String hostname;
private String channel = null;
private String queueMgr;
private MQQueueManager queueManager;
private String port = "-1"; // @L1C
private Hashtable properties = null; // @L1A
// An output stream writer to convert the characters to.......
最佳答案
我正在使用MQ v8002。
MQSampleManager类与MQIVP驻留在同一目录中。您需要设置CLASSPATH。编译时出现以下错误。
MQIVP.java:46: error: cannot find symbol
private MQSampleMessageManager messageMgr;
^
symbol: class MQSampleMessageManager
location: class MQIVP
MQIVP.java:94: error: cannot find symbol
messageMgr = new MQSampleMessageManager("mqjcivp");
^
symbol: class MQSampleMessageManager
location: class MQIVP
2 errors
设置CLASSPATH解决了该问题:
CLASSPATH=%CLASSPATH%;C:\Program Files\IBM\WebSphere MQ\Tools\wmqjav\samples\MQSampleMessageManager.class
关于java - MQSampleMessageManager无法解析为一种类型,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30540288/