3 Replies Latest reply on Jul 5, 2012 6:51 AM by bajrang_asthana

    Problem with PersistenceProvider

    bajrang_asthana

      Hi All,

       

      I am facing issues while deploying the .ear file in JBoss 7.1 regarding PersistenceProvider.

       

      I am getting below error-

       

      6:28:58,198 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.subunit."protectoria.ear"."app.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."protectoria.ear"."app.jar".INSTALL: Failed to process phase INSTALL of subdeployment "app.jar" of deployment "protectoria.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_21]

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

          at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]

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

            org.hibernate.ejb.HibernatePersistence

          ' 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.handleJarDeployment(PersistenceUnitDeploymentProcessor.java:145)

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

          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

       

       

      The solution which I have tried-

       

      1. I have added module dependency in jboss-deployment-structure.xml and copied the hibernate-all.jar in jboss-as-7.1.1.Final\modules\org\hibernate\main  -

       

      <dependencies>

                  <module name="javax.faces.api" slot="1.2" export="true" />

                  <module name="com.sun.jsf-impl" slot="1.2" export="true" />

                  <module name="org.hibernate" export="true" />

              </dependencies>

       

      2. I have also added the hibernate-all.jar in Ear lib directly or by the resource tag in jboss-deployment-structure.xml-

       

      <resources>

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

              </resources>

       

      But nothing is working. Please suggest.

        • 1. Re: Problem with PersistenceProvider
          wdfink

          Do you use hibernate direct?

           

          The class should be available as module 'org.hibernate'

          4.0.1 for AS7.1.1

          4.14 for current 7.x upstream

           

          So you can set that dependency.

          • 2. Re: Problem with PersistenceProvider
            bajrang_asthana

            I am using hibernate for persistence provider .

             

            see below persistence.xml-

            <persistence>

              <persistence-unit name="protectoria">

                <provider>

                  org.hibernate.ejb.HibernatePersistence

                </provider>

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

                <properties>

                  <property name="hibernate.dialect"

                      value="org.hibernate.dialect.MySQLDialect"/>

                  <!-- <property name="hibernate.hbm2ddl.auto"

                      value="create-drop"/>-->

                  <property name="hibernate.show_sql" value="false"/>

                  <property name="hibernate.format_sql" value="true" />

                  <property name="hibernate.use_sql_comments" value="true" />

                </properties>

              </persistence-unit>

            </persistence>

            Actually I am migrating Seam project from JBoss AS 4.2 to 7.1.

             

            I have added the dependency but still I am getting the same error

             

            Please see below "jboss-deployment-structure.xml"-

             

            <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">

                <ear-subdeployments-isolated>true</ear-subdeployments-isolated>

                <deployment>

                    <dependencies>

                        <module name="javax.faces.api" slot="1.2" export="true" />

                        <module name="com.sun.jsf-impl" slot="1.2" export="true" />

                        <module name="org.hibernate"  slot="main" export="true" />

                    </dependencies>

             

                </deployment>

                <sub-deployment name="app.jar">

                    <exclusions>

                        <module name="javax.faces.api" slot="main" />

                        <module name="com.sun.jsf-impl" slot="main" />

                    </exclusions>

                </sub-deployment>

                <sub-deployment name="app.war">

                    <exclusions>

                        <module name="javax.faces.api" slot="main" />

                        <module name="com.sun.jsf-impl" slot="main" />

                    </exclusions>

                    <dependencies>

                        <module name="javax.faces.api" slot="1.2" />

                        <module name="com.sun.jsf-impl" slot="1.2" />

                    </dependencies>

                </sub-deployment>

            </jboss-deployment-structure>

             

            Is there any way to solve this problem ?

            • 3. Re: Problem with PersistenceProvider
              bajrang_asthana

              I have also tryied to copy the jars of org/hibernate/main in ear's lib. But still, problem is there.