<div dir="ltr">Hi Michael,<div><br></div><div>you may also consider the following possibilities:</div><div><br></div><div>1) the class defining producer method is not a bean itself (in CDI 1.2 use beans.xml with both version 1.1 and bean-discovery-mode of annotated and don&#39;t apply any bean defining annotation)</div><div><br></div><div>2) define a qualifier and use it either on bean or producer method in conjunction with inject</div><div><br></div><div>Radim</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-01-02 17:02 GMT+01:00 Michael Remijan <span dir="ltr">&lt;<a href="mailto:mjremijan@yahoo.com" target="_blank">mjremijan@yahoo.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:verdana,helvetica,sans-serif;font-size:13px"><div>Greetings,</div><div><br></div><div dir="ltr">I recently ran into a situation where I had created a producer method for an object but when Weld was starting up I got errors about something being ambiguous.  I finally tracked the issue to the fact that the bean my producer method was responsible for producing only had a default no-arg constructor.  I was able to &quot;work around&quot; this problem by annotating the bean as an @Alternative.  So I have a few questions.</div><div dir="ltr"><br></div><div dir="ltr">(1)</div><div dir="ltr">Is this expected behavior from CDI? If a bean only has the default no-arg constructor should you get an ambiguous error if you also have a producer method for the bean?</div><div dir="ltr"><br></div><div dir="ltr">(2)</div><div dir="ltr">Is annotating the bean as an @Alternative an acceptable &quot;work around&quot;?  Seems hackish to me. If not, what is the appropriate solution.</div><div dir="ltr"><br></div><div dir="ltr">Thanks!<br></div><div><br></div></div></div><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" 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" 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.<br></blockquote></div><br></div>