JBoss Community

Re: how to install the jbpm5 to work on mysql database

created by Chaitanya Desai in jBPM - View the full discussion

Hello Everyone,

I am getting an exception when configuring jbpm 5.1 on jboss 5.1 with mysql 5.1.

I have modified hibernate.cfg.xml, persistence.xml, testDS1.xml, jbpm-human-task-5.1.0.Final.jar and I am able to export the jbpm schema in my sql tables.

4 new tables : eventtypes, processinstanceinfo,sessioninfo, workiteminfo got created into the database named jbpm_demo within mysql.

However when i try to open the console i get the above exception.

 

I think the exception is comming due to modifications required in jbpm-human-task-5.1.0.Final.jar . Did anyone face the similar exception (Exception stack trace @ bottom)

 

Here is the information from the modified files @ the time of exception:

 

 

jbpm-human-task-5.1.0.Final.jar: persistence.xml :

 

<properties>

      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>

      <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>

      <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/JBPM_DEMO?useUnicode=true&amp;characterEncoding=UTF-8" />

      <property name="hibernate.connection.username" value="root"/>

      <property name="hibernate.connection.password" value=""/>

      <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" />

    </properties>

 

Hibernate.cfg.xml :

 

  <session-factory>

 

        <!-- Database connection settings -->

        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>

        <property name="connection.url">jdbc:mysql://localhost:3306/jbpm_demo?useUnicode=true&amp;characterEncoding=UTF-8</property>

        <!--property name="connection.url">jdbc:h2:file:/NotBackedUp/data/mydb</property-->

        <property name="connection.username">root</property>

        <property name="connection.password"></property>

        <!-- JDBC connection pool (use the built-in) -->

        <property name="connection.pool_size">1</property>

 

        <!-- SQL dialect -->

        <property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>

 

        <!-- Enable Hibernate's automatic session context management -->

        <property name="current_session_context_class">thread</property>

 

        <!-- Disable the second-level cache  -->

        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

 

        <!-- Echo all executed SQL to stdout -->

        <property name="show_sql">false</property>

 

        <!-- Drop and re-create the database schema on startup? -->

        <property name="hbm2ddl.auto">create</property>

        <mapping resource="AuditLog.hbm.xml"/>

    </session-factory>

 

 

Persistence.xml :

 

<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">

    <provider>org.hibernate.ejb.HibernatePersistence</provider>

    <jta-data-source>java:jdbc/jbpmDatasource</jta-data-source>     

    <mapping-file>META-INF/JBPMorm.xml</mapping-file>

    <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>

    <class>org.drools.persistence.info.SessionInfo</class>

    <class>org.drools.persistence.info.WorkItemInfo</class>

    <properties>

      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>       

      <property name="hibernate.max_fetch_depth" value="3"/>

      <property name="hibernate.hbm2ddl.auto" value="create" />

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

      <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />

    </properties>      

  </persistence-unit>

 

 

 

 

TestDS1.xml :

 

<local-tx-datasource>

    <jndi-name>jdbc/jbpmDatasource</jndi-name>

    <connection-url>jdbc:mysql://localhost:3306/jbpm_demo?useUnicode=true&amp;characterEncoding=UTF-8</connection-url>

    <!--connection-url>jdbc:h2:mem:mydb</connection-url-->

    <driver-class>com.mysql.jdbc.Driver</driver-class>

    <user-name>root</user-name>

    <password></password>

  </local-tx-datasource>

 

EXCEPTION STACK TRACE

 

25.07.2011 18:56:43 INFO  [Configuration] Reading mappings from resource : META-INF/JBPMorm.xml

25.07.2011 18:56:43 INFO  [QueryBinder] Binding Named query: ProcessInstancesWaitingForEvent => select processInstanceInfo.processInstanceId from ProcessInstanceInfo processInstanceInfo where :type in elements(processInstanceInfo.eventTypes)

25.07.2011 18:56:43 INFO  [AnnotationBinder] Binding entity from annotated class: org.jbpm.persistence.processinstance.ProcessInstanceInfo

25.07.2011 18:56:43 INFO  [EntityBinder] Bind entity org.jbpm.persistence.processinstance.ProcessInstanceInfo on table ProcessInstanceInfo

25.07.2011 18:56:43 INFO  [AnnotationBinder] Binding entity from annotated class: org.drools.persistence.info.SessionInfo

25.07.2011 18:56:43 INFO  [EntityBinder] Bind entity org.drools.persistence.info.SessionInfo on table SessionInfo

25.07.2011 18:56:43 INFO  [AnnotationBinder] Binding entity from annotated class: org.drools.persistence.info.WorkItemInfo

25.07.2011 18:56:43 INFO  [EntityBinder] Bind entity org.drools.persistence.info.WorkItemInfo on table WorkItemInfo

