-
1. Re: correct entries in ejb-jar.xml and jboss.xml for a MDB
stephanenicoll Sep 17, 2003 2:19 AM (in response to marks)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)
Regards,
Stephane -
2. Re: correct entries in ejb-jar.xml and jboss.xml for a MDB
marks Sep 17, 2003 7:19 AM (in response to marks)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:
com
----me
-------ejb
----------TestMyBean.java
----------META-INF
---------------ejb-jar.xml
---------------jboss.xml
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
<resource-env-ref>
<resource-env-ref-name>queue/TestMyQueue</resource-env-ref-name>
<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
</resource-env-ref>
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 ):
<assembly-descriptor>
<container-transaction>
<ejb-name>MessageBean</ejb-name>
<method-name>*</method-name>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
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 ).
thanks,
ms