0
@ConversationScoped
public class BackingBean

{

    @Inject Conversation conversation;



    public BackingBean() {}



     ...

}

Why is Intellij giving me a warning: "Unsatisfied dependency: no bean matches the injection point."

The CTRL+F1 detail message is "Detect injection points that have ambiguous dependencies."

It compiles and deploys and seems to run fine on JBoss e.g. I'm able to conversation.begin(), conversation.end(), etc.

Patrick Garner
  • 3,201
  • 6
  • 39
  • 58

2 Answers2

2

I went to Project Structure --> Modules. I selected my web module. I noticed the CDI facet. I clicked on the facet and noticed that neither of the two radio buttons were selected: Apache Open Web Beans or JBoss Weld. I selected JBoss Weld. Then, an error message appeared:

"The following libraries are missing: weld-api.jar, weld-core.jar, weld-logger.jar, weld-se.jar, weld-servlet-int.jar, weld-spi.jar, weld-tomcat-support.jar, weld-wicket.jar"

I clicked the "Fix" button. A dialog opened, "Setup Library." I had a choice: "Use Library" or "Download."

I chose Download.

Intellij downloaded the eight jar files and installed them in my $PROJECT_HOME/lib directory.

Now, I don't receive any warnings when I inject Conversation.

Patrick Garner
  • 3,201
  • 6
  • 39
  • 58
1

If it runs on the server you are fine - looks like you either found a bug in Idea or somehow misconfigured the CDI nature of the project (Conversation is certainly in your classpath, but maybe not scanned by Idea)...

I suspect the latter :)

Jan Groth
  • 14,039
  • 5
  • 40
  • 55
  • 1
    Thank you for reminding me that, clearly, Conversation must have been in my classpath because the project compiled and ran fine after deployment. That was the reminder that I needed to resolve the problem. After thinking about it I realized that placing the dependency in my POM wasn't good enough; I had to do something else. I documented the solution in my answer. – Patrick Garner Aug 16 '12 at 17:14