简体   繁体   中英

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?). Check your dependencies and exclude hibernate-core from another dependencies. I had the same error with jboss and hibernate-search (it depends on 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. For JBoss you can see them here: jboss_home/common/lib

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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