Omnifaces 2.5.1和EAR内的多个WAR

时间:2016-12-09 00:51:05

标签: cdi war ear omnifaces

我有一个应用程序可以在Wildfly 10下运行Omnifaces 2.5.1 Mojarra。这个应用程序有多个WAR,但只有一个使用Omnifaces。

今天我尝试添加Omnifaces以在EAR内的第二个WAR中使用。我得到了这个例外:

Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type Long with qualifiers @Param
  at injection point [BackedAnnotatedField] @Inject @Param private siscom.web.jsf.controller.PartnerDetailsController.id
  at siscom.web.jsf.controller.PartnerDetailsController.id(PartnerDetailsController.java:0)
WELD-001475: The following beans match by type, but none have matching qualifiers:
  - Producer Method [Long] with qualifiers [@BatchProperty @Any] declared as [[UnbackedAnnotatedMethod] @Produces @BatchProperty public org.jberet.creation.BatchBeanProducer.getLong(InjectionPoint)]

    at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:359)
    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)

我的控制器是:

@ViewScoped @Named
public class PartnerDetailsController implements Serializable {

    @Inject
    @Param
    private Long id;
}

注意:有时候工作正常,有时却没有。当我重新启动应用程序工作。如果我重新开始,则不起作用。

1 个答案:

答案 0 :(得分:0)

您不能将@Param与包含在WAR中的Omnifaces的多个EAR一起使用。这是CDI和OF之间的交互错误。

相关博文:http://balusc.omnifaces.org/2013/10/cdi-behaved-unexpectedly-in-ear-so.html

如果它在最新版本中运行,我最近没有测试过它。