Runtime Error - java.lang.NoSuchMethodError: org.hibernate.validator.HibernateValidatorConfiguration.addValueExtractor
See original GitHub issueRelease: 2.0.0
Error- As soon you execute the jar file, you get following error:
Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.validator.HibernateValidatorConfiguration.addValueExtractor(Ljavax/validation/valueextraction/ValueExtractor;)Ljavax/validation/Configuration;
at io.dropwizard.validation.BaseValidator.newConfiguration(BaseValidator.java:27)
at io.dropwizard.jersey.validation.Validators.newConfiguration(Validators.java:33)
at io.dropwizard.jersey.validation.Validators.newValidatorFactory(Validators.java:26)
at io.dropwizard.setup.Bootstrap.<init>(Bootstrap.java:64)
at io.dropwizard.Application.run(Application.java:86)
at BusinessAPI.main(BusinessAPI.java:51)
Workaround: Exclusion of 6.1.0.Final version and inclusion of 6.0.17.Final
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
<exclusions>
<exclusion>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.17.Final</version>
</dependency>
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Trouble starting Hibernate Validator due to Bean Validation API
The java validation code is passing the Hiberate an outdated ConfiguationState interface; one that doesn't implement the required interfaces.
Read more >Dropwizard 0.8 throws NoSuchMethodError on ...
Exception in thread "main " java.lang.NoSuchMethodError: org.hibernate.validator.HibernateValidatorConfiguration.
Read more >Hibernate Validator 8.0.0.Final - Jakarta Bean Validation ...
The validate() method returns a set of ConstraintViolation instances, which you can iterate over in order to see which validation errors ...
Read more >[Solved] java.lang.NoClassDefFoundError: Could not initialize ...
NoClassDefFoundError : Could not initialize class org.hibernate.validator.engine.ConfigurationImpl. Last Updated: October 1, 2022.
Read more >Java.Lang.Nosuchmethoderror: Org.Hibernate.Sessionfactory ...
openSessionLorg/hibernate/Session; at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter. NoSuchMethodError: 'java.lang.String javax.validation.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Problem is that
javax.validation:validation-api-1.1.0-Final.jar
andjakarta.validation:jakarta.validation-api-2.0.2.jar
are both on your classpath, they have classes in the same namespace(javax.validation
) and older version of the class, one which doesn’t have methods present in the latest version, is being loaded by the classloader.You’ll have to exclude
javax.validation
from your classpath, it’s coming fromswagger-models
For bystanders ending up here, this has been fixed in swagger-core v2.1.2 from https://github.com/swagger-api/swagger-core/pull/3467 so the exclusion shouldn’t be needed anymore.