Announcement Announcement Module
Collapse
No announcement yet.
JBoss and Spring JCA JMS Message Endpoint Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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:

    Code:
         <bean id="jmsContainer"
        class="org.springframework.jms.listener.endpoint.JmsMessageEndpointManager">
            <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" />                
                </bean>
            </property>
            <property name="resourceAdapter">
                <bean factory-bean="mbeanServer" factory-method="getAttribute">
                    <constructor-arg>
                        <bean class="org.springframework.jmx.support.ObjectNameManager"
                            factory-method="getInstance">
                            <constructor-arg value="jboss.jca:name='jms-ra.rar',service=RARDeployment" />
                        </bean>
                    </constructor-arg>
                    <constructor-arg value="ResourceAdapter" />
                </bean>
            </property>
        </bean>
    
        <bean id="mbeanServer" class="org.jboss.mx.util.MBeanServerLocator" 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:

    Code:
    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(AbstractMessageEndpointFactory.java:187)
           at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:171)
           at org.jboss.jms.client.container.ClientConsumer.callOnMessageStatic(ClientConsumer.java:160)
           at org.jboss.jms.client.container.SessionAspect.handleRun(SessionAspect.java:831)
           at org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect14.invoke(SessionAspect14.java)
           at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
           at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)
           at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
           at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
           at org.jboss.jms.client.delegate.ClientSessionDelegate.run(ClientSessionDelegate.java)
           at org.jboss.jms.client.JBossSession.run(JBossSession.java:199)
           at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:237)
           at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:213)
           at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
           at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:756)
           at java.lang.Thread.run(Thread.java:595)
    Caused by: javax.transaction.NotSupportedException
           at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.begin(BaseTransaction.java:79)
           at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.begin(BaseTransactionManagerDelegate.java:77)
           at org.springframework.transaction.jta.JtaTransactionManager.createTransaction(JtaTransactionManager.java:1181)
           at org.springframework.jca.endpoint.AbstractMessageEndpointFactory$TransactionDelegate.beginTransaction(AbstractMessageEndpointFactory.java:274)
           at org.springframework.jca.endpoint.AbstractMessageEndpointFactory$AbstractMessageEndpoint.beforeDelivery(AbstractMessageEndpointFactory.java:184)
    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.

    Summer

  • #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?

    Comment

    Working...
    X