部署rewards-jsf应用程序时出现以下错误。请指教。
07:18:41,768 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.unit."rewards-jsf-6.0.1-SNAPSHOT.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."rewards-jsf-6.0.1-SNAPSHOT.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [UserGroupCallback] with qualifiers [@Default] at injection point [[field] @Inject private org.jbpm.examples.util.RewardsApplicationScopedProducer.usergroupCallback]. Possible dependencies [[Managed Bean [class org.jbpm.examples.util.RewardsUserGroupCallback] with qualifiers [@Any @Default], Producer Method [UserGroupCallback] with qualifiers [@Any @Default] declared as [[method] @ApplicationScoped @Produces public org.jbpm.kie.services.cdi.producer.DefaultUserGroupInfoProducer.produceCallback()]]]
at org.jboss.as.weld.services.WeldService.start(WeldService.java:83)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [UserGroupCallback] with qualifiers [@Default] at injection point [[field] @Inject private org.jbpm.examples.util.RewardsApplicationScopedProducer.usergroupCallback]. Possible dependencies [[Managed Bean [class org.jbpm.examples.util.RewardsUserGroupCallback] with qualifiers [@Any @Default], Producer Method [UserGroupCallback] with qualifiers [@Any @Default] declared as [[method] @ApplicationScoped @Produces public org.jbpm.kie.services.cdi.producer.DefaultUserGroupInfoProducer.produceCallback()]]]
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:278)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:244)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:107)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:127)
at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:346)
at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:331)
at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:366)
at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83)
at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)
... 5 more
答案 0 :(得分:0)
这是肯定的问题: 引起:org.jboss.weld.exceptions.DeploymentException:WELD-001409类型[UserGroupCallback]的不明确依赖关系: 需要UserGroupCallBack的注入点 - > @Inject private org.jbpm.examples.util.RewardsApplicationScopedProducer.usergroupCallback]。
1)第一场可能的比赛: [[Managed Bean [class org.jbpm.examples.util.RewardsUserGroupCallback] with qualifiers [@Any @Default],
2)第二次匹配:生产者方法[UserGroupCallback],带有限定符[@Any @Default],声明为[[method] @ApplicationScoped @Produces public org.jbpm.kie.services.cdi.producer.DefaultUserGroupInfoProducer.produceCallback()] ]
为了工作,这两个中的一个必须消失。我想RewardsUserGroupCallback是这个应用程序的一个内容(我不知道这个应用程序的托管位置或它的内部),所以你需要检查代码。
答案 1 :(得分:0)
DefaultUserGroupInfoProducer应该已经被标记为替代,因此需要在beans.xml中指定来获取它,是这样吗?如果是这样,从beans.xml中删除它应该禁用它。