MQJE001: 完成代码为 '2',原因为 '2035'。

wjzslc 2012-01-05 05:05:10
刚在server2003上安装了websphere mq v7,安装之后建立了队列管理器和队列
然后编写java代码,想mq发送消息,就报这个错误,一下是java代码

package com.wangjz;

import com.ibm.mq.MQC;
import com.ibm.mq.MQEnvironment;
import com.ibm.mq.MQException;
import com.ibm.mq.MQMessage;
import com.ibm.mq.MQPutMessageOptions;
import com.ibm.mq.MQQueue;
import com.ibm.mq.MQQueueManager;

public class MQSend {
protected String qManager = ""; // define name of queue manager
protected String qManagerHost = "";
protected String queuName = ""; // define name of queue
protected MQQueue mqQueue;
protected MQQueueManager qMgr;
public static boolean DEBUG = true;
public void sendMsg(String msg) {
try {
//队列管理器
qManager = "venus.queue.manager";
//主机
qManagerHost = "192.168.1.130";
//队列
queuName = "ORANGE.QUEUE";
MQEnvironment.channel = "SYSTEM.DEF.SVRCONN";
MQEnvironment.hostname = qManagerHost;
qMgr = new MQQueueManager(qManager);
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT;
mqQueue = qMgr.accessQueue(queuName, openOptions);
MQPutMessageOptions pmo = new MQPutMessageOptions();
MQMessage mqMsg = new MQMessage();
mqMsg.write(msg.getBytes());
// 将msg放入队列
mqQueue.put(mqMsg, pmo);
mqQueue.close();
// 断开连接
qMgr.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* @param args
* @throws MQException
*/
public static void main(String[] args) throws MQException {
MQTest test = new MQTest();
test.send("test mq!");

}

}

...全文
2256 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
化外之民 2012-01-18
  • 打赏
  • 举报
回复
授权问题
2035 (X'07F3')MQRC_NOT_AUTHORIZED
Explanation:
The user is not authorized to perform the operation attempted:
JasonYao 2012-01-06
  • 打赏
  • 举报
回复
看看这个博客,对你有没有帮助:
http://blog.csdn.net/javalover_yao/article/details/6387460

2,633

社区成员

发帖
与我相关
我的任务
社区描述
WebSphere 是 IBM 的软件平台。它包含了编写、运行和监视全天候的工业强度的随需应变 Web 应用程序和跨平台、跨产品解决方案所需要的整个中间件基础设施,如服务器、服务和工具。
社区管理员
  • WebSphere社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