-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Injection in EJB interceptors is not working #3
Comments
Thanks for creating the issue. We will take care of it in the next release (0.2). |
At the moment I´am fixing the NPE 🐛 in https://github.com/qabbasi/BeanTest/tree/Issue%233 😉 |
Tried the following: public void processAfterBeanDiscovery(@observes AfterTypeDiscovery afterTypeDiscovery, BeanManager beanManager) { But AfterTypeDiscovery#getInterceptors returns an empty Interceptor list. Ref: http://docs.oracle.com/javaee/7/api/javax/enterprise/inject/spi/AfterTypeDiscovery.html |
Alternative approach: retrieve via the @interceptors(Class[]) annotation all old fashioned Interceptor definitions altogether with injection points such as the @PersistenceContext. Old fashioned interceptorbinding@interceptors(MyInterceptor.class) Sample interceptor (without @InterceptorBinding)public class MyInterceptor {
} |
PersistenceContext is not injected in EJB interceptors, and throws NullPointerException when I try to access the EntityManager.
This issue forces me to rewrite all the interceptors.
The text was updated successfully, but these errors were encountered: