Search code examples
tomcatcdiopenejb

Tomcat OpenEJB and CDI


I am using OpenEJB 3.1 embedded in Tomcat6.33 for testing our EJBs. Now I am trying to use CDI in EJB. I have done the settings for using CDI in Tomcat so now I can use @Inject in my Servlet and everything works fine.

However when I try to use @Inject in my EJB it fails with Null Pointer (because the object was not injected). How can I used CDI in my embedded OpenEJB inside Tomcat?

Regards


Solution

  • A bit hard to tell from the information you provide. Did you deploy an beans.xml in the relevant projects? Try querying the beanmanager for what is around. Are your OpenEJB components recognized as ManagedBeans?