25.07.2011 18:56:43 INFO  [HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.

25.07.2011 18:56:43 INFO  [NamingHelper] JNDI InitialContext properties:{}

25.07.2011 18:56:43 INFO  [DatasourceConnectionProvider] Using datasource: java:jdbc/jbpmDatasource

25.07.2011 18:56:43 INFO  [SettingsFactory] RDBMS: MySQL, version: 5.1.58-community

25.07.2011 18:56:43 INFO  [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.17 ( Revision: ${bzr.revision-id} )

25.07.2011 18:56:43 INFO  [Dialect] Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect

25.07.2011 18:56:43 INFO  [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory

25.07.2011 18:56:43 INFO  [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup

25.07.2011 18:56:43 INFO  [TransactionManagerLookupFactory] instantiated TransactionManagerLookup

25.07.2011 18:56:43 INFO  [SettingsFactory] Automatic flush during beforeCompletion(): disabled

25.07.2011 18:56:43 INFO  [SettingsFactory] Automatic session close at end of transaction: disabled

25.07.2011 18:56:43 INFO  [SettingsFactory] JDBC batch size: 15

25.07.2011 18:56:43 INFO  [SettingsFactory] JDBC batch updates for versioned data: disabled

25.07.2011 18:56:43 INFO  [SettingsFactory] Scrollable result sets: enabled

25.07.2011 18:56:43 INFO  [SettingsFactory] JDBC3 getGeneratedKeys(): enabled

25.07.2011 18:56:43 INFO  [SettingsFactory] Connection release mode: auto

25.07.2011 18:56:43 INFO  [SettingsFactory] Maximum outer join fetch depth: 3

25.07.2011 18:56:43 INFO  [SettingsFactory] Default batch fetch size: 1

25.07.2011 18:56:43 INFO  [SettingsFactory] Generate SQL with comments: disabled

25.07.2011 18:56:43 INFO  [SettingsFactory] Order SQL updates by primary key: disabled

25.07.2011 18:56:43 INFO  [SettingsFactory] Order SQL inserts for batching: disabled

25.07.2011 18:56:43 INFO  [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory

25.07.2011 18:56:43 INFO  [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory

25.07.2011 18:56:43 INFO  [SettingsFactory] Query language substitutions: {}

25.07.2011 18:56:43 INFO  [SettingsFactory] JPA-QL strict compliance: enabled

25.07.2011 18:56:43 INFO  [SettingsFactory] Second-level cache: enabled

25.07.2011 18:56:43 INFO  [SettingsFactory] Query cache: disabled

25.07.2011 18:56:43 INFO  [SettingsFactory] Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory

25.07.2011 18:56:43 INFO  [SettingsFactory] Optimize cache for minimal puts: disabled

25.07.2011 18:56:43 INFO  [SettingsFactory] Structured second-level cache entries: disabled

25.07.2011 18:56:43 INFO  [SettingsFactory] Statistics: disabled

25.07.2011 18:56:43 INFO  [SettingsFactory] Deleted entity synthetic identifier rollback: disabled

25.07.2011 18:56:43 INFO  [SettingsFactory] Default entity-mode: pojo

25.07.2011 18:56:43 INFO  [SettingsFactory] Named query checking : enabled

25.07.2011 18:56:43 INFO  [SessionFactoryImpl] building session factory

25.07.2011 18:56:43 INFO  [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured

25.07.2011 18:56:43 INFO  [SchemaExport] Running hbm2ddl schema export

25.07.2011 18:56:43 INFO  [SchemaExport] exporting generated schema to database

25.07.2011 18:56:43 INFO  [SchemaExport] schema export complete

25.07.2011 18:56:43 INFO  [NamingHelper] JNDI InitialContext properties:{}

25.07.2011 18:56:44 INFO  [STDOUT] Loading session data ...

25.07.2011 18:56:44 INFO  [STDOUT] Error loading session data: java.lang.reflect.InvocationTargetException

25.07.2011 18:56:44 INFO  [STDOUT] Creating new session data ...

25.07.2011 18:56:45 ERROR [[Resteasy]] Servlet.service() for servlet Resteasy threw exception

org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException: Could not initialize stateful knowledge session: Could not connect task client

        at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:319)

        at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:230)

        at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:206)

        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:360)

        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)

        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)

        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

        at org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)

        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

        at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

        at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

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

Caused by: java.lang.RuntimeException: Could not initialize stateful knowledge session: Could not connect task client

        at org.jbpm.integration.console.CommandDelegate.newStatefulKnowledgeSession(CommandDelegate.java:185)

        at org.jbpm.integration.console.CommandDelegate.getSession(CommandDelegate.java:193)

        at org.jbpm.integration.console.CommandDelegate.<init>(CommandDelegate.java:71)

        at org.jbpm.integration.console.ProcessManagement.<init>(ProcessManagement.java:35)

        at org.jbpm.integration.console.ManagementFactory.createProcessManagement(ManagementFactory.java:22)

        at org.jbpm.integration.console.ManagementFactory.createProcessManagement(ManagementFactory.java:19)

        at org.jboss.bpm.console.server.ProcessMgmtFacade.getProcessManagement(ProcessMgmtFacade.java:98)

        at org.jboss.bpm.console.server.ProcessMgmtFacade.getDefinitionsJSON(ProcessMgmtFacade.java:122)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)

        at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)

        at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)

        at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)

        at org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)

        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)

        ... 28 more

Caused by: java.lang.IllegalArgumentException: Could not connect task client

        at org.jbpm.process.workitem.wsht.CommandBasedWSHumanTaskHandler.connect(CommandBasedWSHumanTaskHandler.java:88)

        at org.jbpm.integration.console.CommandDelegate.newStatefulKnowledgeSession(CommandDelegate.java:181)

        ... 45 more

Reply to this message by going to Community

Start a new discussion in jBPM at Community