cancel
Showing results for 
Search instead for 
Did you mean: 

TimerEntity was updated by another transaction concurrently

bardioc
Champ in-the-making
Champ in-the-making
Hello,

I've created a simple test case to show a optimistic locking error with the TimerCatchEvent. I've tried to build a unit test from this, but somehow it only occurs when directly implemented in the process.

We're currently using WebSphere 8.0, Activiti-5.9-SNAPSHOT as well as Oracle as DB for the persistence. The model used for this test is the same as found in the IntermediateTimerTest-case in the activiti-engine test suite.

[attachment=0]IntermediateTimerTest.png[/attachment]

The timer is configured as PT5S.

I'm creating a singleton process engine with the EJB-Annotation @Singleton and @Startup. The configuration utilizes the Spring based UOWTransaction manager required for WebSphere.


    <bean id="transactionManager" class="org.springframework.transaction.jta.WebSphereUowTransactionManager" />
   
    <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">   
        <property name="jobExecutorActivate" value="false" />     
        <property name="transactionManager"  ref="transactionManager" />
    </bean>

The database is retrieved via @Resource annotation to utilize the currently active transaction.


conf.setJobExecutorActivate(true);
conf.setDataSource(dataSource);
conf.setHistory(ProcessEngineConfiguration.HISTORY_ACTIVITY);
conf.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);

When I afterwards create two process instances directly after each other:


final ProcessInstance instance
    = engine.getRuntimeService().startProcessInstanceByKey("IntermediateTimerTest");

final ProcessInstance instance2
    = engine.getRuntimeService().startProcessInstanceByKey("IntermediateTimerTest");

Both fall into the timer. When the timer fires an exception is thrown:


[21.10.11 11:40:09:084 CEST] 00000026 CommandContex E   Error while closing command context
org.activiti.engine.ActivitiOptimisticLockingException: TimerEntity[311] was updated by another transaction concurrently
   at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:435)
   at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:348)
   at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:147)
   at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:103)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49)
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
   at org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter.run(WebSphereUowTransactionManager.java:337)
   at com.ibm.ws.uow.EmbeddableUOWManagerImpl.runUnderNewUOW(EmbeddableUOWManagerImpl.java:786)
   at com.ibm.ws.uow.EmbeddableUOWManagerImpl.runUnderUOW(EmbeddableUOWManagerImpl.java:365)
   at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:281)
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:124)
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.jobexecutor.JobAcquisitionThread.run(JobAcquisitionThread.java:63)

Can somebody please help me to understand, what I did wrong or is this a bug in the system?

Thank you very much!
12 REPLIES 12

trademak
Star Contributor
Star Contributor
Hi,

I've updated my unit test to use two separate process engines and job executors.
Now I also encountered the ActivitiOptimisticLockException, so that was a good start 😉
I debugged a bit and found out that the error message might be a bit misleading as the job execution is going perfectly well.
What's happening?
Let's imaging there are 10 jobs to process by 2 process engines and job executors using the same database.
When these process engines are started at the exact same time this happens.

1. Server 1 retrieves 3 jobs (default job length) from the job table
2. Server 2 retrieves 3 jobs (the same as server 1) from the job table
3. Server 1 sets itself as lock owner (sort of optimistic lock) to every of the 3 jobs
4. Server 2 sets itself as lock owner (sort of optimistic lock) to every of the 3 jobs
5. Server 1 commits the job entity changes for the 3 jobs, all is good
6. Server 2 commits the job entity changes for the 3 jobs, and gets an optimistic lock exception. The error message contains the same error 2 times, but the Engine only throws the error once.
So the following error message:
Oct 29, 2011 5:18:41 PM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.activiti.engine.ActivitiOptimisticLockingException: TimerEntity[31] was updated by another transaction concurrently
at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:435)
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:348)
at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:150)
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:105)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.jobexecutor.JobAcquisitionThread.run(JobAcquisitionThread.java:63)
Oct 29, 2011 5:18:41 PM org.activiti.engine.impl.jobexecutor.JobAcquisitionThread run
SEVERE: exception during job acquisition: TimerEntity[31] was updated by another transaction concurrently
org.activiti.engine.ActivitiOptimisticLockingException: TimerEntity[31] was updated by another transaction concurrently
at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:435)
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:348)
at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:150)
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:105)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.jobexecutor.JobAcquisitionThread.run(JobAcquisitionThread.java:63)

