geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: App Client with JMS support does not start
Date Mon, 08 Jun 2009 22:19:26 GMT

On Jun 8, 2009, at 2:37 PM, asfmarek wrote:

>
> Finally I managed to start the application. Thank you!
>
> I attach the plan for console.jms/jms:
> http://www.nabble.com/file/p23932650/activemq-plan.xml activemq- 
> plan.xml
>
> I needed to comment out activemq-broker and to add backport-util- 
> concurrent
> dependency.
>
> Anyway this is only part of the success:
>
> I am able to inject ConnectionFactory by @Resource(name =
> "jms/ConnectionFactory").
> But, Queue and Topic are not injected (they are null):
>   @Resource(name = "jms/Queue") private static Queue queue;
>   @Resource(name = "jms/Topic") private static Topic topic;
>
> In geronimo-application-client.xml i declared resource-link for all  
> three:
> ConnectionFactory, Queue and Topic but only the ConnectionFactory is
> injected:
>
>   <name:resource-ref>
>        <name:ref-name>jms/ConnectionFactory</name:ref-name>
>        <name:resource-link>ConnectionFactory</name:resource-link>
>    </name:resource-ref>
>    <name:resource-ref>
>        <name:ref-name>jms/Topic</name:ref-name>
>        <name:resource-link>Topic</name:resource-link>
>    </name:resource-ref>
>    <name:resource-ref>
>        <name:ref-name>jms/Queue</name:ref-name>
>        <name:resource-link>Queue</name:resource-link>
>    </name:resource-ref>
>
> http://www.nabble.com/file/p23932650/geronimo-application-client.xml
> geronimo-application-client.xml
>
> What am I doing wrong again?

I'm surprised geronimo didn't complain.

The destinations aren't resource-refs, they are resource-env-refs or  
message-destination-refs.  The fact that you can use @Resource  
annotations for both and many many other unrelated things besides  
whereas you have to use @Ejb or @EjbLocal annotations for ejb -- which  
are more similar to datasources than some of the other things you can  
use @Resource for -- is IMO kinda bizarre.

As you found out in your next message, if you use the message- 
destination-name in your @Resource annotation then you don't need  
anything in your app client plan to get the linking to work.

thanks
david jencks


>
>
> thank you
> Marek
> -- 
> View this message in context: http://www.nabble.com/App-Client-with-JMS-support-does-not-start-tp23906705s134p23932650.html
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>

Mime
View raw message