JBoss Community

Can't find persistence unit org.jbpm.domain in jbpm-console.war while setting up jBPM 6.0 Beta2 to use MySQL

created by Samuele Mezzasalma in jBPM - View the full discussion

Hi everybody.

I'm a complete newbie for what concern business processes and jBPM so I ask for help.

I installed jBPM 6.0 Beta2 full installer but it's almost two weeks that I'm trying to set up jBPM 6.0 Beta2 to use MySQL and I haven't come up with anything.

I followed this 5.4 guide Set up jBPM 5.4 Final Installer to use MySQL - or how to run section 3.7 of the User Guide but it didn't seem to work for me.

I closely followed these four steps:

 

1)Set up MySQL

    

mysql> CREATE SCHEMA IF NOT EXISTS jbpm5;
          mysql> CREATE USER 'jbmp5'@'localhost' IDENTIFIED BY 'jbpm5';
          mysql> GRANT ALL PRIVILEGES ON jbpm5.* TO 'jbpm5'@'localhost';
  
          mysql> CREATE SCHEMA IF NOT EXISTS task;
          mysql> CREATE USER 'task'@'localhost' IDENTIFIED BY 'task';
          mysql> GRANT ALL PRIVILEGES ON task.* TO 'task'@'localhost;

 

2)Set up jBPM
 
          build.properties
          # data base related properties

 

         db.driver.jar=${install.home}/db/driver/${db.driver.jar.name}
          db.driver.module.dir=${jboss.home}/modules/${db.driver.module.prefix}/main/
          #  default is H2
          #  db.name=h2
          #  db.driver.jar.name=${db.name}.jar
          #  db.driver.download.url=http://repo1.maven.org/maven2/com/h2database/h2/${H2.version}/h2-${H2.version}.jar
          #other options are mysql
  db.name=mysql
  db.driver.module.prefix=com/mysql
  db.driver.jar.name=${db.name}-connector-java.jar
  db.driver.download.url=https://repository.jboss.org/nexus/service/local/repositories/central/content/mysql/mysql-connector-java/5.1.18/mysql-connector-java-5.1.18.
  build.xml

 

<!-- Start Demo (DB) -->
          <target name="start.demo.db" depends="start.jboss, start.eclipse" />
          <!-- Start Demo (DB, No Eclipse) -->
          <target name="start.demo.db.noeclipse" depends="start.jboss" />
          <!-- Stop Demo (DB)-->
          <target name="stop.demo.db" depends="stop.jboss" />

 

          db/jbpm-persistence-JPA2.xml
          <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />

 

          db/task-persistence-JPA2.xml
          <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

 

          standalone.xml
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
                    <connection-url>jdbc:mysql://localhost:3306/task</connection-url>
                    <driver>mysql</driver>
                    <security>
                        <user-name>task</user-name>
                        <password>task</password>
                    </security>
                                                                                </datasource>
                <datasource jta="true" jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" use-java-context="true" use-ccm="true">
                    <connection-url>jdbc:mysql://localhost:3306/jbpm6</connection-url>
                    <driver>mysql</driver>
                    <pool>
                        <min-pool-size>1</min-pool-size>
                        <max-pool-size>4</max-pool-size>
                        <prefill>false</prefill>
                        <use-strict-min>false</use-strict-min>
                        <flush-strategy>FailingConnectionOnly</flush-strategy>
                    </pool>
                    <security>
                        <user-name>jbpm6</user-name>
                              <password>jbpm6</password>
                    </security>
                    <validation>
                        <check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
                        <validate-on-match>false</validate-on-match>
                        <background-validation>false</background-validation>
                    </validation>
                </datasource>
                <datasource jta="true" jndi-name="java:jboss/datasources/BamAppDS" pool-name="BamAppDS" enabled="true" use-java-context="true" use-ccm="true">
                    <connection-url>jdbc:mysql://localhost:3306/jbpm6</connection-url>
                    <driver>mysql</driver>
                    <pool>
                        <min-pool-size>1</min-pool-size>
                        <max-pool-size>4</max-pool-size>
                        <prefill>false</prefill>
                        <use-strict-min>false</use-strict-min>
                        <flush-strategy>FailingConnectionOnly</flush-strategy>
                    </pool>
                    <security>
                        <user-name>jbpm6</user-name>
                        <password>jbpm6</password>
                    </security>
                    <validation>
                        <check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
                        <validate-on-match>false</validate-on-match>
                        <background-validation>false</background-validation>
                    </validation>
                </datasource>
                <drivers>
                    <driver name="mysql" module="com.mysql">
                        <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
                    </driver>
                </drivers>
     task-service/resources/META-INF/persistence.xml

    

