Tõnis Pool created TOMEE-1901: --------------------------------- Summary: @Inject not working for EJB module Key: TOMEE-1901 URL: https://issues.apache.org/jira/browse/TOMEE-1901 Project: TomEE Issue Type: Bug Affects Versions: 7.0.1 Reporter: Tõnis Pool
Seems like CDI is not activated for an EJB module with only @Stateless EJBs. The console also has the warning: {noformat} The application [ejb-1.0-SNAPSHOT] uses @Inject but CDI is not enabled. Maybe youd need to add a beans.xml file. {noformat} However the CDI 1.1 spec states that ([section 12.1 Bean archives |http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#bean_archive]): bq. An implicit bean archive is any other archive which contains one or more bean classes with a bean defining annotation, or one or more session beans. I've created a simple maven project that reproduces the problem. It has one EJB module and one web module. The web module uses @EJB to get an Stateless local interface view bean from the EJB module, which in turn tries to @Inject another bean from the same EJB module, but fails. Steps: * Download the [tomee-e...@inject-bug.zip|https://drive.google.com/file/d/0B6RrEwQ40kwdRFh6aHNNRHNwMDg/view?usp=sharing] * extract and run {{mvn package}} * Deploy the {{ear/target/ear-1.0-SNAPSHOT.ear}} file to TomEE 7.0.1 * Access {{SEVER_URL/ear-1.0-SNAPSHOT/}} outputs "some null", while expected would be a non null value. -- This message was sent by Atlassian JIRA (v6.3.4#6332)