1

我正在尝试将来自 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:

  • ConnectionFactory:名称:bfred1cf 类名:weblogic.rmi.cluster.ClusterableRemoteObjec 绑定名称:jms.bfred1cf 类:weblogic.jms.client.JMSXAConnectionFactory
  • 队列名称:bfred1queue 类名
    :weblogic.jms.common.WrappedDestinationImpl 绑定名称:jms.bfred1queue 类:weblogic.jms.common.DestinationImpl

如果我尝试使用 JMS 适配器将来自 SOA 套件项目 (BPEL) 的消息排入队列,则使用为 CF 配置的出站连接池 (eis/jms/bfre1) 可以正常工作。

有谁知道什么会导致这个错误?

谢谢,法比奥

4

1 回答 1

1

尝试使用:

wlthint3client.jar

而不是 wlclient.jar 和 wljmsclient.jar

于 2014-03-10T17:47:11.857 回答