<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
          <property name="hibernate.connection.driver_class" value="org.jdbc.Driver"/>
          <property name="hibernate.connection.url" value="jdbc:mysql:://localhost:3306/task" />
          <property name="hibernate.connection.username" value="task"/>
          <property name="hibernate.connection.password" value="task"/>
          <property name="hibernate.connection.autocommit" value="false" />
          <property name="hibernate.max_fetch_depth" value="3"/>
          <property name="hibernate.hbm2ddl.auto" value="create" />
          <property name="hibernate.show_sql" value="false" />

          lib/jbpm-console-6.0.0.Beta2.war/WEB-INF/classes/META-INF/persistence.xml

    

<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLialect" />
                    <property name="hibernate.max_fetch_depth" value="3" />
                    <property name="hibernate.hbm2ddl.auto" value="update" />
                    <property name="hibernate.show_sql" value="false" />
  
          <!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->
                    <property name="hibernate.id.new_generator_mappings" value="false" />
                    <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" />
  
          </properties>

 

3)Install jBPM
          ant install.demo.noeclipse
4)Run the demo
          ant start.demo.db.noeclipse

 

I attach to this post all modified files, server.log and jbpm-console.war log.

 

jbpm-console.war.failed
{"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"jbpm-console.war\".WeldService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"jbpm-console.war\".WeldService: org.jboss.weld.exceptions.DeploymentException: Exception List with 1 exceptions:
Exception 0 :
java.lang.IllegalArgumentException: JBAS016069: Error injecting persistence unit into CDI managed bean. Can't find a persistence unit named org.jbpm.domain in deployment jbpm-console.war
          at org.jboss.as.weld.services.bootstrap.WeldJpaInjectionServices.getScopedPUName(WeldJpaInjectionServices.java:96)
          at org.jboss.as.weld.services.bootstrap.WeldJpaInjectionServices.resolvePersistenceUnit(WeldJpaInjectionServices.java:78)
          at org.jboss.weld.util.Beans.injectEEFields(Beans.java:631)
          at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:160)
          at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)
          at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:157)
          at org.jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java:131)
          at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:153)
          at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:290)
          at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107)
          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:616)
          at org.jboss.weld.bean.AbstractReceiverBean.getReceiver(AbstractReceiverBean.java:73)
          at org.jboss.weld.bean.ProducerMethod$1.produce(ProducerMethod.java:131)
          at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:299)
          at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:61)
          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:616)
          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:681)
          at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:118)
          at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:703)
          at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:712)
          at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:161)
          at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)
          at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:157)
          at org.jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java:131)
          at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:153)
          at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:290)
          at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:61)
          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:616)
          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:681)
          at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:118)
          at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:703)
          at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:712)
          at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:161)
          at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)
          at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:157)
          at org.jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java:131)
          at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:153)
          at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:290)
          at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107)
          at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90)
          at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)
          at org.jbpm.services.task.impl.TaskDeadlinesServiceImpl$Proxy$_$$_WeldClientProxy.toString(TaskDeadlinesServiceImpl$Proxy$_$$_WeldClientProxy.java)
          at org.kie.commons.services.cdi.StartupBeanExtension.runPostConstruct(StartupBeanExtension.java:81)
          at org.kie.commons.services.cdi.StartupBeanExtension.afterDeploymentValidation(StartupBeanExtension.java:69)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:601)
          at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)
          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
          at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)
          at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170)
          at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51)
          at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:154)
          at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:241)
          at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:229)
          at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:207)
          at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:75)
          at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:46)
          at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:31)
          at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:369)
          at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83)
          at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:722)
"},"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.web.deployment.default-host./jbpm-console.realmjboss.security.security-domain.jbpm-console-ngMissing[jboss.web.deployment.default-host./jbpm-console.realmjboss.security.security-domain.jbpm-console-ng]"]}}}

 

 

Anyone has any thought on this?

 

Any help will be appreciated.

 

Regards

Samuele Mezzasalma

Reply to this message by going to Community

Start a new discussion in jBPM at Community