Gary
Gary

Reputation: 7257

Dropwizard gives validation error on startup

I'm getting the following exception on startup with Dropwizard

Exception in thread "main" javax.validation.ValidationException: Call to TraversableResolver.isReachable() threw an exception
    at org.hibernate.validator.engine.ValidatorImpl.isValidationRequired(ValidatorImpl.java:1251)
    at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:448)
    at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:397)
    at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:361)
    at org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:313)
    at org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:139)
    at com.yammer.dropwizard.validation.Validator.validate(Validator.java:32)
    at com.yammer.dropwizard.config.ConfigurationFactory.validate(ConfigurationFactory.java:88)
    at com.yammer.dropwizard.config.ConfigurationFactory.build(ConfigurationFactory.java:53)
    at com.yammer.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:69)
    at com.yammer.dropwizard.cli.Command.run(Command.java:113)
    at com.yammer.dropwizard.AbstractService.run(AbstractService.java:178)

I'm using Dropwizard with Hibernate for JPA rather than JDBI since I have complex persistence requirements.

Upvotes: 0

Views: 706

Answers (1)

Gary
Gary

Reputation: 7257

And the answer was all to do with my own muppetry. I was introducing an older version of the Hibernate Entity Manager as part of my other dependencies in the pom.xml.

For Dropwizard 0.4.0 you'll need to force use of Hibernate Entity Manager 3.6.0.Final. Hopefully this will help others.

<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-entitymanager</artifactId>
  <version>3.6.0.Final</version>
</dependency>

Upvotes: 1

Related Questions