2015-05-11 147 views
0

我回顾了有关SO的其他相关问题,但未找到我的问题的答案。WELD-001408:带有限定符的类型验证程序的不满意依赖关系@Default

我从JBoss AS 7.11升级到Wildfly 8.2,遇到了人们称之为“臭名昭着的WELD-001408”问题。不过,就我所知,我的情况似乎不同,因为我们没有使用任何@Inject注释或任何应该导致验证错误的内容。

下面的堆栈跟踪似乎表明该异常是由焊接验证程序本身带有限定符@Default引起的。这对任何人都有意义吗?

我强调我的应用程序在任何地方都没有@Inject@Default注释。所以,这个例外很神秘。

任何人都可以指出我正确的方向来让我的应用程序在Wildfly 8.2中运行吗?

如果需要任何额外的信息,请向我会提供它,如果可能的话。

谢谢!

编辑[12月 - 2015年]:

我不知道是否有事情做与Hibernate验证?

从pom.xml中:正确使用Hibernate验证我

<dependency> 
    <groupId>org.hibernate</groupId> 
    <artifactId>hibernate-validator</artifactId> 
    <version>5.1.3.Final</version> 
    <scope>runtime</scope> 
</dependency> 

是谁?是否需要提供一些配置?是否有另一个验证程序可以用来代替?从wildfly启动


堆栈跟踪:

11:21:57,196 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."search.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."search.war".WeldStartService: Failed to start service 
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final] 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21] 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21] 
     at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21] 

Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: 

** Unsatisfied dependencies for type Validator with qualifiers @Default 
    at injection point [UnbackedAnnotatedField] @Inject private ** 
org.hibernate.validator.internal.cdi.interceptor.ValidationInterceptor.validator 
    at org.hibernate.validator.internal.cdi.interceptor.ValidationInterceptor.validator(ValidationInterceptor.java:0) 
WELD-001475: The following beans match by type, but none have matching qualifiers: 
    - ValidatorBean [id=org.hibernate.validator.internal.cdi.ValidatorBean_hv] 

     at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:372) 
     at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:293) 
     at org.jboss.weld.bootstrap.Validator.validateInterceptor(Validator.java:569) 
     at org.jboss.weld.bootstrap.ConcurrentValidator$2.doWork(ConcurrentValidator.java:85) 
     at org.jboss.weld.bootstrap.ConcurrentValidator$2.doWork(ConcurrentValidator.java:83) 
     at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60) 
     at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53) 
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_21] 
     at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_21] 
     ... 3 more 
+0

你碰巧在你的休息端点上有任何'javax.validation'注解吗? –

+0

@JohnAment - 不,其余端点上没有验证注释。 – laloumen

+0

感谢您的更新。尝试按照提供的方式标记hibernate验证器。 –

回答

1

我有完全相同的问题上Wildfly 9从JBoss的EAP 6.2迁移后!和解决方法形式 https://issues.jboss.org/browse/WFLY-2708帮助我。 因此,在您的活动standalone.xml文件焊接子系统配置:

<subsystem xmlns="urn:jboss:domain:weld:2.0"/> 

附加属性需要豆描述符= “真”,它看起来像:

<subsystem xmlns="urn:jboss:domain:weld:2.0" require-bean-descriptor="true"/> 
1

对不起(我知道你正在使用JBoss或Wildfly),但我只是将这个答案谁正在使用自由或WebSphere服务器,因为相同的消息“WELD-001408: Unsatisfied dependencies for type Validator with qualifiers @Default”出现在这些服务器了。

反正可以将问题描述帮你解决你的问题在JBoss中

问题描述

If your application includes the class Validator.class (including in internal jar files) Liberty may get confused between the the classfile in your application and the class file installed inside liberty itself leading to a WELD-001408: Unsatisfied dependencies for type Validator with qualifiers @Default exception.

我有你的问题,但在自由V16.0.0.3我固定它通过添加

<cdi12 enableImplicitBeanArchives="false"/>

的server.xml文件

这里是描述问题和固定的联系也 http://www-01.ibm.com/support/docview.wss?uid=swg1PI71667

顺便说一句,这是已经固定在自由V16.0.0.4(现在的最新版本)

相关问题