File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes How to form a MDB with the topic? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "How to form a MDB with the topic?" Watch "How to form a MDB with the topic?" New topic
Author

How to form a MDB with the topic?

Qian Yang
Greenhorn

Joined: Mar 12, 2003
Posts: 1
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to form a MDB with the topic?