简体   繁体   English

在JBoss 6上使用hibernate-validator时出错

[英]Error using hibernate-validator on JBoss 6

I get the following error at deploy time: 部署时出现以下错误:

22:34:40,393 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=fizio.ear/events-service.war#fizio state=Create: org.hibernate.HibernateException: Unable to get the default Bean Validation factory

Caused by: 造成原因:

Caused by: java.lang.IllegalAccessException: Class org.hibernate.cfg.beanvalidation.BeanValidationActivator can not access a member of class org.hibernate.cfg.beanvalidation.TypeSafeActivator with modifiers "public static"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65) [:1.6.0_22]
at java.lang.reflect.Method.invoke(Method.java:588) [:1.6.0_22]
at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:118) [:3.6.0.Final]

Any suggestions on how to fix it would be appreciated. 关于如何解决它的任何建议,将不胜感激。 Thanks in advance. 提前致谢。

you have a version conflict with hibernate-core (maybe with jboss?). 您与hibernate-core(也许与jboss?)有版本冲突。 Check your dependencies and exclude hibernate-core from another dependencies. 检查您的依赖项,并将hibernate-core从另一个依赖项中排除。 I had the same error with jboss and hibernate-search (it depends on hibernate-core). 我在jboss和hibernate-search中有相同的错误(取决于hibernate-core)。

I had the same error, but I solved it. 我有同样的错误,但我解决了。 Just remove all hibernate dependencies from your ear, except: hibernate-search, hibernate-search-analyzers. 只需从您的耳朵中删除所有休眠依赖项即可,除了:休眠搜索,休眠搜索分析器。 They are already in your AS. 他们已经在您的AS中。 For JBoss you can see them here: jboss_home/common/lib 对于JBoss,您可以在这里看到它们:jboss_home / common / lib

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM