gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 16:03:53 28 4
gpt4 key购买 nike

我的项目昨天运行良好。我唯一做的就是将结构从单一 war 更改为多模块 pom。如果我正确理解堆栈跟踪,则焊接和omnifaces websocket lib之间存在歧义。但是,在堆栈跟踪上似乎没有对我的任何方法进行任何调用。所以也许这是omnifaces的问题?我什至不使用omnifaces websockets,我使用javax.websocket。然而,我过去确实在这个项目中尝试过,我在“org.omnifaces.cdi”上进行了搜索,并注释掉了子包中的内容,如 @Param但问题仍然存在。
我也不明白为什么歧义似乎来自两个完全相同的类:

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

[2016-06-25 03:13:59,430] Artifact core:war: java.lang.Exception: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"core-0.0.1-SNAPSHOT.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"core-0.0.1-SNAPSHOT.war\".WeldStartService: Failed to start service
Caused by: org.jboss.weld.exceptions.DeploymentException: Exception List with 4 exceptions:
Exception 0 :
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
at org.omnifaces.cdi.push.SocketPushContextProducer.socketSessions(SocketPushContextProducer.java:0)
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]

at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:367)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:281)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Exception 0 :
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.SocketChannelManager.socketSessions
at org.omnifaces.cdi.push.SocketChannelManager.socketSessions(SocketChannelManager.java:0)
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]

at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:367)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:281)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type SocketUserManager with qualifiers @Default
at injection point [BackedAnnotatedField] @Inject private org.omnifaces.cdi.push.SocketSessionManager.socketUsers
at org.omnifaces.cdi.push.SocketSessionManager.socketUsers(SocketSessionManager.java:0)
Possible dependencies:
- Managed Bean [class org.omnifaces.cdi.push.SocketUserManager] with qualifiers [@Any @Default],
- Managed Bean [class org.omnifaces.cdi.push.SocketUserManager] with qualifiers [@Any @Default]

at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:367)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:281)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Exception 0 :
org.jboss.weld.exceptions.AmbiguousResolutionException: WELD-001318: Cannot resolve an ambiguous dependency between:
- Managed Bean [class org.omnifaces.cdi.push.SocketSessionManager] with qualifiers [@Any @Default],
- Managed Bean [class org.omnifaces.cdi.push.SocketSessionManager] with qualifiers [@Any @Default]
at org.jboss.weld.manager.BeanManagerImpl.resolve(BeanManagerImpl.java:1235)
at org.jboss.weld.bootstrap.Validator.validatePseudoScopedInjectionPoint(Validator.java:926)
at org.jboss.weld.bootstrap.Validator.reallyValidatePseudoScopedBean(Validator.java:902)
at org.jboss.weld.bootstrap.Validator.reallyValidatePseudoScopedBean(Validator.java:917)
at org.jboss.weld.bootstrap.Validator.validatePseudoScopedBean(Validator.java:879)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:138)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
"}}

最佳答案

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



基本上,Weld 发现了多个 CDI 托管 bean,它们可以注入(inject) private SocketSessionManager socketSessions SocketPushContextProducer 的字段类(class)。其后列出:

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]


然而,在这种特定情况下,它们是完全相同的。这意味着有多个 SocketSessionManager运行时类路径中的类。这反过来意味着运行时类路径中存在多个 OmniFaces 库/依赖项(或脏构建/(热)部署,可以通过破坏服务器的工作/临时文件夹或生成干净的服务器实例来解决)。

您需要确保运行时类路径中只有一个 OmniFaces 库,并且它最终出现在 WAR 的 /WEB-INF/lib 中。 .

这与 websocket 无关。它恰好是 Weld 扫描的第一个与 OmniFaces 相关的类。它可能发生在 OmniFaces 中捆绑的任何其他 CDI 托管 bean 上。

关于maven - org.jboss.weld.exceptions.DeploymentException : WELD-001409: Ambiguous dependencies for type Bean with qualifiers @Default,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38029184/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com