PersistenceUnit [appcenterdb-oracle] 的预部署失败

Predeployment of PersistenceUnit [appcenterdb-oracle] failed

我在我的 RHEL 6 上安装了以下软件 (1) MFP63 (2) MySQL56
(3) 是 8.5.5.6

并尝试设置我的第一个移动优先项目,但 'messages.log' 出现以下错误

I FFDC1015I: An FFDC Incident has been created: "javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.0.WAS-v20150513-26196d2): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [appcenterdb-oracle] failed.
Internal Exception: Exception [EclipseLink-7157] (Eclipse Persistence Services - 2.6.0.WAS-v20150513-26196d2): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Entity class [class com.ibm.puremeap.jpa.entity.PushBatchDeviceEntity] must use a @JoinColumn instead of @Column to map its relationship attribute [device]. com.ibm.ws.jpa.management.JPAPUnitInfo.createEMFactory 759" at ffdc_15.07.27_21.00.27.0.log
[7/27/15 21:00:27:238 IST] 00000068 com.ibm.ws.jpa.management.JPAPUnitInfo                       E CWWJP0015E: An error occurred in the org.eclipse.persistence.jpa.PersistenceProvider persistence provider when it attempted to create the container entity manager factory for the appcenterdb-oracle persistence unit. The following error occurred: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.0.WAS-v20150513-26196d2): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [appcenterdb-oracle] failed.
Internal Exception: Exception [EclipseLink-7157] (Eclipse Persistence Services - 2.6.0.WAS-v20150513-26196d2): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Entity class [class com.ibm.puremeap.jpa.entity.PushBatchDeviceEntity] must use a @JoinColumn instead of @Column to map its relationship attribute [device].

消息说 'Predeployment of PersistenceUnit [appcenterdb-oracle] failed' 但我使用的是 'MySQL' 而不是 'oracle' 这让我有点困惑

我正在使用 Java 8(使用 JDK6 和 7 我遇到了其他问题)

http://pastebin.com/WcWBUjVn (server.xml) http://pastebin.com/QzByZ63T (messages.log)

谢谢 萨西什·库马尔

@Sathish,在你上传的server.xml中,我可以看到那些特征

<feature>javaee-7.0</feature>
  <feature>servlet-3.1</feature>
  <feature>jdbc-4.1</feature>

MobileFirst Ant 任务或服务器配置工具未安装最后两个功能。 这让我认为您在安装过程后手动更改了它们,因为您使用的是不受支持的 Liberty 配置文件风格,例如 WAS Liberty V8.5.5.6 with Java EE 7 Web ProfileWAS Liberty V8.5.5.6 with Java EE 7 Full Platform 它不提供预期的功能 servlet-3.0 和 jdbc-4.0 而是 servlet-3.1 和 jdbc-4.1.

实际上,MFP 6.3 仅支持 MFP 6.3 仅支持 WebSphere Application Server Liberty Core http://www-969.ibm.com/software/reports/compatibility/clarity-reports/report/html/prereqsForProduct?deliverableId=1404132386734#! 其中包含

您可以从 FixCentral 网站获取它
http://www-933.ibm.com/support/fixcentral/

在 Select 产品选项卡上,选择
产品组:WebSphere
Select 来自 WebSphere:WebSphere Application Server
安装版本:8.5.5.6
平台:全部
然后select
单个修复 ID:wlp-core-runtime-8.5.5.6

一共三期:

  1. 您将 Java 8 与不支持它的 MobileFirst Foundation 版本一起使用。 system requirements of MobileFirst Foundation 7.0 表示仅支持 Java 6 和 Java 7。症状出现在您的第一个 messages.log 中:它是例外 java.lang.IllegalStateException: Context namespace element 'annotation-config' and its parser class [org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser] are only available on JDK 1.5 and higher

  2. 您的 server.xml 包含两个元素 <application id="worklightconsole" name="worklightconsole" location="worklightconsole.war" type="war">。也就是说,您有两个具有相同 ID、相同名称和相同上下文根的 Web 应用程序。这永远行不通。原因显然是您将 worklightconsole.war 作为参数传递给 。相反,如 Deploying the project WAR file 中所述,您指定的 WAR 文件应该是一个 MobileFirst 项目 WAR 文件,通过 MobileFirst Studio 或 Ant 构建任务.

  3. 第二个 messages.log 文件包含日志消息

    FWLSE2008I: MBean registration succeeded for: com.worklight.common.server.jmx.api:type=WorklightAdmin,qualifier=worklightadmin
    FWLSE2008I: MBean registration succeeded for: com.worklight.common.server.jmx.api:type=ProjectManagement_simpleServer,qualifier=worklightconsole [project worklightconsole]
    
    第一个显示空环境 ID,而第二个显示环境 ID "simpleServer"。此环境 ID 在 server.xml 文件中也可见:
    <jndiEntry jndiName="worklightconsole/ibm.worklight.admin.environmentid" value='"simpleServer"'/>
    但是根据 documentation of <configureApplicationServer>,您应该在两种情况下传递相同的环境 ID 值。

正如 'slowhand' 所说,问题出在 'server.xml' 因为多个 'application id' 同名

似乎 'ant' 任务没有正确生成所有标签,我做了一些小的修正以使其工作

谢谢 萨西什·库马尔