[jboss-jira] [JBoss JIRA] (WFLY-2722) @EJB injection in interceptor class and in target class result in injection of instances of two different classes

Jozef Hartinger (JIRA) issues at jboss.org
Wed Jan 8 01:37:33 EST 2014


     [ https://issues.jboss.org/browse/WFLY-2722?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jozef Hartinger moved WELD-1576 to WFLY-2722:
---------------------------------------------

              Project: WildFly  (was: Weld)
                  Key: WFLY-2722  (was: WELD-1576)
    Affects Version/s: 8.0.0.CR1
                           (was: 2.1.1.Final)
          Component/s: CDI / Weld
                           (was: Interceptors and Decorators)
                           (was: WildFly integration)
             Security: Public

    
> @EJB injection in interceptor class and in target class result in injection of instances of two different classes
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: WFLY-2722
>                 URL: https://issues.jboss.org/browse/WFLY-2722
>             Project: WildFly
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: CDI / Weld
>    Affects Versions: 8.0.0.CR1
>            Reporter: Matus Abaffy
>            Assignee: Jozef Hartinger
>
> Interceptors spec, 2.2.1 - Interceptor Environment:
> bq. Interceptor class shares the enterprise naming context of its associated target class. (1)
> Assume the following scenario:
> Ear: test-ejb.jar, test1.war, test2.war
>   test-ejb.jar: Animal, BarBinding
>   test1.war: BarInterceptor, Dog
>   test2.war: Bar, Cat
> Short description of the classes:
> {code}
> @Stateful public class Dog implements Animal {...}
> {code}
> {code}
> @Stateful public class Cat implements Animal {...}
> {code}
> {code}
> @BarBinding @Stateless
> public class Bar {
>     @EJB
>     Animal animal;
> }
> {code}
> {code}
> @BarBinding @Priority(1000) @Interceptor
> public class BarInterceptor {
>     @EJB
>     Animal animal;
> }
> {code}
> Bar gets injected an instance of Cat, whereas BarInterceptor gets injected an instance of Dog, which IMHO contradicts (1).
> Test case at: https://github.com/cdi-spec/cdi-tck/pull/38
> (InterceptorEnvironmentJNDITest, InterceptorEnvironmentJNDISessionBeanTest)

--
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 jboss-jira mailing list