I'm the same probelm as the other user in terms of using a simple transacted
client that tries to call session.rollback and get the following exception
in the log.  Ultimately I want the message to end up in the DLQ but it never
gets directed there.  attached is a simple client, my activemq config.

ActiveMQ 5.3.1 & 5.3.2
Using the default activemq.xml configuration file.

Test Case
public class MessageConsumerA {
        private String url = ActiveMQConnection.DEFAULT_BROKER_URL;
        private Session session;
    private Destination destination;
    private int ackMode = Session.AUTO_ACKNOWLEDGE;
    private boolean transacted=true;
    private String subject = "TOOL.DEFAULT";
    javax.jms.MessageConsumer consumer = null;
        /**
         * @param args
         * @throws Exception 
         */
        public static void main(String[] args) throws Exception {
                MessageConsumerA mc = new MessageConsumerA();
                mc.run();

        }
        
        public void run() throws Exception{
                ActiveMQConnectionFactory connectionFactory = new
ActiveMQConnectionFactory(url);
        Connection connection = connectionFactory.createConnection();
        connection.start();
        session = connection.createSession(transacted, ackMode);
        destination = session.createQueue(subject);
        consumer = session.createConsumer(destination);
        Message message = consumer.receive(10000);
        session.rollback();
        System.out.println("Closing connection");
        consumer.close();
        session.close();
        connection.close();
        }

}


Stack Trace:
 WARN | Async error occurred: javax.jms.JMSException: Transaction
'TX:ID:C001318
805-4042-1273606494194-0:0:1' has not been started.
javax.jms.JMSException: Transaction
'TX:ID:C001318805-4042-1273606494194-0:0:1'
has not been started.
        at
org.apache.activemq.broker.TransactionBroker.getTransaction(Transacti
onBroker.java:270)
        at
org.apache.activemq.broker.TransactionBroker.acknowledge(TransactionB
roker.java:190)
        at
org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java
:74)
        at
org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java
:74)
        at
org.apache.activemq.broker.MutableBrokerFilter.acknowledge(MutableBro
kerFilter.java:85)
        at
org.apache.activemq.broker.TransportConnection.processMessageAck(Tran
sportConnection.java:452)
        at org.apache.activemq.command.MessageAck.visit(MessageAck.java:205)
        at
org.apache.activemq.broker.TransportConnection.service(TransportConne
ction.java:300)
        at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportC
onnection.java:178)
        at
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilt
er.java:68)
        at
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireForm
atNegotiator.java:113)
        at
org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityM
onitor.java:216)
        at
org.apache.activemq.transport.TransportSupport.doConsume(TransportSup
port.java:84)
        at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.jav
a:204)
        at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:
186)
        at java.lang.Thread.run(Thread.java:619)
-- 
View this message in context: 
http://old.nabble.com/javax.jms.JMSException%3A-Transaction-%27TX%3AID...%27-not-started-tp28528467p28528467.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to