Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCEEJBD
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
Ron McLeod
paul wheaton
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Himai Minh
Bartenders:
Forum:
EJB Certification (OCEEJBD)
<lookup-name> of <message-destination> does not override mappedName in MDB
Himai Minh
Saloon Keeper
Posts: 2449
13
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Based on p.315 of Ivan's notes,
I have my dd like this:
<enterprise-bean> .... <message-driven> <ejb-name>ListenerMDB1</ejb-name> <ejb-class>com.ivan.listeners.FirstListenerEJB</ejb-class> <messaging-type>javax.jms.MessageListener</messaging-type> <transaction-type>Container</transaction-type> <message-destination-type>javax.jms.Topic</message-destination-type> <message-destination-link>ListenerMsgDest</message-destination-link> </message-driven> </enterprise-beans> <assembly-descriptor> <message-destination> <message-destination-name>ListenerMsgDest</message-destination-name> //This is my topic's JNDI name defined in my Glassfish <lookup-name>jms/PublishingTopic</lookup-name> </message-destination> </assembly-descriptor>
and
//This topic name is not overriden by the dd above: @MessageDriven (name ="ListenerMDB1", mappedName="jms/StockInfo", activationConfig = { @ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue="Auto-acknowledge"), @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Topic") }) public class FirstListenerEJB implements MessageListener{ ...}
The message cannot be delivered to the topic.
However, if I defined the right topic name in the @MessageDriven annotation, it works:
//This one works as my topic's JNDI name is jms/PublishingTopic @MessageDriven (name ="ListenerMDB1", mappedName="jms/PublishingTopic", activationConfig = { @ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue="Auto-acknowledge"), @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Topic") }) public class FirstListenerEJB implements MessageListener{
Himai Minh
Saloon Keeper
Posts: 2449
13
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I found a Glassfish 3.1 document at
https://docs.oracle.com/cd/E18930_01/html/821-2418/beama.html
In the sun-ejb-jar.xml,
I put this:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 EJB 3.0//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_0-0.dtd"> <sun-ejb-jar> <enterprise-beans> <unique-id>1</unique-id> <ejb> <ejb-name>ListenerMDB1</ejb-name> <jndi-name>jms/PublishingTopic</jndi-name> </ejb> <ejb> <ejb-name>ListenerMDB2</ejb-name> <jndi-name>jms/PublishingTopic</jndi-name> </ejb> </enterprise-beans> </sun-ejb-jar>
Now, the two MDB's can get the message from the topic called "jms/PublishingTopic".
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
MDB in EJB 3.0 and JBOSS AS 6.1 final
accessing local session bean from a message driven bean
Not able to deploy MDB. ERROR: JBAS014771: Services with missing/unavailable dependencies
JBoss and MDB (configuration question)
Who creates destination Queueor Topic
More...