getValidationMode()的AbstractMethodError Ljavax / persistence / ValidationMode

时间:2014-05-19 15:29:33

标签: java eclipse hibernate tomcat jpa

我得到一个例外,如下面的问题:

SpringPersistenceUnitInfo :: AbstractMethodError

引起:java.lang.AbstractMethodError:org.springframework.orm.jpa.persistenceunit.SpringPersistenceUnitInfo.getValidationMode()Ljavax / persistence / ValidationMode

我的依赖项在屏幕截图中,我尝试了几乎所有的建议,结果是同样的例外:

enter image description here

在回答中添加依赖项后:

enter image description here

1 个答案:

答案 0 :(得分:1)

您很可能错过了这些依赖项:

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator-annotation-processor</artifactId>
    <version>5.0.3.Final</version>
    <scope>test</scope>
</dependency>

<dependency>
    <groupId>javax.validation</groupId>
    <artifactId>validation-api</artifactId>
    <version>1.1.0.Final</version>
    <scope>test</scope>
</dependency>