Hi,
i got a stateless session bean:
@Stateless
@Interceptors (MyInterceptor.class)
public class MyBean {
@Persistence (name="sample")
EntityManager em;
public String doSomething() {
return (String)em.createNamedQuery("someQuery").getSingleResult();
}
}
and an interceptor class:
public class MyInterceptor {
@Persistence (name="sample")
EntityManger em;
@AroundInvoke
public Object doSomethingElse(InvocationContext ctx) {
return ctx.proceed();
}
}
If i invoke the method MyBean.doSomething() remotely, it throws a
NullPointerException. Debugging through the code shows that 'em' is null.
The interceptor doesn't even do something with its 'em' instance yet.
If i remove the @Persistence... from the interceptor, everything is
working fine.
Is this a bug in GF or is there a known limitation that persistence may
not be used in interceptor classes?
Best regards
T. Jungblut