AnsweredAssumed Answered

activiti thread hangs/freeze

Question asked by filipe.matos on Aug 11, 2017

Hi,

We're using the activiti engine 5.12 in a webapp (already in a production environment) with Spring and MySQL and it always worked well.

 

Now, the application has a awkward behavior. After calling any method of activiti API we're getting an HTTP 503 error code in browser, like when we start a new process:

 

               ProcessInstance pi = runtimeService.startProcessInstanceByKey(ProcessInstanceKey, hash);

This startProcessInstanceByKey call never return or gives an exception.

 

I'm debugging activiti source code, and I can see that startProcessInstanceByKey @ RuntimeServiceImpl.java is called and them it goes into LogInterceptor and SpringTransactionInterceptor, however I've a couple of breakpoints on createProcessInstance/2 @ ProcessDefinitionEntity.java and execute/1 @ StartProcessInstanceCmd.java that are never reached.

 

The activiti configuration is the following:

 

<bean id="dataSourceBpm" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/bpm"/>
</bean>

<bean id="transactionManagerBpm"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager"
scope="prototype">
<property name="dataSource" ref="dataSourceBpm" />
</bean>

<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="databaseType" value="mysql" />
<property name="dataSource" ref="dataSourceBpm" />
<property name="transactionManager" ref="transactionManagerBpm" />
<property name="databaseSchemaUpdate" value="true" />
<property name="deploymentResources" value="classpath*:diagrams/*.bpmn" />
<property name="jobExecutorActivate" value="true" />
<property name="history" value="full"></property>
<property name="mailServerHost" value="${mail.host}"></property>
<property name="mailServerPort" value="${mail.port}"></property>
<property name="mailServerUsername" value="${mail.username}"></property>
<property name="mailServerPassword" value="${mail.password}"></property>
</bean>

<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>

<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
<bean id="formService" factory-bean="processEngine" factory-method="getFormService" />

Outcomes