cancel
Showing results for 
Search instead for 
Did you mean: 

Multi Instance java.lang.Double cannot be cast to java.lang.Integer

ashendra1
Champ in-the-making
Champ in-the-making
I recently upgraded my activiti-engine to the newer version 5.15. In my bpmn I have a multi-instance subprocess. There is no completion condition set. So by default the execution ends when all the instances are completed. When the last execution ends, it throws this exception.

Caused by: java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer
   at org.activiti.engine.impl.bpmn.behavior.MultiInstanceActivityBehavior.getLoopVariable(MultiInstanceActivityBehavior.java:229)
   at org.activiti.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior.leave(ParallelMultiInstanceBehavior.java:105)
   at org.activiti.engine.impl.bpmn.behavior.MultiInstanceActivityBehavior.lastExecutionEnded(MultiInstanceActivityBehavior.java:109)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityEnd.eventNotificationsCompleted(AtomicOperationActivityEnd.java:81)
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:90)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:571)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:566)
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:90)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:571)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:566)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.end(ExecutionEntity.java:367)
   at org.activiti.engine.impl.bpmn.behavior.NoneEndEventActivityBehavior.execute(NoneEndEventActivityBehavior.java:24)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:54)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:90)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:571)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:566)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52)
   
I check the  variable history table and there the type is 1 but it is loading as 1.0 in MultiInstanceActivityBehavior.
| ID_   | PROC_INST_ID_ | EXECUTION_ID_ | TASK_ID_ | NAME_         | VAR_TYPE_ | REV_ | BYTEARRAY_ID_ | DOUBLE_ | LONG_ | TEXT_ | TEXT2_ 11100 | 11084         | 11098         | NULL     | nrOfInstances | integer   |    0 | NULL          |    NULL |     1 | 1     | NULL   | 2014-04-06 | CREATE_TIME_        | LAST_UPDATED_TIME_ 
20:57:02 | 2014-04-06 20:57:02

Can anyone help in this.

Ashendra
3 REPLIES 3

ashendra1
Champ in-the-making
Champ in-the-making
I found out that something broke from schema upgrade. When i started with fresh database, this error did not occurred.

trademak
Star Contributor
Star Contributor
We are not aware of such an issue, and we do have upgrade tests specifically for multi instance. Is it something you can reproduce in any way?

Thanks,

jbarrez
Star Contributor
Star Contributor
Could it be you also upgraded your JDK? We do have some issues on JDK 8 with the new Rhino engine.