Wednesday, May 6, 2015

JBoss EPA 6.1 : javax.persistence.PersistenceException PersistenceProvider in org.apache.openjpa.persistence.PersistenceProviderImpl not found

This is an issue I was having few weeks back and solved by creating a module inside the JBoss EPA. The issue came because of missing a class which should be available inside the EPA, and raised the above exception during the deployment. I’m still hesitating about the root cause, whether this requirement came with a Spring dependency I had or due to MS SQL Server driver I used. Somehow I managed to solve this issue by creating an OpenJPA module inside the JBOSS_HOME>\modules\org\apache\openjpa directory.
First of all we need to download the OpenJPA from this link. Then extract the content to above mentioned directory and the create the module.xml file as follows.

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.jboss.as.jpa.openjpa">
    <properties>
        <property name="jboss.api" value="private"/>
    </properties>
    <resources>
        <resource-root path="jboss-as-jpa-openjpa-7.1.1.Final.jar"/>
    </resources>
    <dependencies>
        <module name="javax.annotation.api"/>
        <module name="javax.persistence.api"/>
        <module name="javax.transaction.api"/>
        <module name="org.jboss.as.jpa.spi"/>
        <module name="org.jboss.logging"/>
        <module name="org.jboss.jandex"/>
        <module name="org.apache.openjpa" optional="true"/>
    </dependencies>

</module>

No comments:

Post a Comment