2

我正在使用 IBM Mobilefirst Platform Foundation 7.0 开发环境

我正在尝试为我的项目中的一个模块添加库hibernate-jpa-2.1-api-1.0.0.Final.jar正在使用这个库。

当我将它添加到构建路径时,MF 给了我以下错误:

[WARNING ] Exception encountered during context initialization - cancelling refresh attempt
Error creating bean with name 'ssoExpiredLoginContextsCleanupTask' defined in URL [wsjar:file:/Users/admin/Documents/Development7.0/MYAPP/MobileFirstServerConfig/shared/resources/worklight-jee-library-7.0.0.jar!/conf/core.xml]: Invocation of init method failed; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of com/ibm/ws/classloading/internal/ThreadContextClassLoader) previously initiated loading for a different type with name "javax/persistence/FlushModeType"
[ERROR   ] FWLST0003E: ========= Failed starting project /MYAPP_Mobile [project MYAPP_Mobile]
Error creating bean with name 'ssoExpiredLoginContextsCleanupTask' defined in URL [wsjar:file:/Users/admin/Documents/Development7.0/MYAPP/MobileFirstServerConfig/shared/resources/worklight-jee-library-7.0.0.jar!/conf/core.xml]: Invocation of init method failed; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of com/ibm/ws/classloading/internal/ThreadContextClassLoader) previously initiated loading for a different type with name "javax/persistence/FlushModeType"
[ERROR   ] Error creating bean with name 'ssoExpiredLoginContextsCleanupTask' defined in URL [wsjar:file:/Users/admin/Documents/Development7.0/MYAPP/MobileFirstServerConfig/shared/resources/worklight-jee-library-7.0.0.jar!/conf/core.xml]: Invocation of init method failed; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of com/ibm/ws/classloading/internal/ThreadContextClassLoader) previously initiated loading for a different type with name "javax/persistence/FlushModeType"
Error creating bean with name 'ssoExpiredLoginContextsCleanupTask' defined in URL [wsjar:file:/Users/admin/Documents/Development7.0/MYAPP/MobileFirstServerConfig/shared/resources/worklight-jee-library-7.0.0.jar!/conf/core.xml]: Invocation of init method failed; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of com/ibm/ws/classloading/internal/ThreadContextClassLoader) previously initiated loading for a different type with name "javax/persistence/FlushModeType"
[ERROR   ] MYAPP_Mobile: worklight///172.25.16.55: 2015-04-29T09:08:21.260Z: Error creating bean with name 'ssoExpiredLoginContextsCleanupTask' defined in URL [wsjar:file:/Users/admin/Documents/Development7.0/MYAPP/MobileFirstServerConfig/shared/resources/worklight-jee-library-7.0.0.jar!/conf/core.xml]: Invocation of init method failed; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of com/ibm/ws/classloading/internal/ThreadContextClassLoader) previously initiated loading for a different type with name "javax/persistence/FlushModeType"
4

3 回答 3

0

您没有在问题指定将此 .jar 文件放在哪里。也就是说,您很可能已将其添加到运行时 .war 文件中。

这肯定会产生冲突,因为 MFP 使用 openJPA,而您正在尝试添加 JPA...
因为 OpenJPA 已经在使用并且可用,所以建议您改用 OpenJPA,因为它与 Hibernate 具有相同的目的JPA。

于 2015-04-29T18:35:41.017 回答
0

你把罐子放在哪里?

如果您有多个 java 适配器,请参考同一个 jar 文件。您应该在“服务器”的“lib”文件夹中添加 jar 文件。如果您需要单个适配器的特定 jar,则应将 jar 放入 Java 适配器的“lib”文件夹中。应该注意一点,如果适配器和服务器的 lib 文件夹中都存在相同的 jar。来自适配器的 jar 将被用于构建。

于 2015-05-16T08:33:16.250 回答
0

关于这个问题有一些好消息。 APAR PI59031现在可用,它将解决在适配器中使用 Hibernate 作为 JPA 实现的问题。如果您使用的是 MobileFirst 7.0 或更高版本,请升级到 MobileFirst 7.0 的 2016-03-21 和 MobileFirst 7.1 的 2016-04-02 之后的修复级别

如果您使用的是 Studio 的 Developer Edition,则可以从Eclipse MarketPlace获得修复。如果您是获得许可的 MobileFirst 客户,则可以从FixCentral获得修复。

于 2016-04-22T19:24:03.880 回答