<div dir="ltr">Here is the file<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 24, 2015 at 4:40 PM, Antoine Sabot-Durand (JIRA) <span dir="ltr">&lt;<a href="mailto:issues@jboss.org" target="_blank">issues@jboss.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
    [ <a href="https://issues.jboss.org/browse/CDI-574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=13133410#comment-13133410" rel="noreferrer" target="_blank">https://issues.jboss.org/browse/CDI-574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=13133410#comment-13133410</a> ]<br>
<br>
Antoine Sabot-Durand commented on CDI-574:<br>
------------------------------------------<br>
<span class="im HOEnZb"><br>
Sorry Emily. I understand roughly your question, but could you detail your use case. You&#39;re talking about producer, there is not code for them. I don&#39;t understand where the CounterProducerConsumerModified2 bean is defined.<br>
>From here it looks like a corner case, but I may be wrong. Could you format your code and add your whole example. Thx.<br>
<br>
&gt; Should a disabled @Specialized disable a second bean?<br>
</span><div class="HOEnZb"><div class="h5">&gt; -----------------------------------------------------<br>
&gt;<br>
&gt;                 Key: CDI-574<br>
&gt;                 URL: <a href="https://issues.jboss.org/browse/CDI-574" rel="noreferrer" target="_blank">https://issues.jboss.org/browse/CDI-574</a><br>
&gt;             Project: CDI Specification Issues<br>
&gt;          Issue Type: Clarification<br>
&gt;          Components: Inheritance and Specialization<br>
&gt;    Affects Versions: 1.2.Final<br>
&gt;         Environment: n/a<br>
&gt;            Reporter: Emily Jiang<br>
&gt;<br>
&gt; In CDI specification Section 4.3:<br>
&gt; When an enabled bean, as defined in Section 5.1.2, “Enabled and disabled beans”, specializes a second bean, we can be certain that the second bean is never instantiated or called by the container. Even if the second bean defines a producer or observer method, the method will never be called.<br>
&gt; The spec says only an enabled bean can specialize a second bean. Can a disabled specialized bean specialize a second bean?<br>
&gt; Weld asserts a disabled specialized bean specializes a second bean while OWB asserts a disabled specialized bean does not specialize a second bean.<br>
&gt; This needs to be clarified.<br>
&gt; In more details:<br>
&gt; I have an application containing two wars.<br>
&gt; testDiffBDA.war<br>
&gt; testDiffBDA.war/WEB-INF/classes/test/diff/web/FrontEndServlet.class<br>
&gt; @Inject CounterProducerConsumerModified2 bean;<br>
&gt; beans-xml-modified2.jar<br>
&gt; containing one bean and an empty-ish beans.xml :<br>
&gt; @Inject@CounterModifiedQualifier String modifiedProducer;<br>
&gt; beans-xml-modified.jar.jar<br>
&gt; CounterModifiedQualifier  (the interface)<br>
&gt; CounterProducerModified (the bean implementing that interface)<br>
&gt; AlternativeCounterProducerModified (an alternative specialized bean)<br>
&gt;  beans.xml<br>
&gt;    &lt;alternatives&gt;<br>
&gt;         &lt;class&gt;com.ibm.jcdi.test.beansxml.AlternativeCounterProducerModified&lt;/class&gt;<br>
&gt;    &lt;/alternatives&gt;<br>
&gt; My application failed deployment with the error on Weld but worked on OpenWebBeans<br>
&gt; {code}<br>
&gt; [ERROR   ] CWWKZ0004E: An exception occurred while starting the application testDiffBDA. The exception message was: com.ibm.ws.container.service.state.StateChangeException: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type String with qualifiers @CounterModifiedQualifier<br>
&gt;   at injection point [BackedAnnotatedField] @Inject @CounterModifiedQualifier com.ibm.jcdi.test.beansxml.CounterProducerConsumerModified2.modifiedProducer<br>
&gt;   at com.ibm.jcdi.test.beansxml.CounterProducerConsumerModified2.modifiedProducer(CounterProducerConsumerModified2.java:0)<br>
&gt; {code}<br>
&gt; After further investigation and talking to Martin from Weld, the error was caused due to the fact of AlternativeCounterProducerModified disabling the CounterProducerModified bean but itself is not enabled in the jar of beans-xml-modified2.jar. Therefore, no producer is active to produce a bean with the qualifier CounterModifiedQualifier.<br>
&gt; From Weld&#39;s perspective, any bean annotated with @Specialized disables a second bean regardless whether itself is active or not.<br>
&gt; My understanding is that the specialized should only take effect if itself is enabled. Otherwise, we run into the situation of where the specialized bean is not enabled but it disabled another bean. To me, it is wrong.<br>
<br>
<br>
<br>
--<br>
</div></div><span class="im HOEnZb">This message was sent by Atlassian JIRA<br>
</span><div class="HOEnZb"><div class="h5">(v6.4.11#64026)<br>
<br>
_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Thanks<br>Emily<br>=================<br>Emily Jiang<br><a href="mailto:ejiang@apache.org" target="_blank">ejiang@apache.org</a><br></div>
</div>