activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lkogan <leonid.ko...@gmail.com>
Subject JBOSS RA transaction failures
Date Fri, 26 Aug 2011 07:17:35 GMT
Hi there,
I'm using AMQ resource adapter for JBOSS 6 MDB.
The receiver works perfectly, but sometime I get this exception when the
message is sent out of the MDB (to the response queue). 
I've tried two versions of RA 5.4.2 and 5.5.0 - same effect!

I'd really appreciate some help!

Here's my activemq-jms-ds.xml:

<?xml version="1.0" encoding="UTF-8"?>

&lt;!DOCTYPE connection-factories
    PUBLIC &quot;-//JBoss//DTD JBOSS JCA Config 1.5//EN&quot;
    &quot;http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd&quot;&gt;

<connection-factories>

  
      <tx-connection-factory>
      <jndi-name>activemq/QueueConnectionFactory</jndi-name>
      <xa-transaction/>
      <track-connection-by-tx/>
	  
      <rar-name>activemq-ra.rar</rar-name>
     
<connection-definition>javax.jms.ConnectionFactory</connection-definition>
      
	  <ServerUrl>tcp://activemq.kenes.loc:61616</ServerUrl>
      
      <min-pool-size>100</min-pool-size>
      <max-pool-size>2000</max-pool-size>
      <blocking-timeout-millis>30000</blocking-timeout-millis>
      <idle-timeout-minutes>3</idle-timeout-minutes>
   </tx-connection-factory>

   <mbean code="org.jboss.resource.deployment.AdminObject"
name="activemq.queue:name=TaxReqQ">
		<attribute name="JNDIName">activemq/queue/TaxReqQ</attribute>
		<depends
optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra.rar'</depends>
		<attribute name="Type">javax.jms.Queue</attribute>
		<attribute
name="Properties">PhysicalName=activemq/queue/TaxReqQ</attribute>
	</mbean>

	<mbean code="org.jboss.resource.deployment.AdminObject"
name="activemq.queue:name=TaxRespQ">
		<attribute name="JNDIName">activemq/queue/TaxRespQ</attribute>
		<depends
optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra.rar'</depends>
		<attribute name="Type">javax.jms.Queue</attribute>
		<attribute
name="Properties">PhysicalName=activemq/queue/TaxRespQ</attribute>
	</mbean>  

</connection-factories>


And ra.xml:

<?xml version="1.0" encoding="UTF-8"?>


<connector xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
    version="1.5">
    <description>ActiveMQ  inbound and outbound JMS
ResourceAdapter</description>
    <display-name>ActiveMQ JMS Resource Adapter</display-name>
    <vendor-name>activemq.org</vendor-name>
    <eis-type>JMS 1.1</eis-type>
    <resourceadapter-version>1.0</resourceadapter-version>
    <license>
        <description>
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
   
    http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
        </description>
        <license-required>true</license-required>
    </license>
    <resourceadapter>
       
<resourceadapter-class>org.apache.activemq.ra.ActiveMQResourceAdapter</resourceadapter-class>
        <config-property>
            <description>
              The URL to the ActiveMQ server that you want this connection
to connect to.  If using
              an embedded broker, this value should be 'vm://localhost'.
            </description>
            <config-property-name>ServerUrl</config-property-name>
            <config-property-type>java.lang.String</config-property-type>
           
<config-property-value>tcp://activemq.kenes.loc:61616</config-property-value>
            
        </config-property>
        <config-property>
            <description>The default user name that will be used to
establish connections to the ActiveMQ server.</description>
            <config-property-name>UserName</config-property-name>
            <config-property-type>java.lang.String</config-property-type>
            <config-property-value>defaultUser</config-property-value>
        </config-property>
        <config-property>
            <description>The default password that will be used to log the
default user into the ActiveMQ server.</description>
            <config-property-name>Password</config-property-name>
            <config-property-type>java.lang.String</config-property-type>
            <config-property-value>defaultPassword</config-property-value>
        </config-property>
        <config-property>
            <description>The client id that will be set on the connection
that is established to the ActiveMQ server.</description>
            <config-property-name>Clientid</config-property-name>
            <config-property-type>java.lang.String</config-property-type>
        </config-property>
        <config-property>
            <description>Boolean to configure if outbound connections should
reuse the inbound connection's session for sending messages.</description>
            <config-property-name>UseInboundSession</config-property-name>
            <config-property-type>java.lang.Boolean</config-property-type>
            <config-property-value>false</config-property-value>
        </config-property>

			  
        <config-property>
            <description>
              Sets the XML configuration file used to configure the embedded
