jms的问题,connection not found
热门软件下载:
weblogic 7.0环境下用jms
context ctx = null;
hashtable ht = new hashtable();
ht.put(context.initial_context_factory,
"weblogic.jndi.wlinitialcontextfactory");
① ht.put(context.provider_url, "t3://192.168.1.82:7001");
ctx = new initialcontext(ht);
queueconnectionfactory qcf = (queueconnectionfactory) ctx.lookup(
"jmsfactory");
qc = qcf.createqueueconnection();
② qs = qc.createqueuesession(false,
javax.jms.queuesession.auto_acknowledge);
queue q = (queue) ctx.lookup("testq");
qsender = qs.createsender(q);
qsender.send(msg);
system.out.println("successful run onmessage....");
}
如果①处的地址是本机的,那么成功执行
如果②处的地址不是本机的,则在②出跳出异常:connection not found
实在是搞不懂为什么?
请教,谢谢
推荐阅读
相关评论