1 Reply Latest reply on Nov 2, 2016 6:19 AM by Panagiotis Chavariotis

    openJPA not working

    Rick Coup Newbie

      I am migrating from WAS8.5.5 to JBoss EAP6.4.

      I got an error message as

      12:03:14,362 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."en_uitemplate.ear". FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."en_uitemplate.ear".FIRST_MODULE_USE: JBAS018733: Failed to pr ocess phase FIRST_MODULE_USE of deployment "en_uitemplate.ear" at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [jboss-as-server-7.5.0.Final-redhat-21.jar:7. 5.0.Final-redhat-21] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Fina l-redhat-1] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat- 1] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.8.0_101] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.8.0_101] at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_101] Caused by: javax.persistence.PersistenceException: JBAS011466: PersistenceProvider ' org.apache.openjpa.persistence.PersistenceProviderImpl ' not found at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.lookupProvider(PersistenceUnitServiceHandler.java:619) at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deployPersistenceUnit(PersistenceUnitServiceHandler.java:317) at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.addPuService(PersistenceUnitServiceHandler.java:279) at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.handleEarDeployment(PersistenceUnitServiceHandler.java:216) at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:118) at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:48) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [jboss-as-server-7.5.0.Final-redhat-21.jar:7. 5.0.Final-redhat-21]

      I created directory as

      C:\Applications\jboss64\jboss-eap-6.4\modules\system\layers\base\org\apache\openjpa\main

      I put the openjpa-2.4.1.jar and serp-1.13.1.jar into it along with the module.xml.

      <?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.1" name="org.apache.openjpa"> <resources> <resource-root path="openjpa-2.4.1.jar"/> <resource-root path="serp-1.13.1.jar"/> <!-- Insert resources here --> </resources> <dependencies> <module name="javax.persistence.api"/> <module name="javax.transaction.api"/> <module name="javax.validation.api"/> <module name="org.apache.commons.lang"/> <module name="org.apache.commons.collections"/> <module name="org.apache.log4j"/> </dependencies>

       

      I have my persistence.xml as

      <?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="csxstartershowcaseEJB" transaction-type="JTA"> <provider> org.apache.openjpa.persistence.PersistenceProviderImpl </provider> <properties> <property name="jboss.as.jpa.providerModule" value="org.apache.openjpa" /> <property name="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=TRACE"/> <property name="openjpa.RuntimeUnenhancedClasses" value="supported" /> <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.EmbeddedDriver"/> <property name="openjpa.jdbc.Schema" value="APP" /> <property name="javax.persistence.jdbc.url" value="jdbc:derby:CSXSampleDatabase;create=true"/> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/> <property name="openjpa.MetaDataFactory" value="jpa"/> </properties> </persistence-unit>

       

      According to the post https://developer.jboss.org/thread/222893, I also added the below dependency to my EJB and EJBClient project's pom.xml. but I am still getting the same error.

      <!-- JPA --> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-ee</artifactId> <version>7.5.0.Final-redhat-21</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-ejb3</artifactId> <version>7.1.1.Final</version> <scope>provided</scope> </dependency>   

      This is related the message "org.apache.openjpa.persistence.PersistenceProviderImpl ' not found". Any advice?