Search code examples
hibernate-validator

The import org.hibernate.validator.ClassValidator cannot be resolved


I am working on a demo example that demonstrates the use of Hibernate's

validation API.

I'm trying to use the ClassValidator class.

But the import required for it,  

org.hibernate.validator.ClassValidator<User.class> is not getting resolved.

I also have the compatible dependencies
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.2.4.Final</version>

<hibernate.version>4.2.1.Final</hibernate.version>

Solution

  • Update the following
    
    <!-- Hibernate / JPA -->
            <hibernate.version>3.0.0.GA</hibernate.version>
    
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-annotations</artifactId>
        <version>3.5.6-Final</version>
    </dependency>
    
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>3.3.2.GA</version>
            </dependency>
    
    <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>3.1.0.GA</version>
            </dependency>