How to disable JSR-303 Hibernate Validation in Spring3

Posted by Pinchy on Stack Overflow See other posts from Stack Overflow or by Pinchy
Published on 2013-11-11T02:55:24Z Indexed on 2013/11/11 3:53 UTC
Read the original article Hit count: 415

After putting hibernate-validator.jar and javax.validation-api.jar in my classpath the org.springframework.dao.DataIntegrityViolationException is replaced by org.hibernate.exception.ConstraintViolationException and this is causing a lot of issues.

I have to put this two jars to be able to upgrade Jersey to 2.4, it has dependency on these two jars.

Putting these properties into hibernate.properties file doesn't help, hibernate simply ignores them but it loads the properties on start-up

loaded properties from resource hibernate.properties: {hibernate.validator.apply_to_ddl=false,hibernate.validator.autoregister_listeners=false etc}

javax.persistence.validation.mode=none
hibernate.validator.autoregister_listeners=false
hibernate.validator.apply_to_ddl=false

I am using Spring 3.2.4 with SessionFactory and mapping resources from hbm.xml files with constraints in it, hibernate 3.6.9.final, hibernate-validator 5.0.final, javax.validator-api 1.1.0.Final

I just can't figure out how to disable hibernate validation, any help will be much appreciated.

© Stack Overflow or respective owner

Related posts about spring

Related posts about validation