106.330 and CDI @Produces and @Inject

Hi All,

Please look at the code in the attached image.

  • I have a createLogger method which produces a bean of org.slf4j.Logger type (which is an interface).
  • I inject that bean into a servlet. IDEA gives out a warning "Ambiguous dependency: there are multiple beans that match the injection point ...". When I click on the bean icon on the left margin, IDEA asks me to choose a bean in a list of classes which implement the interface org.slf4j.Logger but don't go to the producer method. This code works fine with Weld 1.1.0.Final and that means there's no ambiguous dependency, isn't it?


If I click on the bean icon on the left margin of the line "public Logger createLogger(InjectionPoint ip) {", IDEA leads me to the 'InjectionPoint' bean. Is there any way to see a list of places where the bean created by this producer method is injected?

Regards.



Attachment(s):
Selection_002.png

Please sign in to leave a comment.