Actually should be only one error message:
Oct 29, 2011 5:18:41 PM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.activiti.engine.ActivitiOptimisticLockingException: TimerEntity[31] was updated by another transaction concurrently
at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:435)
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:348)
at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:150)
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:105)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.jobexecutor.JobAcquisitionThread.run(JobAcquisitionThread.java:63)
Oct 29, 2011 5:18:41 PM org.activiti.engine.impl.jobexecutor.JobAcquisitionThread run

7. Server 1 executes the 3 jobs individually
8. Server 2 will retrieve the next 3 jobs.

So I think the Activiti Engine behavior is all good. You can easily run multiple process engines and job executors.
But you will encounter these optimistic lock exceptions now and then.
Maybe we should change this exception into a finer level and not the severe level.

Best regards,

ct1
Champ in-the-making
Champ in-the-making
My use case is simply to let a user start a process that polls for a file every five minutes, and when it finds the file to process it. 

I have defined a simple process to run a Service Task (Java Program CheckForFile2.class) that checks to see if a file exists and sets a variable "fileExists" to true when it finds the file and sets the variable to false when it does not find the file.  When the Service Task completes an Exclusive Gateway is used and the output flow conditions are "${fileExists != true}" and "${fileExists == true}". The flow when the file was not found goes to a Script task that just prints on the console that the file was not found and then it goes to the IntermediateTimer ("pause5Minutes" which is actually coded to wait one minute for testing).  When the specified delay has passed, the Service Task should execute again and look for the file. 

I start the process in Explorer and want the cycle to continue indefinitely until the file is found.  After a varying number of cycles, the process throws an exception:  "org.activiti.engine.ActivitiOptimisticLockingException: TimerEntity[7546] was updated by another transaction concurrently".  Then the process is unable to find the class file it just executed before invoking the timer:  "org.activiti.engine.ActivitiException: couldn't instantiate class opt.argo.com.CheckForFile2".

I do not know if the messages about "org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy" in the log file have anything to do with my problem, but I am not trying to deploy anything during my testing. 

Please let me know if I have missed something here.

I would appreciate any help you have time to give.

Thank you.



Here is my process:


