users@glassfish.java.net

ActiveMQ + javax.jms.JMSException: Session's XAResource has not been enlist

From: <glassfish_at_javadesktop.org>
Date: Mon, 18 Jan 2010 03:04:32 PST

Hello

I am using glassfish and I succeeded to setup Activemq like genericra connector. I also succeedeed to create an MDB to listen to a queue and read message.

However when a Web Service try to post a message, I am receiving this error : javax.jms.JMSException: Session's XAResource has not been enlist. How can I solve it please?

thks

Valery






code to post message:
  Connection connection = null;
        Session session = null;
        MessageProducer messageProducer = null;
        TextMessage message = null;

        try {
            connection = connectionFactory.createConnection();
            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            messageProducer = session.createProducer(queue);
            message = session.createTextMessage();


           message.setText(s);
           messageProducer.send(message);

        } catch (JMSException e) {
            System.out.println("Exception occurred: " + e.toString());
        } finally {
            if (connection != null) {
                try {
                    connection.close();
                } catch (JMSException e) {
                }
            }
        }
[Message sent by forum member 'vdetez' (valery_detez_at_hotmail.com)]

http://forums.java.net/jive/thread.jspa?messageID=381520