I am using RestEasy in a JBoss AS 7.1.1 environment.
For security reasons, I applied the PreProcessInterceptor class. The class is annotated with @Provider and @ServerInterceptor. Each time the interceptor is launched, and this is normal.
Now the following is bothering me.
I am inserting an EJB using the @EJB annotation into a class. When a PreProcessInterceptor is called, the EJB is always null .
@Provider @ServerInterceptor public class SecurityInterceptor implements PreProcessInterceptor { @EJB private SomeEjb someEjbServiceFacade; ... some funny stuff }
What EJB looks like:
@Stateless public class SomeEjb extends AbstractServiceFacade { ... some important stuff }
The funny part is, it works through a search:
Context ctx = new InitialContext(); SomeEjb asf = ( SomeEjb )ctx.lookup("java:global/mySuperApplication/SomeEjb" );
Does anyone have an explanation for this behavior?
Thanks in advance.
source share