Why not using tomee.xml?
Ps: we still dont know if you class getting the injection is managed (is it
a cdi bean or an ejb?)
Le 2 sept. 2015 13:03, "msdocware" <ms@docware.de> a écrit :
> This is the current situation
> -----------------------------
>
> Code
>
> InitialContext ctx = new javax.naming.InitialContext();
> factory = (ConnectionFactory) ctx.lookup("java:comp/env/jms/MyCF");
>
>
> web.xml
>
> <resource-ref>
> <description>Resource reference to JMS Factory</description>
> <res-ref-name>jms/MyCF</res-ref-name>
> <res-type>javax.jms.ConnectionFactory</res-type>
> <res-auth>Container</res-auth>
> <res-sharing-scope>Shareable</res-sharing-scope>
> </resource-ref>
>
>
> Tomcat context.xml
>
> <Resource name="jms/MyCF" auth="Container"
> type="org.apache.activemq.ActiveMQConnectionFactory" description="JMS
> Connection Factory"
> factory="org.apache.activemq.jndi.JNDIReferenceFactory"
> brokerURL="tcp://localhost:61616" brokerName="RemoteActiveMQBroker"/>
>
>
> This is what I am trying
> ------------------------
>
> Code
>
> @Resource(name = "jms/MyCF")
> private ConnectionFactory factory;
>
> web.xml: no JMS related entries
>
> Tomcat context.xml: see above
>
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Using-JMS-with-Resource-annotation-tp4676042p4676056.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>
|