users@glassfish.java.net

Re: howto specify queue of MDB in sun-ejb-jar.xml ?

From: Dies Koper <dies_at_jp.fujitsu.com>
Date: Tue, 06 Nov 2007 10:11:58 +0900

Use the jndi-name tag:

      <ejb>
        <ejb-name>HubToFabReceiverMDBean</ejb-name>
        <jndi-name>YourQueue</jndi-name>
        <mdb-connection-factory>

message-destination-ref is used when you want to map the message
destination name that you want to look up or inject in your message
producer (the "client" of your MDB) to the actual destination in your
environment.

Regards,
Dies

glassfish_at_javadesktop.org wrote:
> Hi,
>
> How do I specify the queue used by a MDB in the sun-ejb-jar.xml rather than the @MessageDriven(mappedName = "jms/MyQueue") annotation ?
>
> I guessed that the message-destination-ref element is what I need, but the way I've configured it doesn't work.
>
>
> <?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>
> <ejb>
> <ejb-name>HubToFabReceiverMDBean</ejb-name>
> <mdb-connection-factory>
> <jndi-name>jms/FabSan01ToPtsFactory</jndi-name>
> </mdb-connection-factory>
> [b]<message-destination-ref>[/b]
> <message-destination-ref-name>jms/MappedName</message-destination-ref-name>
> <jndi-name>jms/MyQueue</jndi-name>
> [b] </message-destination-ref>[/b]
> </ejb>
> </enterprise-beans>
> </sun-ejb-jar>
>
>
> [b]I get these errors:[/b]
>
> This ejb [HubToFabReceiverMDBean] has no message destination reference by the name of [jms/MappedName]
> "DPL8007: Invalid Deployment Descriptors element jndi-name value jms/MyQueue"
>
>
> [b]This is my bean:[/b]
>
> @MessageDriven(mappedName = "jms/MappedName")
> public class HubToFabReceiverMDBean implements MessageDrivenBean, MessageListener
> {
> ...
>
> Thanks
>
> reply to: rupert123_at_spamex.com
> [Message sent by forum member 'frenchdrip' (frenchdrip)]
>
> http://forums.java.net/jive/thread.jspa?messageID=243964