6 Replies Latest reply on Jan 7, 2004 4:46 AM by Filippo

    DLQ Problem

    vincentchun Newbie

      I add the following in my jbossmq-destinations-service.xml

      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager


      After I restart the JBoss server (jboss-3.2.2RC4), the following out.println is shown:

      02:14:14,038 INFO [DLQHandler] Destroying
      02:14:14,038 INFO [DLQHandler] Destroyed
      02:14:14,038 INFO [DLQHandler] Creating
      02:14:14,038 ERROR [DLQHandler] Initialization failed
      javax.jms.JMSException: Error creating the dlq connection: XAConnectionFactory not bound
      at org.jboss.ejb.plugins.jms.DLQHandler.createService(DLQHandler.java:166)
      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:158)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:458)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:674)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$ExceptionListenerImpl.onException(JMSContainerInvoker.java:1177)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$1.run(JMSContainerInvoker.java:686)
      02:14:14,048 INFO [JMSContainerInvoker] Reconnected to JMS provider
      02:14:14,048 WARN [JMSContainerInvoker] JMS provider failure detected:
      javax.jms.JMSException: Error creating the dlq connection: XAConnectionFactory not bound
      at org.jboss.ejb.plugins.jms.DLQHandler.createService(DLQHandler.java:166)
      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:158)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:458)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:674)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$ExceptionListenerImpl.onException(JMSContainerInvoker.java:1177)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$1.run(JMSContainerInvoker.java:686)
      02:14:14,068 INFO [JMSContainerInvoker] Trying to reconnect to JMS provider

      Do anyone know how to solve this problem?

      Except jbossmq-destinations-service.xml, is there any config file which I need to set?

      Thanks for the helper first!

        • 1. Re: DLQ Problem
          Stephane Nicoll Master

          mmm. Seems we have a side effect here. In general, this error is outputed because JMS could not be deployed in some ways.

          Check the beginning of your server.log file, you should fin usefull clues.

          Regards,

          Stephane

          • 2. Re: DLQ Problem
            vincentchun Newbie

            Thanks for your help first!

            Here is my send message code

            String username = "Vincent";
            QueueConnection conn = null;
            QueueSession session = null;
            TextMessage message = null;
            Queue queue = null;
            try {
            InitialContext ctx = new InitialContext();
            QueueConnectionFactory conFactory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
            conn = (QueueConnection) conFactory.createQueueConnection();
            queue = (Queue) ctx.lookup("queue/MessageQueue");
            session = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            message = session.createTextMessage("Testing Queue!!!");
            message.setStringProperty("user", username);
            QueueSender sender = session.createSender(queue);

            // sending the message & the message will stay at the destination for a day
            sender.send(message, DeliveryMode.NON_PERSISTENT, 4, 86400000L);

            ctx.close();
            } catch (Exception e) {
            e.printStackTrace(System.err);
            } finally {
            try {
            if (session!= null)
            session.close();
            if (conn != null)
            conn.close();
            } catch(JMSException je){}
            }

            Here is my receive message code

            String username = "Vincent";
            QueueConnection conn = null;
            QueueSession session = null;
            TextMessage message = null;
            try
            {
            Context ctx =new InitialContext();
            QueueConnectionFactory conFactory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
            conn = (QueueConnection) conFactory.createQueueConnection();

            Queue queue = (Queue) ctx.lookup("queue/MessageQueue");
            session = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            QueueReceiver receiver = session.createReceiver(queue, "user = '" + username + "'");
            conn.start();

            Message myMes = receiver.receive();
            if(myMes != null)
            {
            if(myMes instanceof TextMessage)
            {
            message = (TextMessage)myMes;
            out.println(message.getText());
            }
            }
            } catch(JMSException je){}
            catch(NamingException ne){}
            finally
            {
            try {
            if (session!= null)
            session.close();
            if (conn != null)
            conn.close();
            } catch(JMSException je){}
            }

            & Here is my MDB code
            public class MessageMDB implements MessageDrivenBean, MessageListener {

            MessageDrivenContext ctx;

            public void onMessage(Message message) {
            TextMessage msg =null;

            try {
            if (message instanceof TextMessage) {
            msg =(TextMessage)message;
            System.out.println("MESSAGE BEAN:Message "+"received:"+msg.getText());
            } else {
            System.out.println("Message of wrong type:"+ message.getClass().getName());
            }
            }catch (JMSException e) {
            System.err.println("MessageBean.onMessage:"+"JMSException:"+e.toString());
            }catch (Throwable te) {
            System.err.println("MessageBean.onMessage:"+"Exception:"+te.toString());
            }
            }

            public void ejbCreate() {
            }

            public void ejbRemove() {
            }

            public void setMessageDrivenContext(MessageDrivenContext ctx) {
            this.ctx = ctx;
            // this.onMessage(msg);
            }

            }


            in my ejb-jar.xml
            <message-driven>
            <display-name>MsgMDB</display-name>
            <ejb-name>MsgMDB</ejb-name>
            <ejb-class>fyp.gateway.mdb.MessageMDB</ejb-class>
            <transaction-type>Bean</transaction-type>
            <acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
            <message-driven-destination>
            <destination-type>javax.jms.Queue</destination-type>
            </message-driven-destination>
            </message-driven>

            my jboss.xml
            <message-driven>
            <ejb-name>MsgMDB</ejb-name>
            <destination-jndi-name>queue/MessageQueue</destination-jndi-name>
            </message-driven>

            If I delete the .ear file which include MDB, JBoss work fine without any ERROR out.println. I think the jbossmq-destinations-service.xml hasn't any problem.

            If I add that .ear file, "javax.jms.JMSException: Error creating the dlq connection: XAConnectionFactory not bound" appear

            Do you know my MDB has error or my JBoss has error?

            Thanks a lot!

            • 3. Re: DLQ Problem
              vincentchun Newbie

              I have solve my problem.

              As I use MySQL as a database server for my CMP, I need to change some setting in order to use MDB.

              Thanks for your help again!

              • 4. Re: DLQ Problem
                federicon Newbie

                Dear vincentchum:
                Can you tell me, how you resolve your problem, because i have the same problem at this moment, i think that the problem is in the jms-ds configuration or something in XAConnectionFactory.

                at first , thank for your help.

                Fede



                • 5. Re: DLQ Problem
                  Filippo Newbie

                  For me (jboss 3.2) worked changing the attribute "ConnectionManager" from "jboss.jca:service=LocalTxCM,name=DefaultsDS" to the value "jboss.jca:service=LocalTxCM,name=...DS" where ...DS is the jndi-name you gave to your ds in (e.g.) mysql-ds.xml.
                  Ok? bye

                  • 6. Re: DLQ Problem
                    Filippo Newbie

                    Sorry, I forgot to tell you the file
                    mysql-jdbc2-service.xml
                    and the MBean


                    Bye