<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="CheckForAFile2" name="CheckForAFile2">
    <documentation>Place documentation for the 'CheckForAFile2' process here.</documentation>
    <startEvent id="checkForAFile2Start" name="Check For A File 2 Start"></startEvent>
    <scriptTask id="logNotExist" name="Log That File Does Not Exist" scriptFormat="groovy">
      <script><![CDATA[now = new Date();outSmiley Tonguerintln "In CheckForAFile2 Process:  File does NOT Exist… going to wait.  ${now}\n";]]></script>
    </scriptTask>
    <exclusiveGateway id="doesFileExist" name="Does File Exist"></exclusiveGateway>
    <scriptTask id="logFileExists" name="Log That File Exists" scriptFormat="groovy">
      <script><![CDATA[print "In CheckForAFile2 Process:  File does exist.  Reached end.\n"]]></script>
    </scriptTask>
    <endEvent id="checkForAFile2End" name="Check for A File 2 End"></endEvent>
    <sequenceFlow id="flow2" name="" sourceRef="logFileExists" targetRef="checkForAFile2End"></sequenceFlow>
    <sequenceFlow id="fileNotExist" name="File Does Not Exist" sourceRef="doesFileExist" targetRef="logNotExist">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${fileExists != true}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow4" name="" sourceRef="checkForAFile2Start" targetRef="checkFileExists"></sequenceFlow>
    <sequenceFlow id="goToDecision" name="" sourceRef="checkFileExists" targetRef="doesFileExist"></sequenceFlow>
    <intermediateCatchEvent id="pause5Minutes" name="Pause 5 Minutes">
      <timerEventDefinition>
        <timeDuration>PT1M</timeDuration>
      </timerEventDefinition>
    </intermediateCatchEvent>
    <sequenceFlow id="flow6" name="" sourceRef="logNotExist" targetRef="pause5Minutes"></sequenceFlow>
    <sequenceFlow id="flow7" name="" sourceRef="pause5Minutes" targetRef="checkFileExists"></sequenceFlow>
    <sequenceFlow id="fileDoesExist" name="File Does Exist" sourceRef="doesFileExist" targetRef="logFileExists">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${fileExists == true}]]></conditionExpression>
    </sequenceFlow>
    <serviceTask id="checkFileExists" name="Check File Exists" activiti:class="opt.argo.com.CheckForFile2"></serviceTask>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_CheckForAFile2">
    <bpmndi:BPMNPlane bpmnElement="CheckForAFile2" id="BPMNPlane_CheckForAFile2">
      <bpmndi:BPMNShape bpmnElement="checkForAFile2Start" id="BPMNShape_checkForAFile2Start">
        <omgdc:Bounds height="35" width="35" x="100" y="140"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="logNotExist" id="BPMNShape_logNotExist">
        <omgdc:Bounds height="55" width="105" x="368" y="300"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="doesFileExist" id="BPMNShape_doesFileExist">
        <omgdc:Bounds height="40" width="40" x="400" y="137"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="logFileExists" id="BPMNShape_logFileExists">
        <omgdc:Bounds height="55" width="105" x="550" y="130"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="checkForAFile2End" id="BPMNShape_checkForAFile2End">
        <omgdc:Bounds height="35" width="35" x="710" y="140"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="pause5Minutes" id="BPMNShape_pause5Minutes">
        <omgdc:Bounds height="35" width="35" x="215" y="310"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="checkFileExists" id="BPMNShape_checkFileExists">
        <omgdc:Bounds height="55" width="105" x="180" y="130"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="655" y="157"></omgdi:waypoint>
        <omgdi:waypoint x="710" y="157"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="fileNotExist" id="BPMNEdge_fileNotExist">
        <omgdi:waypoint x="420" y="177"></omgdi:waypoint>
        <omgdi:waypoint x="420" y="300"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
        <omgdi:waypoint x="135" y="157"></omgdi:waypoint>
        <omgdi:waypoint x="180" y="157"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="goToDecision" id="BPMNEdge_goToDecision">
        <omgdi:waypoint x="285" y="157"></omgdi:waypoint>
        <omgdi:waypoint x="400" y="157"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
        <omgdi:waypoint x="368" y="327"></omgdi:waypoint>
        <omgdi:waypoint x="250" y="327"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
        <omgdi:waypoint x="232" y="310"></omgdi:waypoint>
        <omgdi:waypoint x="232" y="185"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="fileDoesExist" id="BPMNEdge_fileDoesExist">
        <omgdi:waypoint x="440" y="157"></omgdi:waypoint>
        <omgdi:waypoint x="550" y="157"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

Here is the Service task Java Class:


package opt.argo.com;

import java.io.File;

