WAS Liberty 8.5.5.4, JPA 2.0 - discovered implementations: NONE

775 views Asked by At

I was able to get JPA working with eclipse Luna and installing eclipseLink (and created a User Lib with the 3 jars).

However, I have now moved to Rational Application Developer (RAD) and attempting to use the JPA that is delivered with WAS Liberty. I initially used RAD JPA facet to configure JPA and then edited persistence.xml.

I am getting this error: Caused by: javax.persistence.PersistenceException: No persistence providers available for "test2" after trying the following discovered implementations: NONE

I assume (always dangerous) the NONE is a configuration error and I cannot do anything until that is resolved...

I have copied the wlp\dev\api\spec\com.ibm.ws.javaee.persistence.2.0_1.0.1.jar into WEB-INF/lib and included that in my java build path.

As you can see below, I was guessing my provider was not correct, and tried several values...

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence     http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="test2" transaction-type="RESOURCE_LOCAL">
    <!-- provider>org.eclipse.persistence.jpa.PersistenceProvider</provider-->
    <!-- provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider-->
    <provider>com.ibm.websphere.persistence.PersistenceProviderImpl</provider>
    <non-jta-data-source>java:comp/env/New Generic JDBC</non-jta-data-source>
    <class>com.ibm.analytics.jpa.Dimtask</class>
    <properties>
        <property name="openjpa.jdbc.Schema" value="RM"/>
        <property name="javax.persistence.jdbc.url" value="jdbc:netezza://netezza-1.site.ibm.com:5480/DATABASENAME"/>
        <property name="javax.persistence.jdbc.user" value="jspoon"/>
        <property name="javax.persistence.jdbc.password" value="xxxxxxx"/>
        <property name="javax.persistence.jdbc.driver" value="org.netezza.Driver"/>
    </properties>
</persistence-unit>
</persistence>

What else can I do to get past the NONE?

Here is the updated version of persistence.xml, I just commented out the provider.

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="test2" transaction-type="RESOURCE_LOCAL">
    <!-- provider>org.eclipse.persistence.jpa.PersistenceProvider</provider-->
    <!-- provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider-->
    <!-- provider>com.ibm.websphere.persistence.PersistenceProviderImpl</provider-->
    <non-jta-data-source>java:comp/env/New Generic JDBC</non-jta-data-source>
    <class>com.ibm.analytics.jpa.Dimtask</class>
    <properties>
        <property name="openjpa.jdbc.Schema" value="RM"/>
        <property name="javax.persistence.jdbc.url" value="jdbc:netezza://netezza-1.boulder.ibm.com:5480/BACC_TST_ISHANGO_DW"/>
        <property name="javax.persistence.jdbc.user" value="jspoon"/>
        <property name="javax.persistence.jdbc.password" value="C0ke4y0u"/>
        <property name="javax.persistence.jdbc.driver" value="org.netezza.Driver"/>
    </properties>
</persistence-unit>
</persistence>

I created my Entity class using JPA Tooling, and using a simple junit test to call a named query. The first step is to create the EMF and it is a static in my class (so none of the test is actually running, it is failing at instantiation creating the static variable):

static EntityManagerFactory emf = Persistence.createEntityManagerFactory( "test2" );

This is the exact same code as used before with eclipse and eclipseLink.

0

There are 0 answers