users@glassfish.java.net

Re: Component dependencies in standart .xml and via annotation

From: Sahoo <Sahoo_at_Sun.COM>
Date: Fri, 18 May 2007 12:52:10 +0530

Use *message-destination-ref* instead of resource-ref to declare JMS
dependencies in ejb-jar.xml.

Thanks,
Sahoo

glassfish_at_javadesktop.org wrote:
> Hi!
> I have the following simple ejb-jar, which has depend on JMS topic:
> @Remote
> public interface SLSB0517A
> {
> public String get1();
> }
> @Stateless
> public class SLSB0517AImpl implements SLSB0517A
> {
> @Resource (name="topic1")
> Topic t;
> public String get1()
> {
> return (t==null?"null":t.toString());
> }
> }
> ---------------------------------
> sun-ejb-jar.xml:
> <sun-ejb-jar>
> <enterprise-beans>
> <ejb>
> <ejb-name>SLSB0517AImpl</ejb-name>
> <resource-ref>
> <res-ref-name>topic1</res-ref-name>
> <jndi-name>jms/Topic</jndi-name>
> </resource-ref>
> </ejb>
> </enterprise-beans>
> </sun-ejb-jar>
> ---------------------------------------
> This ejb module doesn't deploy, with message:
> Error loading deployment descriptors for module [ejb0517A] -- This bean [SLSB0517AImpl] has no resource reference by the name of [topic1]
>
> If I declare dependency through standart descriptor, it's deployed successfully:
> ---------------------------------
> ejb-jar.xml:
> <enterprise-beans>
> <session>
> <ejb-name>SLSB0517AImpl</ejb-name>
> <resource-ref>
> <res-ref-name>topic1</res-ref-name>
> <injection-target>
> <injection-target-class>test.SLSB0517AImpl</injection-target-class>
> <injection-target-name>t</injection-target-name>
> </injection-target>
> </resource-ref>
> </session>
> </enterprise-beans>
> ---------------------------------
> Can you give any suggestions? Thanks.
>
> GF2, b46
> WinXP
> [Message sent by forum member 'sinus' (sinus)]
>
> http://forums.java.net/jive/thread.jspa?messageID=217778
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>