public class CheckForFile2 implements JavaDelegate
{
@Override
public void execute(DelegateExecution execution) throws Exception
{
  Calendar now = Calendar.getInstance();
 
  System.out.println("CheckForFile2.execute() was called at "
      + now.getTime());
 
  System.out.println("Current thread is "
      + Thread.currentThread().getName());
 
  // May want to use the DelegateExecution object to provide the
  // file and path names.  For now, just put in values to test with.
 
  String fileAndPathName = constructFileAndPathName();
 
  boolean fileExists = false; 
  
  fileExists = lookForFile(fileAndPathName);
 
  System.out.println("In CheckForFile2.execute() set fileExists = "
      + fileExists + ".  Current thread is "
      + Thread.currentThread().getName());  
 
  execution.setVariable("fileExists", fileExists); 

}

private boolean lookForFile(String fileAndPathName)
{
  System.out.println("CheckForFile2.lookForFile() was called with "
      + "fileAndPathName = \"" + fileAndPathName + "\".");
 
  boolean fileFound = false;
 
  if(fileAndPathName != null && fileAndPathName.length() > 0)
  {
   File aFile = new File(fileAndPathName);
  
   if(aFile.exists())
   {
    fileFound = true;
   }
   else
   {
    fileFound = false;
   }
  
  }
   
  System.out.println("In CheckForFile2.lookForFile() set fileFound = "
       + fileFound);
 
  return fileFound;
}

private String constructFileAndPathName()
{
  String separator = new String();
  separator = System.getProperty("file.separator");
 
  String theFilePath = new String("C:" + separator + "Users" + separator
     + "thomacha"
     + separator + "DataFiles" + separator + "ForTest"
     + separator);
 
  String theFileName = new String("theFileToLookFor.txt");
 
  String fileAndPathName = new String(theFilePath + theFileName);
 
  return fileAndPathName;
}
}



Here is the HIstory of the run

7535    CheckForAFile2:1:7532    7534    7534    checkFileExists     Check File Exists                   serviceTask            2011-12-05 10:15:45.428    2011-12-05 10:15:45.432    4
7537    CheckForAFile2:1:7532    7534    7534    doesFileExist        Does File Exist                      exclusiveGateway    2011-12-05 10:15:45.432    2011-12-05 10:15:45.432    0
7538    CheckForAFile2:1:7532    7534    7534    logNotExist          Log That File Does Not Exist    scriptTask              2011-12-05 10:15:45.432    2011-12-05 10:15:45.495    63
7542    CheckForAFile2:1:7532    7534    7534    checkFileExists     Check File Exists                   serviceTask            2011-12-05 10:16:45.537    2011-12-05 10:16:45.542    5
7543    CheckForAFile2:1:7532    7534    7534    doesFileExist        Does File Exist                      exclusiveGateway    2011-12-05 10:16:45.542    2011-12-05 10:16:45.542    0
7544    CheckForAFile2:1:7532    7534    7534    logNotExist           Log That File Does Not Exist   scriptTask              2011-12-05 10:16:45.542    2011-12-05 10:16:45.57     28


Then the exception is thrown.

Here is the log file with the Stack Trace:


CheckForFile2.execute() was called at Mon Dec 05 10:15:45 CST 2011
Current thread is http-8080-4
CheckForFile2.lookForFile() was called with fileAndPathName = "C:\Users\thomacha\DataFiles\ForTest\t
heFileToLookFor.txt".
In CheckForFile2.lookForFile() set fileFound = false
In CheckForFile2.execute() set fileExists = false.  Current thread is http-8080-4
In CheckForAFile2 Process:  File does NOT Exist… going to wait.  Mon Dec 05 10:15:45 CST 2011

CheckForFile2.execute() was called at Mon Dec 05 10:16:45 CST 2011
Current thread is pool-1-thread-1
CheckForFile2.lookForFile() was called with fileAndPathName = "C:\Users\thomacha\DataFiles\ForTest\t
heFileToLookFor.txt".
In CheckForFile2.lookForFile() set fileFound = false
In CheckForFile2.execute() set fileExists = false.  Current thread is pool-1-thread-1
In CheckForAFile2 Process:  File does NOT Exist… going to wait.  Mon Dec 05 10:16:45 CST 2011

Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.activiti.engine.ActivitiOptimisticLockingException: TimerEntity[7546] was updated by another tra
nsaction concurrently
        at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:435)
        at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:348)
        at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:147
)
        at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:103)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInte
rceptor.java:49)
        at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInter
ceptor.java:42)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.j
ava:130)
        at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.jav
a:40)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.activiti.engine.impl.jobexecutor.JobAcquisitionThread.run(JobAcquisitionThread.java:6
3)
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.jobexecutor.JobAcquisitionThread run
SEVERE: exception during job acquisition: TimerEntity[7546] was updated by another transaction concu
rrently
org.activiti.engine.ActivitiOptimisticLockingException: TimerEntity[7546] was updated by another tra
nsaction concurrently
        at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:435)
        at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:348)
        at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:147
)
        at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:103)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInte
