5 Replies Latest reply on Dec 5, 2012 4:00 PM by Sadiroveski S

    JBPM5 in a Web Application

    Sadiroveski S Newbie

      Dear Helpers,

       

      We are trying to use jbpm5 in our web application. But when i tried to deploy this web application on jboss servers it fails to deploy. I have tried to give attached persistance.xml files in the class path.


      Error is same for both file one is for jpa 1.0 and second is one jpa 2.0.


      When I tried to deploy on jboss jboss-as-7.1.1.Final or jboss-as-7.0.0.Final. After coping war file in deployments directory when I start application server its thorough given below error.


      org.jboss.msc.service.DuplicateServiceException: Service jboss.persistenceunit."bpm-test.war#org.jbpm.persistence.jpa" is already registered


      When I deploy on jboss 5 or jboss 6. I also need to copy jBPM-ds.xml file in the path.

      but after deployment it throws exception as given below.



      DEPLOYMENTS IN ERROR:
        Deployment "persistence.unit:unitName=#org.jbpm.persistence.jpa" is in error due to the following reason(s): java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence cannot be cast to javax.persistence.spi.PersistenceProvider
          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1002)
          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:948)

      Please help us in this regard. Error is same for both files. For your reference sample code is attached. libraries are not included. which are same copied from jbpm 5.3 runtime\lib.

       

      Your help is highly appreciated,

        • 1. Re: JBPM5 in a Web Application
          Mauricio Salatino Master

          Can you try with 5.4.0.Final, which is the latest release?

          • 2. Re: JBPM5 in a Web Application
            Naeem Jamil Newbie

            Giving same error on jbpm 5.4.0.

             

            16:45:36,443 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."bpm-test.war".INSTALL: org.jboss.msc.service.StartException

                    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: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011446: Failed to add persistence unit service for org.jbpm.persistence.jpa

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

                    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

            Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.persistenceunit."bpm-test.war#org.jbpm.persistence.jpa" is already registered

                    at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:154) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                    at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:227) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                    at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:560) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                    at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                    at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                    at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

             

            When I deploy on jboss 7.x. I always remove jbpm-ds.xml file still it is giving error Service jboss.persistenceunit."bpm-test.war#org.jbpm.persistence.jpa" is already registered

            • 3. Re: JBPM5 in a Web Application
              Mauricio Salatino Master

              That's because you have multiple persistnece.xml defining a PU called org.jbpm.persistence.jpa, can you check that pleasE?

              • 4. Re: JBPM5 in a Web Application
                Naeem Jamil Newbie

                Thanks for your kind reply.

                 

                In my project src\MATA-INF folder I have only one persistance.xml file.  May be any other exist in any jar file.

                • 5. Re: JBPM5 in a Web Application
                  Sadiroveski S Newbie

                  Hello Mauricio,

                  Thanks for your reply. Mr. Ted Pan instructed us to remove ""jbpm-test*.jar""

                  But there is another error where it seems to be common with many people which is as follows:

                  service jboss.jdbc-driver.mysql (missing) dependents: [service jboss.data-source.java:/jboss/datasources/ProcessEngineDS]


                   

                  standalone.xml is updated and also copied driver jar in application lib.


                  datasource entry in standalone,xml file is given below.

                  <datasources>

                                  <datasource jndi-name="java:/jboss/datasources/ProcessEngineDS" pool-name="MySQLDS" enabled="true" use-java-context="true">

                                      <connection-url>jdbc:mysql://localhost:3306/jbpm5</connection-url>

                                      <driver>mysql</driver>

                                      <pool></pool>

                                      <security>

                                         <user-name>jbpm5</user-name>

                                         <password>jbpm5</password>

                                      </security>

                                  </datasource>

                                  <drivers>

                                      <driver name="mysql" module="com.mysql">

                                          <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>

                                      </driver>

                                  </drivers>

                              </datasources>

                   

                   

                   

                  Thanks in advance for you and for Mr. Ted.