You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Romain Manni-Bucau (JIRA)" <ji...@apache.org> on 2016/08/12 13:41:22 UTC
[jira] [Resolved] (TOMEE-1901) @Inject not working for EJB module
[ https://issues.apache.org/jira/browse/TOMEE-1901?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Romain Manni-Bucau resolved TOMEE-1901.
---------------------------------------
Resolution: Fixed
Assignee: Romain Manni-Bucau
Fix Version/s: 7.0.2
> @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
> Assignee: Romain Manni-Bucau
> Fix For: 7.0.2
>
>
> 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-ejb-@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. GlassFish 4.1 and WildFly 10 output a non null value for the same application.
> Let me know if there are any more questions.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)