Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hibernate :java.lang.NoSuchMethodError:javax/validation/spi/ConfigurationState.getParameterNameProvider()Ljavax/validation/ParameterNameProvider

We are executing Junit suite for Spring-Hibernate based application( using spring text conext Unit testing framework).and using ANT for building and below Hibernate Jars are there in build path .

hibernate-validator-5.0.1.Final.jar
validation-api-1.1.0.Final.jar

hibernate-commons-annotations-4.0.2.Final.jar
hibernate-core-4.2.3.Final.jar
hibernate-ehcache-4.2.3.Final.jar
hibernate-entitymanager-4.2.3.Final.jar

We are getting below error seems related to Hibernate validation.

   java.lang.NoSuchMethodError:javax/validation/spi/ConfigurationState.getParameterNameProvider()Ljavax/validation/ParameterNameProvider at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.(ValidatorFactoryImpl.java:113) at org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:45) at org.hibernate.validator.internal.engine.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:217) at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:50) at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:445) at org.hibernate.cfg.beanvalidation.TypeSafeActivator.activate(TypeSafeActivator.java:96) at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:150)
like image 361
Om P Avatar asked Sep 19 '13 17:09

Om P


1 Answers

Most likely you have an older version of validation-api on somewhere your classpath (in this case, 1.0.0). Very similar to this question.

like image 99
Substance586 Avatar answered Sep 22 '22 08:09

Substance586