rceptor.java:49)
        at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInter
ceptor.java:42)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.j
ava:130)
        at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.jav
a:40)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.activiti.engine.impl.jobexecutor.JobAcquisitionThread.run(JobAcquisitionThread.java:6
3)
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource RenameAFile.bpmn20.xml
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource FileCheckTesterProcess.bpmn20.xml
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource RenameAFile.png
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource CheckForAFile2.bpmn20.xml
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource CheckForAFile2.png
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource CheckForAFile.bpmn20.xml
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource FileCheckTesterProcess.png
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource CheckForAFile.png
Dec 5, 2011 10:17:45 AM org.activiti.engine.impl.jobexecutor.TimerCatchIntermediateEventJobHandler e
xecute
SEVERE: exception during timer execution
org.activiti.engine.ActivitiException: couldn't instantiate class opt.argo.com.CheckForFile2
        at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:131)
        at org.activiti.engine.impl.bpmn.helper.ClassDelegate.instantiateDelegate(ClassDelegate.java
:156)
        at org.activiti.engine.impl.bpmn.helper.ClassDelegate.getActivityBehaviorInstance(ClassDeleg
ate.java:129)
        at org.activiti.engine.impl.bpmn.helper.ClassDelegate.execute(ClassDelegate.java:110)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperati
onActivityExecute.java:44)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:
76)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(Executio
nEntity.java:497)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEnt
ity.java:492)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNo
tificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAt
omicOperation.java:56)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:
76)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(Executio
nEntity.java:497)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEnt
ity.java:492)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAt
omicOperation.java:49)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:
76)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(Executio
nEntity.java:497)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEnt
ity.java:492)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicO
perationTransitionCreateScope.java:49)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:
76)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(Executio
nEntity.java:497)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEnt
ity.java:492)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(
AtomicOperationTransitionNotifyListenerTake.java:65)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:
76)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(Executio
nEntity.java:497)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEnt
ity.java:492)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(Atomic
OperationTransitionDestroyScope.java:115)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:
76)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(Executio
nEntity.java:497)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEnt
ity.java:492)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNoti
ficationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:36)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAt
omicOperation.java:56)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:
76)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(Executio
nEntity.java:497)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEnt
ity.java:492)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:332
)
        at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnA
ctivityBehavior.java:102)
        at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavio
r(BpmnActivityBehavior.java:51)
        at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBeh
avior.java:44)
        at org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.leave(AbstractBpmnAct
ivityBehavior.java:37)
        at org.activiti.engine.impl.bpmn.behavior.IntermediateCatchEventActivitiBehaviour.signal(Int
ermediateCatchEventActivitiBehaviour.java:27)
        at org.activiti.engine.impl.jobexecutor.TimerCatchIntermediateEventJobHandler.execute(TimerC
atchIntermediateEventJobHandler.java:43)
        at org.activiti.engine.impl.persistence.entity.JobEntity.execute(JobEntity.java:78)
        at org.activiti.engine.impl.persistence.entity.TimerEntity.execute(TimerEntity.java:62)
        at org.activiti.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:61)
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java
:24)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInte
rceptor.java:42)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:36)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.activiti.engine.ActivitiClassLoadingException: Class not found: opt.argo.com.CheckFor
File2
        at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:81)
        at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:128)
        … 50 more
Caused by: java.lang.ClassNotFoundException: opt.argo.com.CheckForFile2
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:62)
        … 51 more

trademak
Star Contributor
Star Contributor
Hi,

I think the problem is that you execute a couple of automatic tasks after running the intermediate timer event and then execute another intermediate timer event.
This means that when the first intermediate timer event is executed, the automatic tasks are executed and another intermediate timer event is started.
Maybe this use case is better suited for a framework like Apache Camel or Mule. These frameworks can poll for files.
If you want you can then start an Activiti process, because we provide Camel and Mule modules for Activiti.

Best regards,