2 Replies Latest reply on Sep 17, 2003 7:19 AM by marks

    correct entries in ejb-jar.xml and jboss.xml for a MDB

    marks Newbie

      I am deploying a test message driven bean on a JBoss 3.2.1 running on Red Hat 8.0 machine.

      The entries of my ejb-jar.xml look like below:


      and the jboss.xml entries look like below:

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

      and I do define a queue called TestMyQueue in the jbossmq-destinations-service.xml file as below:

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

      Am I missing any entries?

      The problem in my case is that the TestMyBean does not get the JMS messages sent by the client ( a servlet running on Tomcat on a different machine ).

      Some articles online talk about a <resource-ref> tag to be used with the ejb-jar.xml file. Is there any pointer to a EJB doc/spec that governs the use of these tags? I looked in the EJB spec and did not find anything there.


        • 1. Re: correct entries in ejb-jar.xml and jboss.xml for a MDB
          Stephane Nicoll Master

          Why do you put bean managed transaction in your MDB?
          You don't need to set the configuration name in jboss.xml if you want to use the default one. The queue definition seems ok.

          1/ Is your servlet is able to send message to this queue.?

          2/ Check with the JMX console that TestMyQueue exists and that there are messages in there (http://jbosshost:8080/jmx-console see the jboss.mq.destinations domain)

          3/ When deploying your ejb-jar is it ok? Can you see the TestMyBean in the jmx console?

          4/ What is the code of your bean? (onMessage)



          • 2. Re: correct entries in ejb-jar.xml and jboss.xml for a MDB
            marks Newbie

            Thanks for the suggestions. I managed to get rid of all problems ( and I must saymost of them were mainly self created ).

            1) The directory structure of the bean was all wrong. The O'Reilly EJB book ( 2nd Ed covering EJB 1.1 ) had me layout the directory structure as below:


            which is wrong...moving the META-INF to be at the same level as com made things OK.

            I also added this line to the ejb-jar.xml in the <message-driven> part


            Is the above required? The deployment process would complain for the above line, so I put it in.

            and a whole section on <assembly-descriptor> ( I thought this was optional, but I put in nevertheless ):




            The above changes made the bean get really deployed. Now it can get messages. Using the JMX console, I can see what is going on. I guess I shld get rid of the bean managed transaction part ( I think I saw it in the Jboss 2.4 docs at soruceforge ).