4 Replies Latest reply on Aug 19, 2003 1:08 AM by sanjewad

    MDB not getting message

    Rajarshi Newbie

      Hi all,
      I am experiencing a strange problem with jboss-3.2.1_tomcat-4.1.24. I have created an ear with a single MessageDrivenBean. The ejb-jar and jboss.xml files are attached.
      The jboss console shows 12:42:02,721 INFO [EARDeployer] Init J2EE application: file:/D:/Sona/jboss-3.2.
      1_tomcat-4.1.24/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/ejb1.ear
      12:42:04,304 INFO [EARDeployer] Started J2EE application: file:/D:/Sona/jboss-3
      .2.1_tomcat-4.1.24/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/ejb1.ear
      12:42:04,304 INFO [MainDeployer] Deployed package: file:/D:/Sona/jboss-3.2.1_to
      mcat-4.1.24/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/ejb1.ear

      when I deployed the ear.
      But when I sent message to testQueue from a standalone client the messages are not received by the MDB.
      Please let me know what should I do?

        • 1. Re: MDB not getting message
          Jim Harrison Newbie

          Hi,

          I don't think you really want to be sending your message to testQueue.
          When you deploy your MDB a new queue should be created automatically, the queue name being the same as your message driven bean.

          If in doubt, you can always check the jboss.mq.destination entries via the JBoss console (http://yourhost:8080/jmx-console/index.jsp)

          Hope this helps,
          Jim

          • 2. Re: MDB not getting message
            vshah Newbie

            Your DOCTYPE tag in ejb-jar.xml file doesn't seem to be syntactically right. Just try replacing that with the following...

            <!DOCTYPE ejb-jar PUBLIC
            "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
            "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

            • 3. Re: MDB not getting message
              Archimedes Trajano Newbie

              This is a code snippet which I use to send data to the queue. Hopefully this will help you out.

              javax.naming.InitialContext initialContext =
              new javax.naming.InitialContext();
              QueueConnectionFactory qcf;
              QueueConnection connection = null;
              try {
              qcf =
              (QueueConnectionFactory) initialContext.lookup(
              "ConnectionFactory");
              Queue queue = (Queue) initialContext.lookup("queue/testQueue");
              connection = qcf.createQueueConnection();
              QueueSession session =
              connection.createQueueSession(
              false,
              Session.AUTO_ACKNOWLEDGE);
              QueueSender sender = session.createSender(queue);
              sender.send(session.createTextMessage("FOO!!!!"));
              }
              finally {
              connection.close();
              initialContext.close();
              }

              • 4. Re: MDB not getting message
                sanjewad Newbie

                Hi
                I am having the same problem with Jboss 3.2.1 did you find a solution to this.
                Can you reply me if you found a solution. I think I have posted the same question as you.