This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to form a MDB with the topic?

 
Qian Yang
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used JBoss 3.0 and JBoss JMS 3.04 for MDB. If MDB listen to a queue, it worked fine. But I have the problem when I formed it as a topic.
The following is my Deployment descriptor modified from a queue:
1. ejb-jar.xml:
<ejb-jar>
<enterprise-beans>
<message-driven>
<ejb-name>WorkAgentMessage</ejb-name>
<ejb-class>com.eidea.ejb.component.automation.WorkAgentMessageBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-selector>executionState ='open.ready_to_run'</message-selector>
<acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
<message-driven-destination>
<destination-type>javax.jms.Topic</destination-type>
<subscription-durability>Durable</subscription-durability>
</message-driven-destination>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>WorkAgentMessage</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
2. jboss.xml
<jboss>
<enterprise-beans>
<message-driven>
<ejb-name>WorkAgentMessage</ejb-name>
<configuration-name>Standard Message Driven Bean</configuration-name>
<destination-jndi-name>topic/DefaultChannel</destination-jndi-name>
<jndi-name>WorkAgentMessage</jndi-name>
</message-driven>
</enterprise-beans>
</jboss>
I got the following error in deployment
=============================
15:14:41,203 WARN [JMSContainerInvoker] JMS provider failure detected:
org.jboss.mq.SpyJMSException: Cannot subscribe to this Destination: null
at org.jboss.mq.Connection.addConsumer(Connection.java:974)
===============================
I checked JBoss console, the deployed topic DefaultChannel is there.
When I modified <destination-type> in ejb-jar.xml from javax.jms.Topic to Topic, the complain in deploy is gone, but onMessage() in MDB didn't get called in runtime.
I'd be very appreciated if anyone can help me to solve this issue.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic