5 Replies Latest reply on Mar 24, 2004 12:04 PM by amlgroup

    MDB is not receiving messages

    amlgroup Newbie

      I have purchased the JBoss docs and am able to deploy my MDB, and I am also able to create a Queue, look it up and send a JMS message to it -- however, the MDB is not receiving the message because the onMessage() method is never executing. Here are my code snippets, can anyone see a problem?

      from ejb-jar.xml:




      from jboss.xml:

      <configuration-name>Standard Message Driven Bean</configuration-name>

      from jbossmq-state.xml:

      < StateManager>
      < Queue>
      < Name>seriesTrigger< /Name>
      < /Queue>
      < /StateManager>

      from client code: (this is all "working")
      // this first line performs the jndi lookup
      QueueConnectionFactory queConn = serviceLocator.getQueueConnectionFactory("ConnectionFactory");
      QueueConnection con = queConn.createQueueConnection();
      QueueSession sess = con.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
      QueueSender sender = sess.createSender(queue);
      ObjectMessage message = sess.createObjectMessage(event);

      i can post my MDB code if needed but it is very simple and standard

      please point out anything you see may be wrong or out of place! thanks in advance.

        • 1. Re: MDB is not receiving messages
          Elias Ross Master

          I can't see what you did wrong, but I assume it's some sort of configuration detail. Please also remember to validate (using "xmllint --valid" on UNIX) your .xml files against the JBoss DTD, as JBoss doesn't do XML validation.

          You should familiarize yourself with the JMX console. It can be very helpful in figuring out problems.

          Here are some basic checks:


          1. Check that the queue you're sending to exists and messages are being posted. The depth should be non-zero. (This should be true *until* you deploy your MDB)
          2. Once things get going, the message counter should show some activity


          1. Check your MDB is listed
          2. Check for your .ear files

          Also, take note of any warnings you see. There's a lot of log spew, but pay attention.

          • 2. Re: MDB is not receiving messages
            amlgroup Newbie

            i appreciate the response. i've gotten a little bit further. the situation now is this:

            - if i write a standalone client from the command line that sends a message to the message queue, the MDB is triggered and everything works as expected.

            - my application sends a message to the queue from within a Stateless Session Bean - the exact same code - however this time the MDB is not triggered.

            has anyone else experienced this or have suggestions on how to debug?

            • 3. Re: MDB is not receiving messages
              sahumx Newbie

              Create JmsXAQ
              <adapter-display-name>JMS Adapter</adapter-display-name>
              <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Queue</config-property>
              and use
              I am having message sending twice...but it is being send and recieved successfully....I had lot of trouble finding this out...

              • 4. Re: MDB is not receiving messages
                dannyyates Newbie

                amlgroup - this sounds like it might be a transaction issue. Is your Session Bean running in a transaction? Are you commiting the JMS transaction (which is different from the CMT managed tx) after your send?

                • 5. Re: MDB is not receiving messages
                  amlgroup Newbie

                  thanks, the problem lay with the transaction

                  adding the line


                  has fixed the problem...