activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edwin van der Elst (JIRA)" <>
Subject [jira] Commented: (AMQ-2670) ClassCast Exception in JBoss when using XA
Date Thu, 25 Mar 2010 12:43:07 GMT


Edwin van der Elst commented on AMQ-2670:

An mdb:
@MessageDriven(mappedName = "jms/SimpleMDB", messageListenerInterface = javax.jms.MessageListener.class,
activationConfig = {
        @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue.test"),
        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
        @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue =
        @ActivationConfigProperty(propertyName = "maximumRedeliveries", propertyValue = "0")
@ResourceAdapter(value = "activemq-rar-5.3.0.rar")
public class SimpleMDB implements MessageListener {

But it is not related to the MDB. The problem is that the connectionfactory is not the XA
variant. This is deployed in a -ds.xml ike this:


   <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
      <attribute name="ProviderName">ActiveMQJMSProvider</attribute>
      <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
      <attribute name="FactoryRef">java:/activemq/QueueConnectionFactory</attribute>
      <attribute name="QueueFactoryRef">java:/activemq/QueueConnectionFactory</attribute>
      <attribute name="TopicFactoryRef">java:/activemq/QueueConnectionFactory</attribute>

This will result in a call to ActiveMQManagedConnectionFactory.createConnectionFactory during
startup of JBoss (as configured in the ra.xml). But that will always create a ActiveMQConnectionFactory
and never the ActiveMQXAConnectionFactory. 
And therefore, a ConnectionFactory instance is always bound in the JNDI and not an XAConnectionFactory.
So, it is not a bypass for the rar (it is still needed).

I see in the sources for ActiveMQXAConnectionFactory that all work is handled by the superclass
(ActiveMQConnectionFactory), so it is only in JBoss actually performing the cast on the connectionfactory
that causes a problem.

> ClassCast Exception in JBoss when using XA 
> -------------------------------------------
>                 Key: AMQ-2670
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.3.0
>         Environment: activemq-rar-5.3.0.rar deployed in jboss-5.1.0-GA
>            Reporter: Edwin van der Elst
>         Attachments:, ra.xml
> When deploying the rar under JBoss, the connectionfactory bound in de JNDI tree is always
of type 'ActiveMQConnectionFactory'., while it should be ActiveMQXAConnectionFactory (which
implements XAConnectionFactory).
> I attached a new class that creates the correct type of factory, and this can be configured
in the ra.xml (also attached).

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message