【发布时间】:2013-08-17 12:38:10
【问题描述】:
我正在尝试将来自 java 应用程序的 jms 队列 (weblogic) 上的消息排入队列。
InitialContext ctx = getInitialContext();
qconFactory = (QueueConnectionFactory)ctx.lookup("jms.bfred1cf");
qcon = qconFactory.createQueueConnection();
qsession = qcon.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
queue = (Queue) ctx.lookup("jms.bfred1queue");
private static InitialContext getInitialContext() throws NamingException {
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://soabpm-vm:7001/");
return new InitialContext(env);
}
当我调用 getInitalContext() 方法时,它工作正常。我得到了上下文。 但是当尝试使用上下文获取连接工厂时,会出现以下错误:
<Exception in thread "main" java.lang.AbstractMethodError: weblogic.rmi.internal.RMIEnvironment.getProperties(Ljava/lang/Object;)Ljava/util/Hashtable;
at weblogic.rjvm.ResponseImpl.getRMIClientTimeout(ResponseImpl.java:281)
at weblogic.rjvm.ResponseImpl.<init>(ResponseImpl.java:42)
at weblogic.rjvm.MsgAbbrevOutputStream.sendRecv(MsgAbbrevOutputStream.java:404)
at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:109)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:345)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
at weblogic.jndi.internal.ServerNamingNode_1035_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:423)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
at javax.naming.InitialContext.lookup(InitialContext.java:409)
at demo.Demo.main(Unknown Source)
查看 Weblogic 控制台,JNDI 树我有以下内容:
JMS:
- 连接工厂: 名称:bfred1cf 类名:weblogic.rmi.cluster.ClusterableRemoteObjec 绑定名称:jms.bfred1cf 类:weblogic.jms.client.JMSXAConnectionFactory
- 队列
名称:bfred1queue
类名:weblogic.jms.common.WrappedDestinationImpl 绑定名称:jms.bfred1queue 类:weblogic.jms.common.DestinationImpl
如果我尝试使用出站连接池将来自 SOA 套件项目 (BPEL) 的消息与 JMS 适配器排入队列 (eis/jms/bfre1) 为 CF 配置它工作正常。
有没有人知道什么会导致这个错误?
谢谢, 法比奥
【问题讨论】:
-
这几乎就像您的客户端或服务器没有在其类路径中使用正确版本的 weblogic.jar 文件。 API 的签名不匹配。