[ 
https://issues.apache.org/activemq/browse/AMQ-1054?page=comments#action_37510 ] 
            
Guy Pardon commented on AMQ-1054:
---------------------------------

Yes, 4.0.2 too.

Below is a test program (you need the atomikos jars in the classpath, as well 
as all activemq jars). Note that the only atomikos dependency is the Xid format.

Guy

package activemqtest;

import javax.jms.MessageConsumer;
import javax.jms.XAConnection;
import javax.jms.XASession;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;

import org.apache.activemq.ActiveMQXAConnectionFactory;
import org.apache.activemq.command.ActiveMQQueue;

import com.atomikos.datasource.xa.DefaultXidFactory;

public class XATest {
        
        
        public static void main ( String[] args ) throws Exception {
                
                String url = "tcp://localhost:61616";
                String qName = "MyQueue";
                int timeout = 5;
                
                DefaultXidFactory xidFactory = new DefaultXidFactory();
                
                ActiveMQXAConnectionFactory xacf = new 
ActiveMQXAConnectionFactory();
                xacf.setBrokerURL ( url );
                
                ActiveMQQueue queue = new ActiveMQQueue();
                queue.setPhysicalName ( qName );
                
                XAConnection xaconn = xacf.createXAConnection();
                xaconn.start();
                XASession session = xaconn.createXASession();
                XAResource xares = session.getXAResource();
                MessageConsumer receiver = session.getSession().createConsumer 
( queue );
                
                xares.recover ( XAResource.TMSTARTRSCAN );
                xares.recover ( XAResource.TMNOFLAGS );
                xares.setTransactionTimeout ( timeout );
                xares.isSameRM ( xares );
                
                Xid xid = xidFactory.createXid ( "part1" , "part2");
                xares.start ( xid , XAResource.TMNOFLAGS );
                receiver.receive ( timeout );
                xares.end ( xid , XAResource.TMSUCCESS );
                xares.rollback ( xid );
        }

}


> XA recover fails for 4.0.1
> --------------------------
>
>                 Key: AMQ-1054
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1054
>             Project: ActiveMQ
>          Issue Type: Bug
>         Environment: Java, JDK 1.4, Windows, Atomikos TransactionsEssentials 
> for the JTA/XA part
>            Reporter: Guy Pardon
>
> XAResource.recover seems to fail for 4.x of ActiveMQ:
> ERROR IN RECOVERY [thread: SimpleAsyncTaskExecutor-3] on: 06-11-16 
> 08:43:35,152 
> [Lorg.apache.activemq.command.DataStructure; [thread: 
> SimpleAsyncTaskExecutor-3] on: 06-11-16 08:43:35,152 
> at: 
> org.apache.activemq.TransactionContext.recover(TransactionContext.java:508) 
> [thread: SimpleAsyncTaskExecutor-3] on: 06-11-16 08:43:35,152 
> at: com.atomikos.datasource.xa.XATransactionalResource.recover(Unknown 
> Source) [thread: SimpleAsyncTaskExecutor-3] on: 06-11-16 08:43:35,152 
> at: com.atomikos.datasource.xa.XATransactionalResource.endRecovery(Unknown 
> Source) [thread: SimpleAsyncTaskExecutor-3] on: 06-11-16 08:43:35,152 
> at: com.atomikos.icatch.imp.TransactionServiceImp.recover(Unknown Source) 
> [thread: SimpleAsyncTaskExecutor-3] on: 06-11-16 08:43:35,153 
> at: 
> com.atomikos.datasource.xa.XATransactionalResource.setRecoveryService(Unknown 
> Source) [thread: SimpleAsyncTaskExecutor-3] on: 06-11-16 08:43:35,153 
> at: com.atomikos.icatch.system.Configuration.addResource(Unknown Source) 
> [thread: SimpleAsyncTaskExecutor-3] on: 06-11-16 08:43:35,153 
> at: com.atomikos.jms.QueueConnectionFactoryBean.checkSetup(Unknown Source) 
> [thread: SimpleAsyncTaskExecutor-3] on: 06-11-16 08:43:35,153 
> at: com.atomikos.jms.QueueConnectionFactoryBean.createQueueConnection(Unknown 
> Source) [thread: SimpleAsyncTaskExecutor-3] on: 06-11-16 08:43:35,153 
> at: com.atomikos.jms.QueueConnectionFactoryBean.createConnection(Unknown 
> Source) [thread: SimpleAsyncTaskExecutor-3] on: 06-11-16 08:43:35,153 
> Also see http://www.atomikos-support.com/forums/viewtopic.php?t=351 (where I 
> borrowed this stack trace from). We have seen similar things in other 
> applications that tried to use ActiveMQ. I think this is a class cast error 
> in ActiveMQ...
> With 3.1 there is no problem. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to