ActivitiException when trying to run workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2012 06:04 PM
I am trying to run a multi instance workflow for my service task which has a delay in it.( I am using Thread.sleep in my service task for 180000 ms) .During this, the jobs are executed fine but at the completion of the last iteration, I see an exception as :
org.activiti.engine.ActivitiException: No job found with id '4633'
at org.activiti.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:57)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.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.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
After this all my previous iteration service tasks are aborted ..My BPMN:
<?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" xmlnsmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsmgdi="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="SeqTest" name="seqTest">
<documentation>Place documentation for the 'seqTest' process here.</documentation>
<startEvent id="startevent1" name="Start"></startEvent>
<serviceTask id="servicetask1" name="Service Task" activiti:class="com.mikewidgets.helloWorld.SayHelloTask">
<multiInstanceLoopCharacteristics isSequential="true">
<loopCardinality>10</loopCardinality>
</multiInstanceLoopCharacteristics>
</serviceTask>
<endEvent id="endevent1" name="End"></endEvent>
<sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="servicetask1"></sequenceFlow>
<sequenceFlow id="flow2" name="" sourceRef="servicetask1" targetRef="endevent1"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_SeqTest">
<bpmndi:BPMNPlane bpmnElement="SeqTest" id="BPMNPlane_SeqTest">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35" width="35" x="190" y="120"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="servicetask1" id="BPMNShape_servicetask1">
<omgdc:Bounds height="55" width="105" x="420" y="180"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35" width="35" x="470" y="300"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="207" y="155"></omgdi:waypoint>
<omgdi:waypoint x="472" y="180"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="472" y="235"></omgdi:waypoint>
<omgdi:waypoint x="487" y="300"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
It would be great if someone could help resolve this
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2012 02:00 AM
On top of that, to prevent job-executor not to block all of it's threads too long, a max-lock time is set (default is 5 minutes: int lockTimeInMillis = 5 * 60 * 1000. If expired, job executor presumes something went wrong and unlocks the job, effectively marking it to be executed again.
The lock-time is a setter on the JobExecutor and can be altered in configuration or even from code, so this can be raised.
I don't see any timer-declarations in your process, where are the jobs coming from?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2012 09:36 AM
Thanks for the valuable reply. Can you let me know how this time could be configured ? I would want to increase the time limit and see if this exception happens even then ..
This exception is not happening in case of normal tasks( service tasks with Thread.sleep() in it) . It is happening only when the tasks are in a loop ( Even then , for small loop iteration count like 2 or 3 the exception does not occur. It happens only for large iteration values like 9 or 10 )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2012 09:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2012 12:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2012 12:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2012 10:24 AM
I am able to configure the lockTime to a higher value and could see the process run . But at the end, after the last iteration had been complete the following exception occurs and all the previous iterations are aborted.
### Error updating database. Cause: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "PRIMARY_KEY_80 ON PUBLIC.ACT_HI_DETAIL(ID_)"; SQL statement:
insert into ACT_HI_DETAIL (ID_, TYPE_, PROC_INST_ID_, EXECUTION_ID_, ACT_INST_ID_, TASK_ID_, NAME_, REV_, VAR_TYPE_, TIME_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_)
values (
?,
'VariableUpdate',
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?
) [23001-132]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:316)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:157)
at org.h2.index.PageBtree.find(PageBtree.java:115)
at org.h2.index.PageBtreeLeaf.addRow(PageBtreeLeaf.java:137)
at org.h2.index.PageBtreeLeaf.addRowTry(PageBtreeLeaf.java:92)
at org.h2.index.PageBtreeNode.addRowTry(PageBtreeNode.java:200)
at org.h2.index.PageBtreeIndex.addRow(PageBtreeIndex.java:88)
at org.h2.index.PageBtreeIndex.add(PageBtreeIndex.java:79)
at org.h2.table.RegularTable.addRow(RegularTable.java:112)
at org.h2.command.dml.Insert.insertRows(Insert.java:120)
at org.h2.command.dml.Insert.update(Insert.java:82)
at org.h2.command.CommandContainer.update(CommandContainer.java:70)
at org.h2.command.Command.executeUpdate(Command.java:198)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:298)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:135)
at java.lang.Thread.run(Thread.java:722)
### The error may involve org.activiti.engine.impl.persistence.entity.HistoricDetailEntity.insertHistoricVariableUpdate-Inline
### The error occurred while setting parameters
### Cause: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "PRIMARY_KEY_80 ON PUBLIC.ACT_HI_DETAIL(ID_)"; SQL statement:
insert into ACT_HI_DETAIL (ID_, TYPE_, PROC_INST_ID_, EXECUTION_ID_, ACT_INST_ID_, TASK_ID_, NAME_, REV_, VAR_TYPE_, TIME_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_)
values (
?,
'VariableUpdate',
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?
) [23001-132]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:316)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:157)
at org.h2.index.PageBtree.find(PageBtree.java:115)
at org.h2.index.PageBtreeLeaf.addRow(PageBtreeLeaf.java:137)
at org.h2.index.PageBtreeLeaf.addRowTry(PageBtreeLeaf.java:92)
at org.h2.index.PageBtreeNode.addRowTry(PageBtreeNode.java:200)
at org.h2.index.PageBtreeIndex.addRow(PageBtreeIndex.java:88)
at org.h2.index.PageBtreeIndex.add(PageBtreeIndex.java:79)
at org.h2.table.RegularTable.addRow(RegularTable.java:112)
at org.h2.command.dml.Insert.insertRows(Insert.java:120)
at org.h2.command.dml.Insert.update(Insert.java:82)
at org.h2.command.CommandContainer.update(CommandContainer.java:70)
at org.h2.command.Command.executeUpdate(Command.java:198)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:298)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:135)
at java.lang.Thread.run(Thread.java:722)
This exception does not occur , if the loop iteration value is small( like 3 or 4). It occurs only when the loop iteration value is set 10 or higher. Could you please help resolve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2012 10:45 AM
What is the transaction-strategy used? Do you hook in to spring-transactions or something?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2012 11:00 AM
I invoke activiti from my workflows and not through spring. Are you referring to it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2012 05:25 PM
Thanks for your support.
Can you let me know as to how I can set the lockTimeInMillis parameter through program instead of the activiti.cfg.xml