[jboss-jira] [JBoss JIRA] (WFLY-3774) CDI bean with StereoType is not injectable in implicit bean archive

Jozef Hartinger (JIRA) issues at jboss.org
Mon Sep 1 04:32:00 EDT 2014


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

Jozef Hartinger updated WFLY-3774:
----------------------------------
    Fix Version/s: 8.2.0.CR1


{quote}Sorry I wasn't clear on that point. CDI 1.2 clearly listed what is injectable, but it also applies to CDI 1.1. This behavior is nothing changed between versions, it just got clearer definistion.{quote}

You are wrong. @Stereotypes being recognized as bean defining annotations is a new feature of CDI 1.2 - see e.g. http://www.cdi-spec.org/news/2014/04/14/CDI-1_2-released/

More precisely, in CDI 1.1, only scope annotations are considered bean defining annotations:
http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#bean_defining_annotations

In CDI 1.2 this was extended to cover @Stereotypes and some other annotations:
http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#bean_defining_annotations

> CDI bean with StereoType is not injectable in implicit bean archive
> -------------------------------------------------------------------
>
>                 Key: WFLY-3774
>                 URL: https://issues.jboss.org/browse/WFLY-3774
>             Project: WildFly
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: CDI / Weld
>    Affects Versions: 8.1.0.Final
>            Reporter: Takayoshi Kimura
>            Assignee: Jozef Hartinger
>             Fix For: 8.2.0.CR1, 9.0.0.Beta1
>
>         Attachments: logs.zip, stereotype.zip
>
>
> CDI 1.2 defines bean defining annotations and with beans with these annotations should be injectable. However a bean with StereoType, one of bean defining annotations, is not injectable within implicit bean archive on WildFly.
> Attached a simple war project to reproduce this problem. This works on GlassFish 4 but doesn't work on WildFly 8.1.0 nor WildFly 9 master at this time. Making this an explicit bean archive by adding empty beans.xml (or set bean-discovery-mode=all) fixes the problem, the container recognizes the CDI bean correctly.



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the jboss-jira mailing list