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

John Ament (JIRA) issues at jboss.org
Thu Feb 13 11:03:29 EST 2014


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

John Ament commented on CDI-377:
--------------------------------

As a user, I find this bug tough to swallow.  On one side, what I think the Java EE platform is saying is that if you run on an EE container, you're getting EE features.  In the case of what was added in EE7, this means you get various stuff automatically added to your app, including a servlet container, a default JMS connection factory, JAX-RS enabled, JSF enabled and CDI enabled.  The problem is that CDI enabling means enabling of JSR-330 annotation processing.  This means for apps using Spring, Guice that there's already a consumer of the JSR-330 annotations on the path and if they want to be used they need a way to coexist with the CDI processors.

The downside to this is that now you need to have certain libraries being EE aware, that when they run on an EE7 container they need to follow certain rules.  I'm not sure if this is the original intention of the EE expert group, it may be worthwhile to ask.
                
> 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