hibernatejboss-4.2.xjboss-web

Try to deploy a web application using latest hibernate version to jboss4.2.3.GA


I am trying to deploy a web application using hibernate to Jboss 4.3.2.GA but I am receiving following error.

Invocation of init method failed; nested exception is
org.hibernate.AnnotationException:
java.lang.NoSuchMethodException:
org.hibernate.validator.ClassValidator.<init>(
   java.lang.Class,
   java.util.ResourceBundle,
   org.hibernate.validator.MessageInterpolator,
   java.util.Map,
   org.hibernate.annotations.common.reflection.ReflectionManager)

I have a "jboss-web.xml" in /WEB-INF as

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
    <loader-repository>
    <loader-repository-config>
    java2ParentDelegation=false
    </loader-repository-config>
    </loader-repository> 
 </jboss-web>

but i am still having the same error


Solution

  • I have added following dependencies and my problem is solved. Thanks to Hibernate guys, they provide us a legacy validator.

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator-legacy</artifactId>
            <version>4.0.2.GA</version>
            <exclusions>
                <exclusion>
                    <artifactId>hibernate-commons-annotations</artifactId>
                    <groupId>org.hibernate</groupId>
                </exclusion>
            </exclusions>
        </dependency>