when i try to using bean validation with JPA using hibernate , the follwoing exception will occur :
Exception in thread \"main\" javax.persistence.Persistenc
As @Korgen mentioned in comments hibernate-validator-5.x.x isn't compatible with validation-api-1.0.x. This is because of moving to new specification JSR-303 -> JSR-349.
There are two ways to solve this issue:
1. Downgrade hibernate validator version (which is implements JSR-303):
org.hibernate
hibernate-validator
4.3.1.Final
2. If you don't want to move back from hibernate validator 5 to hibernate validator 4 another solution is to upgrade javax.validation to higher version (which is describe JSR-349):
javax.validation
validation-api
1.1.0.Final