Announcement Announcement Module
No announcement yet.
JBoss and Spring JCA JMS Message Endpoint Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • JBoss and Spring JCA JMS Message Endpoint

    Hi there,

    I'm tying to set up an MDP using Spring 2.5.5 JmsMessageEndpointManager with JBoss messaging 14.0.SP3 as JMS provider. For this, I configured a Spring bean as follows:

         <bean id="jmsContainer"
            <property name="messageListener" ref="publishingMessageListener" />
            <property name="activationSpec">
                <bean class="org.jboss.resource.adapter.jms.inflow.JmsActivationSpec">
                    <property name="destination" value="queue/demo.src" />
                    <property name="destinationType" value="javax.jms.Queue" />
                    <property name="acknowledgeMode" value="AUTO_ACKNOWLEDGE" />
                    <property name="clientId" value="dummy" />
                    <property name="subscriptionName" value="jca-jms-test" />
                    <property name="user" value="guest" />
                    <property name="password" value="guest" />
                    <property name="maxSession" value="1" />
                    <property name="maxMessages" value="1" />
                    <property name="providerAdapterJNDI" value="java:/DefaultJMSProvider" />
                    <property name="useDLQ" value="false" />                
            <property name="resourceAdapter">
                <bean factory-bean="mbeanServer" factory-method="getAttribute">
                        <bean class=""
                            <constructor-arg value="jboss.jca:name='jms-ra.rar',service=RARDeployment" />
                    <constructor-arg value="ResourceAdapter" />
        <bean id="mbeanServer" class="" factory-method="locateJBoss" />
    According to the documentation, if a transaction manager is not set, the whole thing will be treated within a local transaction. I tried setting the transactionManager property, but running this application will throw the following exception:

    20090916 12:42:43.774 ERROR [WorkManager(3)-6] JmsServerSession.onMessage():  Unexpected error delivering message delegator->JBossMessage[34604556621987840]:PERSISTENT, deliveryId=2
    javax.resource.spi.ApplicationServerInternalException: Failed to begin transaction
           at org.springframework.jca.endpoint.AbstractMessageEndpointFactory$AbstractMessageEndpoint.beforeDelivery(
           at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(
           at org.jboss.jms.client.container.ClientConsumer.callOnMessageStatic(
           at org.jboss.jms.client.container.SessionAspect.handleRun(
           at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$
           at org.jboss.jms.client.container.ClosedInterceptor.invoke(
           at org.jboss.aop.advice.PerInstanceInterceptor.invoke(
           at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$
           at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$
    Caused by: javax.transaction.NotSupportedException
           at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.begin(
           at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.begin(
           at org.springframework.transaction.jta.JtaTransactionManager.createTransaction(
           at org.springframework.jca.endpoint.AbstractMessageEndpointFactory$TransactionDelegate.beginTransaction(
           at org.springframework.jca.endpoint.AbstractMessageEndpointFactory$AbstractMessageEndpoint.beforeDelivery(
    The above exception suggests that setting the transaction manager was interfering with the WorkManager that started the transaction first. It is worth mentioning here, that the resource adapter configured above has both a WorkManager and XATerminator set by default. The later utilizes the Jboss transaction manager service, which is obtained via a jndi lookup of java:/TransactionManager.

    The application would run fine if the transaction manager is removed from JmsMessageEndpointManager. However, this means that it will not be enrolled as a XA resource within the transaction. XA support is an essential requirement for the application I am working on. Is there another way to inject the resource adapter instance into the JmsMessageEndpointManager? Should the bean be configured differently to support XA transactions?

    Any suggestions would be much appreciated.

    Thanks in advance.


  • #2
    JBoss and Spring JCA JMS Message Endpoint

    I'm having exactly the same issue using Spring 2.5.6 and JBoss 4.0.2 (with JBoss MQ).

    Have you been able to workaround it in some way?