2 Replies Latest reply on Jun 11, 2018 8:56 AM by Anup Dey

    persistence.xml

    palanivel .k Newbie

      ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."test.ear".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."test.ear".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "test.ear"

      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)

      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

      at java.lang.Thread.run(Thread.java:748)

      Caused by: javax.persistence.PersistenceException: WFLYJPA0057: PersistenceProvider '

                  org.apache.openjpa.persistence.PersistenceProviderImpl

              ' not found

      at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.lookupProvider(PersistenceUnitServiceHandler.java:1009)

      at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.addPuService(PersistenceUnitServiceHandler.java:270)

      at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.handleEarDeployment(PersistenceUnitServiceHandler.java:225)

      at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:132)

      at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:52)

      at org.jboss.

        • 1. Re: persistence.xml
          Wolfgang Mayer Master

          Did you configure your openJPA as described in JPA Reference Guide - WildFly 8 - Project Documentation Editor

          You should also exclude the  path="javax/**" to avoid the org.apache.openjpa.persistence.PersistenceProviderImpl not a subtype" message.

           

          my module.xml looks like this:

           

          <module name="org.apache.openjpa" xmlns="urn:jboss:module:1.5">

              <properties>

                  <property name="jboss.api" value="public"/>

              </properties>

           

              <resources>

                  <artifact name="org.wildfly:jipijapa-openjpa:12.0.0.Final"/>

                  <resource-root path="openjpa-all-2.4.2.jar">

                     <filter>

                        <exclude path="javax/**" />

                     </filter>

                  </resource-root>

                  <resource-root path="serp-1.15.1.jar"/>

              </resources>

           

              <dependencies>

                  <module name="javax.api"/>

                  <module name="javax.annotation.api"/>

                  <module name="javax.enterprise.api"/>

                  <module name="javax.persistence.api"/>

                  <module name="javax.transaction.api"/>

                  <module name="javax.validation.api"/>

                  <module name="javax.xml.bind.api"/>

                  <module name="org.apache.commons.collections"/>

                  <module name="org.apache.commons.lang"/>

                  <module name="org.jboss.as.jpa.spi"/>

                  <module name="org.jboss.logging"/>

                  <module name="org.jboss.vfs"/>

                  <module name="org.jboss.jandex"/>

                  </dependencies>

          </module>

          • 2. Re: persistence.xml
            Anup Dey Expert

            Create persistence.xml, define name of provider "org.apache.openjpa.persistence.PersistenceProviderImpl" and add jboss.as.jpa.providerModule property to org.apache.openjpa

             

            <?xml version="1.0" encoding="UTF-8"?>

            <persistence version="1.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_1_0.xsd">

              <persistence-unit name="EJBPersistencePU" transaction-type="JTA">

                <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>

                <jta-data-source>java:/testDS</jta-data-source>

                <exclude-unlisted-classes>false</exclude-unlisted-classes>

             

                <properties>

                         <property name="jboss.as.jpa.providerModule" value="org.apache.openjpa" />

                </properties>

             

              </persistence-unit>

            </persistence>

             

            1. Create two modules named as org.apache.openjpa and org.jboss.as.jpa.openjpa

            org.jboss.as.jpa.openjpa:

            <?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.2.0.Final.jar"/>

                </resources>

             

             

                <dependencies>

                    <module name="javax.ejb.api"/>

                    <module name="javax.persistence.api"/>

                    <module name="javax.transaction.api"/>

                    <module name="javax.validation.api"/>

                    <module name="org.apache.log4j"/>

                <module name="org.apache.commons.lang"/> 

                    <module name="org.jboss.as.naming"/>

                    <module name="org.jboss.as.server"/>

                    <module name="org.jboss.jandex"/>

                    <module name="org.jboss.logging"/>

                    <module name="org.jboss.msc"/>

                    <module name="org.jboss.as.jpa.spi"/>

            <module name="org.apache.openjpa" optional="true"/>

             

             

                </dependencies>

            </module>

             

            Note: Download jboss-as-jpa-openjpa-7.2.0.Final.jar from http://mvnrepository.com/artifact/org.jboss.as/jboss-as-jpa-openjpa/7.2.0.Final

             

            org.apache.openjpa:

             

            <?xml version="1.0" encoding="UTF-8"?>

            <module xmlns="urn:jboss:module:1.1" name="org.apache.openjpa">

                <resources>

                    <resource-root path="openjpa-all-2.2.2.jar"/>

                    <resource-root path="serp-1.14.1.jar"/>

                </resources>

             

             

                <dependencies>

             

             

                    <module name="javax.persistence.api"/>

                    <module name="javax.transaction.api"/>

                    <module name="javax.validation.api"/>

             

             

                </dependencies>

            </module>