Weblogic 上 JPA​​ 2.0 的持久性问题

Persistence Issue for JPA 2.0 on Weblogic

我们试图在 Weblogic 上部署应用程序,但在激活更改时出现以下错误。我已经完成了激活 JPA 2.0 的必要设置。如果您需要更多详细信息,请告诉我,我会分享相同的信息。有没有人遇到过这个?

 java.lang.AbstractMethodError:
 weblogic.deployment.PersistenceUnitInfoImpl.getValidationMode()Ljavax/persistence/ValidationMode;
         at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:633)
         at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
         at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:393)
         at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:386)
         at weblogic.deployment.BasePersistenceUnitInfoImpl.<init>(BasePersistenceUnitInfoImpl.java:158)
         Truncated. see log file for complete stacktrace
 Caused By: java.lang.AbstractMethodError:
 weblogic.deployment.PersistenceUnitInfoImpl.getValidationMode()Ljavax/persistence/ValidationMode;
         at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:633)
         at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
         at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:393)
         at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:386)
         at weblogic.deployment.BasePersistenceUnitInfoImpl.<init>(BasePersistenceUnitInfoImpl.java:158)
         Truncated. see log file for complete stacktrace

我在控制台看到的weblogic版本如下

WebLogic Server 10.3.6.0.4 PSU 补丁 BUG16083651 Thu Mar 28 15:24:29 IST 2013 WebLogic Server 10.3.6.0 Tue Nov 15 08:52:36 PST 2011 1441050

id 你正在使用 maven 尝试添加这些依赖项

<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>

是Development和Weblogic版本之间的代码兼容性问题。将 WebLogic 版本降级到 10.3.6.0 解决了这个问题。