Greetings,
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 "work around" this problem by annotating the bean as an @Alternative. So I have a few questions.
(1)
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?
(2)
Is annotating the bean as an @Alternative an acceptable "work around"? Seems hackish to me. If not, what is the appropriate solution.
Thanks!