[cdi-dev] [JBoss JIRA] (CDI-377) automatic JSR-330 annotation processing problematic

Antoine Sabot-Durand (JIRA) issues at jboss.org
Thu Feb 13 11:59:28 EST 2014

    [ https://issues.jboss.org/browse/CDI-377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12944367#comment-12944367 ] 

Antoine Sabot-Durand commented on CDI-377:

@Romain according to section 2.5 CDI scopes are bean defining annotations. Its not the case of @named, @inject, etc.. The only scope that is common to CDI and JSR 330 is {{@Singleton}}. This is the presence of this scope on Guice or Spring Beans that triggers CDI thanks to annotated discovery mode.
As CDI hardly supports {{@Singleton}}  (not a mention in the spec and warning to not use in RI doc) we could imagine to exclude it from the list of Bean defining annotations. That wouldn't mean we don't support it that would mean that class annotated with {{@Singleton}} won't transform the archive in implicit bean archive. It can still be taken as such by adding a {{@Dependent}} or {{@ApplicationScoped}} somewhere or making the archive explicit by putting a beans.xml in it.
We can explain in the spec that we excluded it to assure compatibility with other JSR 330 framework : making CDI friendly and not s***ing solution.

> automatic JSR-330 annotation processing problematic
> ---------------------------------------------------
>                 Key: CDI-377
>                 URL: https://issues.jboss.org/browse/CDI-377
>             Project: CDI Specification Issues
>          Issue Type: Bug
>          Components: Java EE integration
>    Affects Versions: 1.1.PFD
>         Environment: glassfish-4
>            Reporter: Reuben Pasquini
>              Labels: CDI_spec_chge, CDI_tck_chge
>             Fix For: 1.2 Proposed
> The jsr-330 dependency injection annotations (javax.inject.*) find use in javase environments using IOC packages like guice.
> Adding a dependency on a jar that uses guice or whatever in a javase environment
> to a war deployed to a jee7 container 
> results in CDI processing annotated classes intended for 
> app-managed injection.  See this ticket filed with guava for a concrete example:
>     https://code.google.com/p/guava-libraries/issues/detail?id=1433

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

More information about the cdi-dev mailing list