users@glassfish.java.net

Re: EJB Module & JMS

From: <glassfish_at_javadesktop.org>
Date: Mon, 29 Oct 2007 18:18:07 PST

<pre>
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" version="3.0">
    <enterprise-beans>
        <session>
            <ejb-name>xxx</ejb-name>
            <resource-ref>
        <description>description</description>
        <res-ref-name>jms/OutboundTopicConnectionFactory</res-ref-name>
        <res-type>javax.jms.QueueConnectionFactory</res-type>
        <mapped-name>jms/OutboundTopicConnectionFactory</mapped-name>
      </resource-ref>

       <message-destination-ref>
        <message-destination-ref-name>jms/OutboundTopic</message-destination-ref-name>
        <message-destination-type>javax.jms.Topic</message-destination-type>
        <message-destination-usage>Consumes</message-destination-usage>
        <mapped-name>jms/OutboundTopic</mapped-name>
      </message-destination-ref>

        </session>
    </enterprise-beans>
</ejb-jar>

</pre>

Since we used <mapped-name> for the 2 resources, so no need to use sun-ejb-jar.xml to map them to their global JNDI names.

The standard way to declare a jms destination ref is use message-destination-ref, instead of resource-env-ref. The latter would also work but has been kinda deprecated.

This is how to declare resource ref with descriptors, Still the simplest way is just use injection and you don't need any of these, if you do it properly.

-cheng
[Message sent by forum member 'cf126330' (cf126330)]

http://forums.java.net/jive/thread.jspa?messageID=242815