2 Replies Latest reply on Apr 5, 2013 4:34 AM by jagdish kumar

    JBAS011466: PersistenceProvider org.apache.openjpa.persistence.PersistenceProviderImpl openjpa2 on jboss7.1.1Final

    jagdish kumar Newbie

      Hi

      I have spent now 2 weeks on resolving this issue and to no avail.  I must be doing something really silly.

       

      My peristence.xml is under project

       

      MODEL/src/main/resources/META-INF/persistence.xml

      also has

      src/main/java/com.jkconsulting.dto.ContactUs.java

       

      <?xml version="1.0"?>

      <persistence>

          <persistence-unit name="jkconsultingjpa" transaction-type="RESOURCE_LOCAL">

             <provider>

                  org.apache.openjpa.persistence.PersistenceProviderImpl

              </provider>

              <class>com.jkconsulting.dto.ContactUs</class>

              <properties>

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

                                    <property name="openjpa.DynamicEnhancementAgent" value="false"/>        

                          <property name="openjpa.RuntimeUnenhancedClasses" value="supported" />

       

                  <property name="openjpa.ConnectionURL"          value="jdbc:mysql://localhost:3306/jkconsulting"/>

                  <property name="openjpa.ConnectionDriverName"   value="com.mysql.jdbc.Driver"/>

                  <property name="openjpa.ConnectionUserName" value="jkconsulting"/>

                  <property name="openjpa.ConnectionPassword" value="xxxxx"/>

                                       <property name="openjpa.Log" value="SQL=TRACE"/>

                  <property name="openjpa.DynamicEnhancementAgent" value="false"/>

                  <property name="openjpa.RuntimeUnenhancedClasses" value="supported" />

              </properties>

          </persistence-unit>

      </persistence>

       

       

      I have setup a module under

      JBOSS_HOME/modules/org/apache/openjpa/main

       

      and my module.xml is

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

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

          </resources>

              <dependencies>

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

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

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

                  <module name="javax.api"/>

              </dependencies>

      </module>

       

      and the jars are there under main folder.

       

      Still i'm faicing the following issue:

       

      11:29:55,703 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "service-1.0.0.war"

      11:29:56,827 INFO  [org.jboss.as.jpa] (MSC service thread 1-1) JBAS011401: Read persistence.xml for jkconsultingjpa

      11:29:57,249 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named ContactUsController in deployment unit subdeployment "service-1.0.0.war" of deployment "jkconsulting-1.1.0.ear" are as follows:

       

       

                java:global/jkconsulting-1.1.0/service-1.0.0/ContactUsController!com.jkconsulting.controllers.ContactUsController

                java:app/service-1.0.0/ContactUsController!com.jkconsulting.controllers.ContactUsController

                java:module/ContactUsController!com.jkconsulting.controllers.ContactUsController

                java:global/jkconsulting-1.1.0/service-1.0.0/ContactUsController

                java:app/service-1.0.0/ContactUsController

                java:module/ContactUsController

       

       

      11:29:57,255 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named ContactUsDao in deployment unit subdeployment "service-1.0.0.war" of deployment "jkconsulting-1.1.0.ear" are as follows:

       

       

                java:global/jkconsulting-1.1.0/service-1.0.0/ContactUsDao!com.jkconsulting.dao.ContactUsDaoLocal

                java:app/service-1.0.0/ContactUsDao!com.jkconsulting.dao.ContactUsDaoLocal

                java:module/ContactUsDao!com.jkconsulting.dao.ContactUsDaoLocal

                java:global/jkconsulting-1.1.0/service-1.0.0/ContactUsDao

                java:app/service-1.0.0/ContactUsDao

                java:module/ContactUsDao

       

       

      11:29:57,753 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.subunit."jkconsulting-1.1.0.ear"."service-1.0.0.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."jkconsulting-1.1.0.ear"."service-1.0.0.war".INSTALL: Failed to process phase INSTALL of subdeployment "service-1.0.0.war" of deployment "jkconsulting-1.1.0.ear"

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_31]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_31]

                at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_31]

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

                  org.apache.openjpa.persistence.PersistenceProviderImpl

              ' not found

                at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.lookupProvider(PersistenceUnitDeploymentProcessor.java:555)

                at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deployPersistenceUnit(PersistenceUnitDeploymentProcessor.java:295)

                at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuService(PersistenceUnitDeploymentProcessor.java:258)

                at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.handleWarDeployment(PersistenceUnitDeploymentProcessor.java:194)

                at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deploy(PersistenceUnitDeploymentProcessor.java:118)

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                ... 5 more

       

      I have followed almost every googled results for this issue and still could not resovle this.

       

      I would appreciate if anyone was able to solve this issue and give me some directions.

       

       

      thanks in advance!!

       

       

      jagdish

        • 1. Re: JBAS011466: PersistenceProvider org.apache.openjpa.persistence.PersistenceProviderImpl openjpa2 on jboss7.1.1Final
          Scott Marlow Master

          Could you try again with the EAP alpha built from AS7http://www.jboss.org/jbossas/downloads.htmlwhich has a release date of 2013-03-07 (its been a while since AS 7.1.1 was released).  If something newer shows up on that page, use that instead. 

          • 2. Re: JBAS011466: PersistenceProvider org.apache.openjpa.persistence.PersistenceProviderImpl openjpa2 on jboss7.1.1Final
            jagdish kumar Newbie

            Hi Scott

            First of all thanks for your promt reply very much appreciated.  I'm loging back after a long time, this time with a big smile as i was able to crack it.  I tried with the latest AS7 server but it didn't help.

             

            However after weeks of effort i finally managed to crack it.    I'm using jboss-7.1.1.FINAL AS version.  And i tried to use the same hibernate jars for my project.

             

            I have included the following two dependencies in my project.

             


            <dependency>


            <groupId>org.jboss.as</groupId>


            <artifactId>jboss-as-ee</artifactId>


            <version>7.1.1.Final</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>

             

            And took out all other dependencies.  My peristence.xml is placed under

             

            /scr/main/resources/META-INF for the project where my public class GenericDaoHibernateJpaImpl<T, PK> implements GenericDao<T, PK> {}  is there.

             

            And now @EJB injection as well


            @PersistenceContext(unitName = "jkconsultingjpa")

            private EntityManager entityManager;

             

            injection works fine.  

             

            I tried using openjpa earlier and I would suggest that its much easier to use HibernateJpa shipped with JBoss7.1.1 than openjpa provider.   Even though i would have liked to make OpenJpa work as it would allow me to easily port it to another AS.

             

            Thanks

            Jagdish