【问题标题】:IBM Mobileplatform foundation 7.0 error in log: Failed starting project日志中的 IBM Mobileplatform Foundation 7.0 错误:启动项目失败
【发布时间】:2015-07-08 11:20:45
【问题描述】:

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

【问题讨论】:

  • 你在项目的什么地方添加这个文件?添加复制步骤。如果您将此 .jar 文件放在 Java 适配器的文件夹中,它应该可以工作。如果您将其放在其他位置,则会导致平台使用的服务器提供的 .jar 文件出现问题。

标签: java hibernate jpa ibm-mobilefirst mobilefirst-studio


【解决方案1】:

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

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

【讨论】:

  • 我们如何识别正在使用的 OpenJPA.jar MFP v7.0 版本
  • 使用的版本是OpenJPA v1.x
  • 如何在适配器以及身份验证的子类中使用open JPA?
【解决方案2】:

你把罐子放在哪里?

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

【讨论】:

    【解决方案3】:

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

    如果您使用的是 Studio 开发人员版,则可以从 Eclipse MarketPlace 获得修复。如果您是获得许可的 MobileFirst 客户,可以从 FixCentral 获得修复。

    【讨论】:

      猜你喜欢
      • 2019-04-21
      • 2013-09-29
      • 2017-02-11
      • 2015-07-07
      • 1970-01-01
      • 2012-08-05
      • 1970-01-01
      • 2021-10-17
      • 2017-05-28
      相关资源
      最近更新 更多