ActiveMQ broker via 
              Spring if using embedded mode.
              
              BrokerXmlConfig is the filename which is assumed to be on the
classpath unless 
              a URL is specified. So a value of foo/bar.xml would be assumed
to be on the 
              classpath whereas file:dir/file.xml would use the file system. 
              Any valid URL string is supported.              
            </description>
            <config-property-name>BrokerXmlConfig</config-property-name>
            <config-property-type>java.lang.String</config-property-type>
            <config-property-value></config-property-value>
            
        </config-property>

        <outbound-resourceadapter>
            <connection-definition>
               
<managedconnectionfactory-class>org.apache.activemq.ra.ActiveMQManagedConnectionFactory</managedconnectionfactory-class>
               
<connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface>
               
<connectionfactory-impl-class>org.apache.activemq.ra.ActiveMQConnectionFactory</connectionfactory-impl-class>
               
<connection-interface>javax.jms.Connection</connection-interface>
               
<connection-impl-class>org.apache.activemq.ra.ManagedConnectionProxy</connection-impl-class>
            </connection-definition>
            <connection-definition>
               
<managedconnectionfactory-class>org.apache.activemq.ra.ActiveMQManagedConnectionFactory</managedconnectionfactory-class>
               
<connectionfactory-interface>javax.jms.QueueConnectionFactory</connectionfactory-interface>
               
<connectionfactory-impl-class>org.apache.activemq.ra.ActiveMQConnectionFactory</connectionfactory-impl-class>
               
<connection-interface>javax.jms.QueueConnection</connection-interface>
               
<connection-impl-class>org.apache.activemq.ra.ManagedConnectionProxy</connection-impl-class>
            </connection-definition>
            <connection-definition>
               
<managedconnectionfactory-class>org.apache.activemq.ra.ActiveMQManagedConnectionFactory</managedconnectionfactory-class>
               
<connectionfactory-interface>javax.jms.TopicConnectionFactory</connectionfactory-interface>
               
<connectionfactory-impl-class>org.apache.activemq.ra.ActiveMQConnectionFactory</connectionfactory-impl-class>
               
<connection-interface>javax.jms.TopicConnection</connection-interface>
               
<connection-impl-class>org.apache.activemq.ra.ManagedConnectionProxy</connection-impl-class>
            </connection-definition>
            <transaction-support>XATransaction</transaction-support>
            <authentication-mechanism>
               
<authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
               
<credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
            </authentication-mechanism>
            <reauthentication-support>false</reauthentication-support>
        </outbound-resourceadapter>
        <inbound-resourceadapter>
            <messageadapter>
                <messagelistener>
                   
<messagelistener-type>javax.jms.MessageListener</messagelistener-type>
                    <activationspec>
                       
<activationspec-class>org.apache.activemq.ra.ActiveMQActivationSpec</activationspec-class>
                        
                        <required-config-property>
                           
<config-property-name>destination</config-property-name>
                        </required-config-property>
                        <required-config-property>
                           
<config-property-name>destinationType</config-property-name>
                        </required-config-property>
                        
                    </activationspec>
                </messagelistener>
            </messageadapter>
        </inbound-resourceadapter>
        <adminobject>
            <adminobject-interface>javax.jms.Queue</adminobject-interface>
           
<adminobject-class>org.apache.activemq.command.ActiveMQQueue</adminobject-class>
            <config-property>
                <config-property-name>PhysicalName</config-property-name>
               
<config-property-type>java.lang.String</config-property-type>
            </config-property>
        </adminobject>
        <adminobject>
            <adminobject-interface>javax.jms.Topic</adminobject-interface>
           
<adminobject-class>org.apache.activemq.command.ActiveMQTopic</adminobject-class>
            <config-property>
                <config-property-name>PhysicalName</config-property-name>
               
<config-property-type>java.lang.String</config-property-type>
            </config-property>
        </adminobject>
    </resourceadapter>
</connector>

 10:07:13,017 WARN  [org.apache.activemq.ra.ActiveMQManagedConnection]
Connection failed: javax.jms.JMSException: Transaction
'XID:131076:00000000000000000000ffffac14283b0000126a4e57451800000d2e31:00000000000000000000ffffac14283b0000126a4e57451800000d2f'
has not been started.
10:07:13,017 WARN 
[org.jboss.resource.connectionmanager.TxConnectionManager] Connection error
occured:
org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@d4c86b1[state=NORMAL
mc=org.apache.activemq.ra.ActiveMQManagedConnection@71fb1192 handles=0
lastUse=1314342432939 permit=true trackByTx=true
mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@531cc7a1
context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@67645a8
xaResource=org.apache.activemq.ra.ActiveMQManagedConnection$1@1b1ed549
txSync=null]: javax.jms.JMSException: Transaction
'XID:131076:00000000000000000000ffffac14283b0000126a4e57451800000d2e31:00000000000000000000ffffac14283b0000126a4e57451800000d2f'
has not been started.
	at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
