<html><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:13px">Yes that's right. I don't want the bean activated directly because the producer method does some additional logic before activation.<br><div id="yui_3_16_0_1_1420216496134_12808"><span></span></div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: verdana, helvetica, sans-serif; font-size: 13px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <font size="2" face="Arial"> On Friday, January 2, 2015 11:17 AM, Romain Manni-Bucau <rmannibucau@gmail.com> wrote:<br> </font> </div> <br><br> <div class="y_msg_container">Hi Michael,<br clear="none"><br clear="none">1) yes if the bean is scanned as well<br clear="none">2) you can use @Alternative but using <scan />, @Vetoed, or @Typed()<br clear="none">for CDI 1.0 should work as well and are maybe less hacky since you'll<br clear="none">never activate this alternative right?<br clear="none"><br clear="none"><br clear="none">Romain Manni-Bucau<br clear="none">@rmannibucau<br clear="none"><a shape="rect" href="http://www.tomitribe.com/" target="_blank">http://www.tomitribe.com</a><br clear="none"><a shape="rect" href="http://rmannibucau.wordpress.com/" target="_blank">http://rmannibucau.wordpress.com</a><br clear="none"><a shape="rect" href="https://github.com/rmannibucau" target="_blank">https://github.com/rmannibucau</a><br clear="none"><br clear="none"><div class="yqt8159929615" id="yqtfd38121"><br clear="none">2015-01-02 17:02 GMT+01:00 Michael Remijan <<a shape="rect" ymailto="mailto:mjremijan@yahoo.com" href="mailto:mjremijan@yahoo.com">mjremijan@yahoo.com</a>>:<br clear="none">> Greetings,<br clear="none">><br clear="none">> I recently ran into a situation where I had created a producer method for an<br clear="none">> object but when Weld was starting up I got errors about something being<br clear="none">> ambiguous. I finally tracked the issue to the fact that the bean my<br clear="none">> producer method was responsible for producing only had a default no-arg<br clear="none">> constructor. I was able to "work around" this problem by annotating the<br clear="none">> bean as an @Alternative. So I have a few questions.<br clear="none">><br clear="none">> (1)<br clear="none">> Is this expected behavior from CDI? If a bean only has the default no-arg<br clear="none">> constructor should you get an ambiguous error if you also have a producer<br clear="none">> method for the bean?<br clear="none">><br clear="none">> (2)<br clear="none">> Is annotating the bean as an @Alternative an acceptable "work around"?<br clear="none">> Seems hackish to me. If not, what is the appropriate solution.<br clear="none">><br clear="none">> Thanks!</div><br clear="none">><br clear="none">><br clear="none">> _______________________________________________<br clear="none">> cdi-dev mailing list<br clear="none">> <a shape="rect" ymailto="mailto:cdi-dev@lists.jboss.org" href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br clear="none">> <a shape="rect" href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br clear="none">><br clear="none">> Note that for all code provided on this list, the provider licenses the code<br clear="none">> under the Apache License, Version 2<br clear="none">> (<a shape="rect" href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas<br clear="none">> provided on this list, the provider waives all patent and other intellectual<br clear="none">> property rights inherent in such information.<div class="yqt8159929615" id="yqtfd43954"><br clear="none"></div><br><br></div> </div> </div> </div> </div></body></html>