You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by mark-s <ms...@gmail.com> on 2013/11/20 22:21:44 UTC

Re: JMS Queues auto-linking to beans that don't need them

I am seeing similar logging as above, but not openejb/Resource:

Nov 20, 2013 8:55:38 PM org.apache.openejb.config.AutoConfig
processResourceRef
INFO: Auto-linking resource-ref
'java:comp/env/uk.co.mns.mdb.MessagePoster/connectionFactory' in bean
TestSingleton to Resource(id=MyJmsConnectionFactory)
Nov 20, 2013 8:55:38 PM org.apache.openejb.config.AutoConfig
processResourceEnvRef
INFO: Auto-linking resource-env-ref
'java:comp/env/uk.co.mns.mdb.MessagePoster/fooQueue' in bean TestSingleton
to Resource(id=FooQueue)
Nov 20, 2013 8:55:38 PM org.apache.openejb.config.AutoConfig
processResourceEnvRef
INFO: Auto-linking resource-env-ref
'java:comp/env/uk.co.mns.mdb.MessagePoster/barQueue' in bean TestSingleton
to Resource(id=BarQueue)

tomee.xml defines the resources

<Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
	BrokerXmlConfig = broker:(tcp://localhost:61616)
	ServerUrl = tcp://localhost:61616
</Resource>

<Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory">
	ResourceAdapter = MyJmsResourceAdapter
</Resource>

<Container id="MyJmsMdbContainer" ctype="MESSAGE">
	ResourceAdapter = MyJmsResourceAdapter
</Container>

<Resource id="FooQueue" type="javax.jms.Queue" />
<Resource id="BarQueue" type="javax.jms.Queue" />

And referenced by @Resource in a @Singleton that sends messages to the 2
queues:

@Resource
private ConnectionFactory connectionFactory;

@Resource(mappedName = "FooQueue")
private Queue fooQueue;

@Resource(mappedName = "BarQueue")
private Queue barQueue;

2 Message driven beans annotated as:
@MessageDriven(activationConfig = {
        @ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Queue"),
        @ActivationConfigProperty(propertyName = "destination",
propertyValue = "FooQueue"),
        @ActivationConfigProperty(propertyName = "acknowledgeMode",
propertyValue = "Auto-acknowledge") })
public class FooMessageListener implements MessageListener {

(Other listener only differs by name and destination)

Where/what should be changed to stop this excess auto-linking (this is on
Tomee 1.5.2+)?

Not sure if I am being over verbose defining the queues in tomee.xml as well
as through the @Resource annotation



--
View this message in context: http://openejb.979440.n4.nabble.com/JMS-Queues-auto-linking-to-beans-that-don-t-need-them-tp4665483p4666299.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: JMS Queues auto-linking to beans that don't need them

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Well using lookup or some other options you can avoid it but this is not an
issue at all. It auto links correctly cause your conf is ok
Le 20 nov. 2013 22:32, "mark silcox" <ms...@gmail.com> a écrit :

> Yes, same output.
>
>
> On 20 November 2013 21:27, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
> > Did you try name instead of mappedName. MappedName is not portable
> > Le 20 nov. 2013 22:22, "mark-s" <ms...@gmail.com> a écrit :
> >
> > > I am seeing similar logging as above, but not openejb/Resource:
> > >
> > > Nov 20, 2013 8:55:38 PM org.apache.openejb.config.AutoConfig
> > > processResourceRef
> > > INFO: Auto-linking resource-ref
> > > 'java:comp/env/uk.co.mns.mdb.MessagePoster/connectionFactory' in bean
> > > TestSingleton to Resource(id=MyJmsConnectionFactory)
> > > Nov 20, 2013 8:55:38 PM org.apache.openejb.config.AutoConfig
> > > processResourceEnvRef
> > > INFO: Auto-linking resource-env-ref
> > > 'java:comp/env/uk.co.mns.mdb.MessagePoster/fooQueue' in bean
> > TestSingleton
> > > to Resource(id=FooQueue)
> > > Nov 20, 2013 8:55:38 PM org.apache.openejb.config.AutoConfig
> > > processResourceEnvRef
> > > INFO: Auto-linking resource-env-ref
> > > 'java:comp/env/uk.co.mns.mdb.MessagePoster/barQueue' in bean
> > TestSingleton
> > > to Resource(id=BarQueue)
> > >
> > > tomee.xml defines the resources
> > >
> > > <Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
> > >         BrokerXmlConfig = broker:(tcp://localhost:61616)
> > >         ServerUrl = tcp://localhost:61616
> > > </Resource>
> > >
> > > <Resource id="MyJmsConnectionFactory"
> type="javax.jms.ConnectionFactory">
> > >         ResourceAdapter = MyJmsResourceAdapter
> > > </Resource>
> > >
> > > <Container id="MyJmsMdbContainer" ctype="MESSAGE">
> > >         ResourceAdapter = MyJmsResourceAdapter
> > > </Container>
> > >
> > > <Resource id="FooQueue" type="javax.jms.Queue" />
> > > <Resource id="BarQueue" type="javax.jms.Queue" />
> > >
> > > And referenced by @Resource in a @Singleton that sends messages to the
> 2
> > > queues:
> > >
> > > @Resource
> > > private ConnectionFactory connectionFactory;
> > >
> > > @Resource(mappedName = "FooQueue")
> > > private Queue fooQueue;
> > >
> > > @Resource(mappedName = "BarQueue")
> > > private Queue barQueue;
> > >
> > > 2 Message driven beans annotated as:
> > > @MessageDriven(activationConfig = {
> > >         @ActivationConfigProperty(propertyName = "destinationType",
> > > propertyValue = "javax.jms.Queue"),
> > >         @ActivationConfigProperty(propertyName = "destination",
> > > propertyValue = "FooQueue"),
> > >         @ActivationConfigProperty(propertyName = "acknowledgeMode",
> > > propertyValue = "Auto-acknowledge") })
> > > public class FooMessageListener implements MessageListener {
> > >
> > > (Other listener only differs by name and destination)
> > >
> > > Where/what should be changed to stop this excess auto-linking (this is
> on
> > > Tomee 1.5.2+)?
> > >
> > > Not sure if I am being over verbose defining the queues in tomee.xml as
> > > well
> > > as through the @Resource annotation
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://openejb.979440.n4.nabble.com/JMS-Queues-auto-linking-to-beans-that-don-t-need-them-tp4665483p4666299.html
> > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > >
> >
>

Re: JMS Queues auto-linking to beans that don't need them

Posted by mark silcox <ms...@gmail.com>.
Yes, same output.


On 20 November 2013 21:27, Romain Manni-Bucau <rm...@gmail.com> wrote:

> Did you try name instead of mappedName. MappedName is not portable
> Le 20 nov. 2013 22:22, "mark-s" <ms...@gmail.com> a écrit :
>
> > I am seeing similar logging as above, but not openejb/Resource:
> >
> > Nov 20, 2013 8:55:38 PM org.apache.openejb.config.AutoConfig
> > processResourceRef
> > INFO: Auto-linking resource-ref
> > 'java:comp/env/uk.co.mns.mdb.MessagePoster/connectionFactory' in bean
> > TestSingleton to Resource(id=MyJmsConnectionFactory)
> > Nov 20, 2013 8:55:38 PM org.apache.openejb.config.AutoConfig
> > processResourceEnvRef
> > INFO: Auto-linking resource-env-ref
> > 'java:comp/env/uk.co.mns.mdb.MessagePoster/fooQueue' in bean
> TestSingleton
> > to Resource(id=FooQueue)
> > Nov 20, 2013 8:55:38 PM org.apache.openejb.config.AutoConfig
> > processResourceEnvRef
> > INFO: Auto-linking resource-env-ref
> > 'java:comp/env/uk.co.mns.mdb.MessagePoster/barQueue' in bean
> TestSingleton
> > to Resource(id=BarQueue)
> >
> > tomee.xml defines the resources
> >
> > <Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
> >         BrokerXmlConfig = broker:(tcp://localhost:61616)
> >         ServerUrl = tcp://localhost:61616
> > </Resource>
> >
> > <Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory">
> >         ResourceAdapter = MyJmsResourceAdapter
> > </Resource>
> >
> > <Container id="MyJmsMdbContainer" ctype="MESSAGE">
> >         ResourceAdapter = MyJmsResourceAdapter
> > </Container>
> >
> > <Resource id="FooQueue" type="javax.jms.Queue" />
> > <Resource id="BarQueue" type="javax.jms.Queue" />
> >
> > And referenced by @Resource in a @Singleton that sends messages to the 2
> > queues:
> >
> > @Resource
> > private ConnectionFactory connectionFactory;
> >
> > @Resource(mappedName = "FooQueue")
> > private Queue fooQueue;
> >
> > @Resource(mappedName = "BarQueue")
> > private Queue barQueue;
> >
> > 2 Message driven beans annotated as:
> > @MessageDriven(activationConfig = {
> >         @ActivationConfigProperty(propertyName = "destinationType",
> > propertyValue = "javax.jms.Queue"),
> >         @ActivationConfigProperty(propertyName = "destination",
> > propertyValue = "FooQueue"),
> >         @ActivationConfigProperty(propertyName = "acknowledgeMode",
> > propertyValue = "Auto-acknowledge") })
> > public class FooMessageListener implements MessageListener {
> >
> > (Other listener only differs by name and destination)
> >
> > Where/what should be changed to stop this excess auto-linking (this is on
> > Tomee 1.5.2+)?
> >
> > Not sure if I am being over verbose defining the queues in tomee.xml as
> > well
> > as through the @Resource annotation
> >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/JMS-Queues-auto-linking-to-beans-that-don-t-need-them-tp4665483p4666299.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>

Re: JMS Queues auto-linking to beans that don't need them

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Did you try name instead of mappedName. MappedName is not portable
Le 20 nov. 2013 22:22, "mark-s" <ms...@gmail.com> a écrit :

> I am seeing similar logging as above, but not openejb/Resource:
>
> Nov 20, 2013 8:55:38 PM org.apache.openejb.config.AutoConfig
> processResourceRef
> INFO: Auto-linking resource-ref
> 'java:comp/env/uk.co.mns.mdb.MessagePoster/connectionFactory' in bean
> TestSingleton to Resource(id=MyJmsConnectionFactory)
> Nov 20, 2013 8:55:38 PM org.apache.openejb.config.AutoConfig
> processResourceEnvRef
> INFO: Auto-linking resource-env-ref
> 'java:comp/env/uk.co.mns.mdb.MessagePoster/fooQueue' in bean TestSingleton
> to Resource(id=FooQueue)
> Nov 20, 2013 8:55:38 PM org.apache.openejb.config.AutoConfig
> processResourceEnvRef
> INFO: Auto-linking resource-env-ref
> 'java:comp/env/uk.co.mns.mdb.MessagePoster/barQueue' in bean TestSingleton
> to Resource(id=BarQueue)
>
> tomee.xml defines the resources
>
> <Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
>         BrokerXmlConfig = broker:(tcp://localhost:61616)
>         ServerUrl = tcp://localhost:61616
> </Resource>
>
> <Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory">
>         ResourceAdapter = MyJmsResourceAdapter
> </Resource>
>
> <Container id="MyJmsMdbContainer" ctype="MESSAGE">
>         ResourceAdapter = MyJmsResourceAdapter
> </Container>
>
> <Resource id="FooQueue" type="javax.jms.Queue" />
> <Resource id="BarQueue" type="javax.jms.Queue" />
>
> And referenced by @Resource in a @Singleton that sends messages to the 2
> queues:
>
> @Resource
> private ConnectionFactory connectionFactory;
>
> @Resource(mappedName = "FooQueue")
> private Queue fooQueue;
>
> @Resource(mappedName = "BarQueue")
> private Queue barQueue;
>
> 2 Message driven beans annotated as:
> @MessageDriven(activationConfig = {
>         @ActivationConfigProperty(propertyName = "destinationType",
> propertyValue = "javax.jms.Queue"),
>         @ActivationConfigProperty(propertyName = "destination",
> propertyValue = "FooQueue"),
>         @ActivationConfigProperty(propertyName = "acknowledgeMode",
> propertyValue = "Auto-acknowledge") })
> public class FooMessageListener implements MessageListener {
>
> (Other listener only differs by name and destination)
>
> Where/what should be changed to stop this excess auto-linking (this is on
> Tomee 1.5.2+)?
>
> Not sure if I am being over verbose defining the queues in tomee.xml as
> well
> as through the @Resource annotation
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/JMS-Queues-auto-linking-to-beans-that-don-t-need-them-tp4665483p4666299.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>