org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type Bean with qualifiers @Default

后端 未结 2 1364
猫巷女王i
猫巷女王i 2020-12-20 17:20

My project was working fine yesterday. The only thing I did was to change the structure from a single war to a multi module pom. If I understand correctly the stacktrace the

相关标签:
2条回答
  • 2020-12-20 18:05

    It could also be just a version change in pom, and maven build cache inconsistency. A mvn clean helped in my case.

    0 讨论(0)
  • 2020-12-20 18:09

    org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type SocketSessionManager with qualifiers @Default at injection point [BackedAnnotatedField] @Inject private org.omnifaces.cdi.push.SocketPushContextProducer.socketSessions

    Basically, Weld discovered multiple CDI managed beans which could be injected in private SocketSessionManager socketSessions field of the SocketPushContextProducer class. They are listed thereafter:

    Possible dependencies:

    • Managed Bean [class org.omnifaces.cdi.push.SocketSessionManager] with qualifiers [@Any @Default]
    • Managed Bean [class org.omnifaces.cdi.push.SocketSessionManager] with qualifiers [@Any @Default]

    In this specific case they are however exactly the same. This means that there are multiple SocketSessionManager classes in the runtime classpath. This in turn means that there are multiple OmniFaces libraries/dependencies present in the runtime classpath (or a dirty build/(hot)deploy which could be solved by trashing server's work/temp folders or spawning a clean server instance).

    You need to make sure that there's only one OmniFaces library in the runtime classpath and that it ends up in WAR's /WEB-INF/lib.

    This is not specifically related to websockets. It just happened to be the first OmniFaces-related class which is scanned by Weld. It could occur on any other CDI managed bean bundled in OmniFaces.

    0 讨论(0)
提交回复
热议问题