Dropwizard在启动时给出验证错误

时间:2012-05-26 12:09:34

标签: dropwizard

我在使用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)

我使用Dropwizard和Hibernate for JPA而不是JDBI,因为我有复杂的持久性要求。

1 个答案:

答案 0 :(得分:1)

答案与我自己的muppetry有关。我在homnate实体管理器中引入了旧版本,作为我在pom.xml中的其他依赖项的一部分。

对于Dropwizard 0.4.0,您需要强制使用Hibernate Entity Manager 3.6.0.Final。希望这会对其他人有所帮助。

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