ejb-name is acting as jndi name ... driving me insane
ensonik Jun 9, 2004 9:58 PMThis is really not complicated and I've followed all the instructions, yet this just won't work for me. Trying to get a simple mdb to work:
MDB:
* @ejb.bean * name = "TestMessageBean" * display-name = "TestQueue" * description = "TestMessageBean EJB" * jndi-name = "jms/TestMessageBean" * acknowledge-mode = "Auto-acknowledge" * transaction-type = "Bean" * destination-type = "javax.jms.Queue" * * @jboss.destination-jndi-name name="queue/MyTestQueue" */ public class TestMessageBean implements MessageDrivenBean, MessageListener { ..... }
ejb-jar.xml
<message-driven > <ejb-name>TestMessageBean</ejb-name> <ejb-class>com.mikem.jms.TestMessageBean</ejb-class> <transaction-type>Bean</transaction-type> <message-selector></message-selector> <acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode> <message-driven-destination> <destination-type>javax.jms.Queue</destination-type> </message-driven-destination> </message-driven>
jboss.xml
<message-driven> <ejb-name>TestMessageBean</ejb-name> <destination-jndi-name>queue/MyTestQueue</destination-jndi-name> <configuration-name>Standard Message Driven Bean</configuration-name> </message-driven>
When I start my server I keep getting the same error:
21:43:14,067 WARN [JMSContainerInvoker] destination not found: queue/TestMessageBean reason: javax.naming.NameNotFoundException: TestMessageBean not bound
21:43:14,067 WARN [JMSContainerInvoker] creating a new temporary destination: queue/TestMessageBean
21:43:14,077 INFO [TestMessageBean] Creating
21:43:14,077 INFO [TestMessageBean] Created
21:43:14,077 INFO [TestMessageBean] Starting
21:43:14,077 INFO [TestMessageBean] Bound to JNDI name: queue/TestMessageBean
21:43:14,077 INFO [TestMessageBean] Started
My queue/MyTestQueue gets started up properly:
21:43:10,808 INFO [MyTestQueue] Starting
21:43:10,818 INFO [MyTestQueue] Bound to JNDI name: queue/MyTestQueue
21:43:10,818 INFO [MyTestQueue] Started
And I can write to the queue/MyTestQueue properly.
Here's the kicker. My MDB is listening on a queue called queue/TestMessageBean. Where is that getting that from? From the ejb-name attribute in the ejb-jar.xml file. If i change that attribute to MikesBean, when the server starts up I'll get the same error, but this time it will say MikesBean not bound. The only way I can get the MDB to be bound to the proper queue is by chaging the ejb-jar.xml file to look like:
<message-driven > <ejb-name>MyTestQueue</ejb-name> <ejb-class>com.mikem.jms.TestMessageBean</ejb-class> <transaction-type>Bean</transaction-type> <message-selector></message-selector> <acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode> <message-driven-destination> <destination-type>javax.jms.Queue</destination-type> </message-driven-destination> </message-driven>
Is this normal behaviour?