users@glassfish.java.net

Re: MDB + interceptor results in com.sun.enterprise.InjectionException

From: <glassfish_at_javadesktop.org>
Date: Fri, 22 Feb 2008 08:26:04 PST

Hi,

Since you configure the interceptor to be the default interceptor for the whole ejb-jar, it needs to be coded in a generic fasion, not specific to session bean. So I think this error is expected behavior.

You can use @Resource private EJBContext ejbContext; field injection, or just simply look it up lazily using

initialContext.lookup("java:comp/EJBContext");

If necessary, downcast it to SessionContext or MessageDrivenContext.

-cheng
[Message sent by forum member 'cf126330' (cf126330)]

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