[cdi-dev] [JBoss JIRA] (CDI-579) Extension disqualifies a jar as 'implicit bean archive'?
Martin Kouba (JIRA)
issues at jboss.org
Mon Jan 25 02:49:00 EST 2016
[ https://issues.jboss.org/browse/CDI-579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13152804#comment-13152804 ]
Martin Kouba edited comment on CDI-579 at 1/25/16 2:48 AM:
-----------------------------------------------------------
Well, Weld must follow the spec (i.e. it's not recognized as a bean archive), otherwise it wouldn't pass the relevant TCK test:
https://github.com/cdi-spec/cdi-tck/blob/1.2/impl/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/BeanDiscoveryTest.java#L187
[Weld SE|http://docs.jboss.org/weld/reference/latest/en-US/html/environments.html#_implicit_bean_archive_support_2] and [Weld Servlet|http://docs.jboss.org/weld/reference/latest/en-US/html/environments.html#_implicit_bean_archive_support] have a limited implicit bean archive support - bean archives without beans.xml descriptor are completely ignored.
But I agree it sounds weird.
was (Author: mkouba):
Weld must follow the spec (i.e. it's not recognized as a bean archive), otherwise it wouldn't pass the relevant TCK test:
https://github.com/cdi-spec/cdi-tck/blob/1.2/impl/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/BeanDiscoveryTest.java#L187
[Weld SE|http://docs.jboss.org/weld/reference/latest/en-US/html/environments.html#_implicit_bean_archive_support_2] and [Weld Servlet|http://docs.jboss.org/weld/reference/latest/en-US/html/environments.html#_implicit_bean_archive_support] have a limited implicit bean archive support - bean archives without beans.xml descriptor are completely ignored.
> Extension disqualifies a jar as 'implicit bean archive'?
> --------------------------------------------------------
>
> Key: CDI-579
> URL: https://issues.jboss.org/browse/CDI-579
> Project: CDI Specification Issues
> Issue Type: Bug
> Reporter: Mark Struberg
> Priority: Minor
>
> The bean-discovery-wording is a bit odd.
> This has been in since CDI-1.1
> {code}
> An archive which:
> • contains a beans.xml file with the bean-discovery-mode of none, or,
> • contains an extension and no beans.xml file is not a bean archive.
> is not a bean archive.
> {code}
> That means even if you have an @ApplicationScoped MyService class in a jar which has a single CDI Extension then this MyServices will *not* get picked up as CDI bean? At least according to this wording?
> Feels mega-weird to me and might conflict with the implicit beans archive definition a few lines below.
> I'm pretty sure in OWB we will pick those beans up. How does Weld behave?
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the cdi-dev
mailing list