Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在IBM Websphere Libery服务器上运行JPA EclipseLink应用程序时出错_Java_Jpa_Eclipselink_Websphere Liberty_Open Liberty - Fatal编程技术网

Java 在IBM Websphere Libery服务器上运行JPA EclipseLink应用程序时出错

Java 在IBM Websphere Libery服务器上运行JPA EclipseLink应用程序时出错,java,jpa,eclipselink,websphere-liberty,open-liberty,Java,Jpa,Eclipselink,Websphere Liberty,Open Liberty,我一直在尝试运行一个JPA应用程序,它在ibmwebsphereliberty服务器上使用eclipselink2.5.1作为JPA提供程序 我面临以下例外情况: [ERROR ] CWWJP0015E: An error occurred in the org.eclipse.persistence.jpa.PersistenceProvider persistence provider when it attempted to create the container entity ma

我一直在尝试运行一个
JPA
应用程序,它在ibmwebsphereliberty服务器上使用
eclipselink2.5.1
作为
JPA
提供程序

我面临以下例外情况:

[ERROR   ] 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 XXXXX persistence unit. The following error occurred: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [XXXXXX] failed.
Internal Exception: Exception [EclipseLink-28006] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: ClassNotFound: [WebSphere_Liberty] specified in [eclipselink.target-server] property.
Internal Exception: java.lang.ClassNotFoundException: WebSphere_Liberty
由于我的应用程序包含自己的JPA EclipseLink JARS JAR,因此我只启用了
JPA容器-2.1

以下是我的POM.xml:

<dependency>
  <groupId>org.eclipse.persistence</groupId>
  <artifactId>eclipselink</artifactId>
</dependency>
<dependency>
  <groupId>org.eclipse.persistence</groupId>
  <artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>      
</dependency>

org.eclipse.persistence
日食
org.eclipse.persistence
org.eclipse.persistence.jpa.modelgen.processor

如果有人遇到过这种情况,请帮助我。

我自己也在设置,看来,你也必须定义一个铃声(对我来说,我正在尝试休眠,可能只是用eclipselink代替):

在server.xml中

<feature>jpaContainer-2.1</feature>
<feature>bells-1.0</feature>
.
.
.
<bell libraryRef="hibernate" />
<!-- Include all of the hibernate jars in a shared lib -->
<library id="hibernate">
   <fileset dir="${server.config.dir}/hibernate/" includes="*.jar" />
</library>
JPA容器-2.1
贝尔-1.0
.
.
.

因此,您实际上必须将这些JAR组装到正确的文件夹中,然后将钟指向libs目录。

此外,您可以在此处找到有关如何使用
jpaContainer-2.1
功能的IBM文档:我正在运行一个Maven Web应用程序,因此我的Maven已经在
Web-INF/lib/
中包含JAR。如果我仍然使用
功能,我会按照文档中的描述(参见@AndyGuibert的评论)这样做;不过,通常我会同意。但是如何启动服务器呢?是否通过mvn liberty:运行服务器?然后,应用程序路径可能会完全不同,并且这些类可能不会从使用mvn verify创建的war文件中获取。