1

I have been trying to run a JPA application which uses EclipseLink 2.5.1 as a JPA provider on IBM Websphere Liberty Server.

I am facing following exception:

[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

Since my application contains its own JPA EclipseLink JARS jars, I have only enabled <feature>jpaContainer-2.1</feature>

Here is my 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>

Please help me if anyone ever faced this scenario.

1 Answer 1

1

I'm just in the process of setting this up myself, it appears, you have to define a bell, too (for me, I'm trying hibernate, probably just replace by eclipselink):

in 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>

So, you actually have to assemble these jars into the correct folder, and then point your bell to the libs dir.

3
  • Additionally, you can find IBM documentation on how to use the jpaContainer-2.1 feature here: ibm.com/support/knowledgecenter/en/SS7K4U_liberty/… Commented Jan 22, 2018 at 14:16
  • I am running a Maven, Web application, so my Maven is already including the jars in WEB-INF/lib/. Should I still use <bell> feature?? Commented Jan 23, 2018 at 4:51
  • I'd just do it, as described in the documentation (see @AndyGuibert 's comment); usually I'd agree, though. BUT how do you start the server? Is it via mvn liberty:run-server? Then the application path might be completely different, and the classes are probably not picked up from the war file you create with mvn verify.
    – Frischling
    Commented Jan 23, 2018 at 15:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.