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