users@glassfish.java.net

Re: Looking up JMS / Database resource in EJB 3.1 entity listener

From: <glassfish_at_javadesktop.org>
Date: Sat, 07 Aug 2010 13:03:06 PDT

You need to declare the resource ref with ejb-jar.xml or @Resource whose res-ref name is jms/fooTopic, in order to look up java:comp/env/jms/fooTopic within the EJB's component env.

Another option (less flexible, non-portable) is to directly look up by the physical jndi name:
context.lookup("jms/fooTopic");
[Message sent by forum member 'cf126330']

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