views:

1047

answers:

2

I am trying to use validation with Spring 3.x.

I have annotated a method field with @Valid, added <mvc:annotation-driven/> to my common.xml, and added Hibernate-Validator.jar in the lib/ dir, but I keep getting this message: "Hibernate validator not found: ignoring".

Am I missing something?

  [Version:15] Hibernate Annotations 3.4.0.GA
  [Environment:543] Hibernate 3.3.0.SP1
  [Environment:576] hibernate.properties not found
  [Environment:709] Bytecode provider name : javassist
  [Environment:627] using JDK 1.4 java.sql.Timestamp handling
  [Version:14] Hibernate Commons Annotations 3.1.0.GA
  [AnnotationConfiguration:369] Hibernate Validator not found: ignoring
+1  A: 

It means that Hibernate can't find the classes org.hibernate.validator.ClassValidator or org.hibernate.validator.MessageInterpolator, hinting that there's a problem with the library versions in your classpath.

I see you're using the following versions:

  • Hibernate Annotations 3.4.0.GA
  • Hibernate 3.3.0.SP1
  • Hibernate Commons Annotations 3.1.0.GA

And your JAR is hibernate-validator-4.0.2.GA.jar. Are you sure that all of these versions are compatible with each other?

Please try downloading the newest versions of the different Hibernate components, put them in your classpath and see if the error is still there.

torbengee
Hi, thank you for you reply! Mm.. I don't find the classes that you named. In which JAR are they supposed to be? Otherwise I seem to have all the latest releases: hibernate-validator-4.0.2.GA.jar, hibernate-annotations-3.4.0.GA and the core distrib: hibernate-distribution-3.3.2.GA.
ciaron
And the weird thing is it still finds a validator later in the start up process:[SchemaUpdate:183] schema update complete [Version:56] Hibernate Validator 4.0.2.GA [DefaultTraversableResolver:89] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
ciaron
The classes aforementioned should be in hibernate-validator*.jar. Do you deploy in an application server? Maybe it comes with a Hibernate version that's incompatible. Just a guess.
torbengee
A: 

At last, I found the answer at Spring ROO Issue Tracker

it is a bug in Hibernate that is known to be corrected in Hibernate 3.5

I've this message too in my Spring project, but validation still works.

Yuri.Bulkin