1

I'm trying to create an MDB(EJB 3.0) on WebLogic 10.3.5. to listen to a Queue on an external AMQ server. After much work and combination of tutorials i get the following error when deploying on webLogic.

[EJB:015027]The Message-Driven EJB is transactional but JMS connection factory referenced by the JNDI name: ActiveMQXAConnectionFactory is not a JMS XA connection factory.

Here is a brief of the work i have done:

I have added the corresponding libraries to my WLS classpath (following this tuturial http://amadei.com.br/blog/index.php/connecting-weblogic-and-activemq) and I have created the corresponding JMS Modules as indicated in the tutorial. I have used ActiveMQConnectionFactory initially and ActiveMQXAConnectionFactory later, I also ignore the jms. notation an just put plain names as testQueue.

Then create a simple MDB with the following structure. I explicitly defined "connectionFactoryJndiName" property because otherwise it assumes a WebLogic connection factory which is not found, and then raises an error.

@MessageDriven(
        activationConfig = { 
                @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), 
                @ActivationConfigProperty(propertyName = "destination", propertyValue = "testQueue"),
                @ActivationConfigProperty(propertyName = "connectionFactoryJndiName", propertyValue = "ActiveMQXAConnectionFactory")
        }, 
        mappedName = "testQueue")
public class ROMELReceiver implements MessageListener {

    /**
     * Default constructor. 
     */
    public ROMELReceiver() {
        // TODO Auto-generated constructor stub
    }

    /**
     * @see MessageListener#onMessage(Message)
     */
    public void onMessage(Message message) {
        System.out.println("Message received");
    }

}

At this point I'm stuck with the error mentioned above. Even though I use ActiveMQXAConnectionFactory instead of simply ActiveMQConnectionFactory, JNDI resources tree in web logic server shows org.apache.activemq.ActiveMQConnectionFactory as class for my configured connection factory.

am i missing something? or is this just a completely wrong way to connect WebLogic whith AMQ?

Thanks in advance.

4

1 回答 1

0

我知道它很晚,但我最近我不得不做同样的事情并遇到同样的错误。这篇文章帮助了我:

https://community.oracle.com/thread/3903705

基本上它说要在 weblogic 模块的外部服务器选项的 jndi 属性中添加一个新参数。

xa=真。

因为activemq默认不使用Xa连接。

于 2016-12-16T20:55:48.497 回答