我正在使用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"
答案 0 :(得分:0)
你把罐子放在哪里?
如果您有多个Java适配器,请参考相同的jar文件。你应该在' lib'中添加jar文件。 '服务器'的文件夹。 如果您需要特定的jar适用于单个适配器,您应该将jar放入' lib'你的java适配器的文件夹。 应该注意的是,如果适配器和服务器的lib文件夹中都存在相同的jar。来自适配器的jar将被用于构建。
答案 1 :(得分:0)
关于这个问题有一些好消息。 APAR PI59031现在可用于解决在适配器中使用Hibernate作为JPA实现的问题。如果您使用的是MobileFirst 7.0或更高版本,请升级到2016-03-21之后的MobileFirst 7.0和2016-04-02 for MobileFirst 7.1的修订级别
如果您使用的是Studio Edition,则可以从Eclipse MarketPlace获取修复程序。如果您是获得许可的MobileFirst客户,则可以从FixCentral获取修复程序。