[:5.4.2]
	at
org.apache.activemq.ActiveMQConnection.onAsyncException(ActiveMQConnection.java:1833)
[:5.4.2]
	at
org.apache.activemq.ActiveMQConnection$2$1.run(ActiveMQConnection.java:1754)
[:5.4.2]
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[:1.6.0_26]
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[:1.6.0_26]
	at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
Caused by: javax.transaction.xa.XAException: Transaction
'XID:131076:00000000000000000000ffffac14283b0000126a4e57451800000d2e31:00000000000000000000ffffac14283b0000126a4e57451800000d2f'
has not been started.
	at
org.apache.activemq.broker.TransactionBroker.getTransaction(TransactionBroker.java:290)
[:5.4.2]
	at
org.apache.activemq.broker.TransactionBroker.send(TransactionBroker.java:211)
[:5.4.2]
	at
org.apache.activemq.broker.MutableBrokerFilter.send(MutableBrokerFilter.java:135)
[:5.4.2]
	at
org.apache.activemq.broker.TransportConnection.processMessage(TransportConnection.java:462)
[:5.4.2]
	at
org.apache.activemq.command.ActiveMQMessage.visit(ActiveMQMessage.java:677)
[:5.4.2]
	at
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:311)
[:5.4.2]
	at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:185)
[:5.4.2]
	at
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:69)
[:5.4.2]
	at
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
[:5.4.2]
	at
org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:228)
[:5.4.2]
	at
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
[:5.4.2]
	at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:220)
[:5.4.2]
	at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:202)
[:5.4.2]
	... 1 more

10:07:13,017 ERROR
[org.jboss.resource.connectionmanager.TxConnectionManager] There is
something wrong with the pooling?: java.lang.IllegalStateException:
afterCompletion called with wrong tx! Expected:
TxSync241222882{tx=TransactionImple < ac, BasicAction:
0:ffffac14283b:126a:4e574518:d2e status: ActionStatus.COMMITTED >
wasTrackByTx=true enlisted=true}, actual: null
	at
org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.afterCompletion(TxConnectionManager.java:1021)
[:6.0.0.Final]
	at
org.jboss.resource.connectionmanager.TransactionSynchronizer.invokeAfter(TransactionSynchronizer.java:308)
[:6.0.0.Final]
	at
org.jboss.resource.connectionmanager.TransactionSynchronizer.afterCompletion(TransactionSynchronizer.java:272)
[:6.0.0.Final]
	at
com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.afterCompletion(SynchronizationImple.java:117)
[:6.0.0.Final]
	at
com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:371)
[:6.0.0.Final]
	at
com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:104)
[:6.0.0.Final]
	at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:159)
[:6.0.0.Final]
	at
com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1158)
[:6.0.0.Final]
	at
com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:119)
[:6.0.0.Final]
	at
com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
[:6.0.0.Final]
	at
org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.endTransaction(MessageInflowLocalProxy.java:464)
[:1.7.17]
	at
org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.finish(MessageInflowLocalProxy.java:343)
[:1.7.17]
	at
org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.after(MessageInflowLocalProxy.java:259)
[:1.7.17]
	at
org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:140)
[:1.7.17]
	at $Proxy141.afterDelivery(Unknown Source)	at
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.afterDelivery(MessageEndpointProxy.java:128)
[:5.4.2]
	at
org.apache.activemq.ra.MessageEndpointProxy.afterDelivery(MessageEndpointProxy.java:69)
[:5.4.2]
	at
org.apache.activemq.ra.ServerSessionImpl.afterDelivery(ServerSessionImpl.java:224)
[:5.4.2]
	at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:897)
[:5.4.2]
	at org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:169)
[:5.4.2]
	at org.jboss.resource.work.WorkWrapper.run(WorkWrapper.java:172)
[:6.0.0.Final]
	at
org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)
[:2.0.0.CR7]
	at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:801)
[:2.0.0.CR7]
	at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)
[:2.0.0.CR7]
	at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:842)
[:2.0.0.CR7]
	at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
	at org.jboss.threads.JBossThread.run(JBossThread.java:122) [:2.0.0.CR7]


--
View this message in context: http://activemq.2283324.n4.nabble.com/JBOSS-RA-transaction-failures-tp3770177p3770177.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message