错误“无效的代理 URL"同时桥接 ActiveMQ Artemis 7.4 与 Weblogic 12.x [英] Error "Invalid broker URL" while bridging ActiveMQ Artemis 7.4 with Weblogic 12.x

查看:35
本文介绍了错误“无效的代理 URL"同时桥接 ActiveMQ Artemis 7.4 与 Weblogic 12.x的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Oracle 12.x 和 Redhat ActiveMQ Artemis 7.4 之间建立桥梁.这是设置桥接器所做的工作:

I am trying to create bridge between Oracle 12.x and Redhat ActiveMQ Artemis 7.4. This is what has been done to set up the bridge:

  1. 将 artemis-jms-client-all-2.9.0.redhat-00005.jar 设置为 WL 类路径
  2. 将以下属性设置为 WL 类路径:

java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
connectionFactory.ConnectionFactory=amq.xaqcf.myqueue
queue.queues/myqueue=myqueue

但是,我收到以下错误:

However, I get the following error:

java.lang.Exception: javax.resource.ResourceException: ConnectionFactory: failed to get initial context (InitialContextFactory =org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory, url = tcp://brokername:61616?type=XA_CF, user name = amq)
        at weblogic.jms.adapter.JMSBaseConnection.throwResourceException(JMSBaseConnection.java:1750)
        at weblogic.jms.adapter.JMSBaseConnection.startInternal(JMSBaseConnection.java:538)
        at weblogic.jms.adapter.JMSBaseConnection.start(JMSBaseConnection.java:264)
        at 
...
-------------- Linked Exception ------------
javax.naming.NamingException: Invalid broker URL
        at org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory.getInitialContext(ActiveMQInitialContextFactory.java:85)

根据ActiveMQInitialContextFactory.java,这是由于以下块:

According to ActiveMQInitialContextFactory.java, it is due to the following block:

for (Map.Entry<?, ?> entry : environment.entrySet()) {
    String key = entry.getKey().toString();
    if (key.startsWith(connectionFactoryPrefix)) {
        String jndiName = key.substring(connectionFactoryPrefix.length());
        try {
            data.put(jndiName, createConnectionFactory((String) environment.get(key), jndiName));
        } catch (Exception e) {
            e.printStackTrace();
            throw new NamingException("Invalid broker URL");
        }
    }
}

这是 e.printStackTrace() 的异常:

Exception: javax.naming.NameNotFoundException: amq.xaqcf.myqueue
        at org.apache.activemq.artemis.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:236) 
        at javax.naming.InitialContext.lookup(InitialContext.java:417)

我在 Oracle Weblogic 12.x 与 ActiveMQ 6.3 之间桥接没有问题.这里提出了一个类似的问题 是否有兼容 Java 1.7 的 Artemis JMS 客户端? 但它适用于使用 Java 1.7 的 Oracle SOA 10.x.

I have no issue bridging between Oracle Weblogic 12.x with ActiveMQ 6.3. A similar issue was raised here Is there a Java 1.7 compatible Artemis JMS client? but it is for Oracle SOA 10.x which uses java 1.7.

我怎样才能让它工作?应该 ActiveMQInitialContextFactory.java 是否适合?

How can I make it work? Should ActiveMQInitialContextFactory.java be adapted?

推荐答案

你的问题是因为你试图查找连接工厂 amq.xaqcf.myqueue,但是您实际上还没有在 JNDI 属性中定义该连接工厂.相反,您有这一行:

Your problem is coming from the fact that you're attempting to look-up the connection factory amq.xaqcf.myqueue, but you haven't actually defined that connection factory in your JNDI properties. Instead you have this line:

connectionFactory.ConnectionFactory=amq.xaqcf.myqueue

这一行实际上定义了一个名为 ConnectionFactory 的连接工厂,其 URL amq.xaqcf.myqueue 无效.试试这个:

This line actually defines a connection factory called ConnectionFactory with the URL amq.xaqcf.myqueue which is invalid. Try this instead:

connectionFactory.amq.xaqcf.myqueue=tcp://brokername:61616?type=XA_CF

这些属性的语法在Artemis 文档中定义.

这篇关于错误“无效的代理 URL"同时桥接 ActiveMQ Artemis 7.4 与 Weblogic 12.x的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