Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using javax.validation with Tomcat7

I'm trying to get javax.validation working on Tomcat 7.

Ive got in my WEB_INF/lib: hibernate-validator-4.3.0 as well as slf4j-api-1.7.1 and slf4j-simple-1.7.1.

When I run my code, the validation is just ignored! Its all working fine on glassfish, has anyone else had this problem?

Cheers! NFV

like image 792
nfvindaloo Avatar asked Oct 04 '12 17:10

nfvindaloo


1 Answers

You need the validation-api.jar as well. It contains the Bean Validation API including the bootstrapping classes (javax.validation.Validation).

Perhaps you downloaded the loose JAR files instead of the distribution bundle. You can download the currently latest 4.3.0 release as zip here. It contains all the files you need to drop in /WEB-INF/lib. After extracting the zip, you can find the validation-api.jar in the /lib/required folder.

like image 62
BalusC Avatar answered Sep 20 '22 22:09

BalusC