AnsweredAssumed Answered

insert into ACT_RU_VARIABLE failing with java.lang.IllegalArgumentException: NaN

Question asked by espe on May 28, 2017
Latest reply on Jun 6, 2017 by



I have a pretty much big process with approximately 1.000 steps. When I start the process I get the following exception:


### Error updating database. Cause: java.lang.IllegalArgumentException: NaN
### The error may involve org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.insertVariableInstance-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RU_VARIABLE (ID_, REV_, TYPE_, NAME_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_) values ( ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
### Cause: java.lang.IllegalArgumentException: NaN
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(
at org.activiti.engine.impl.db.DbSqlSession.flushInserts(
at org.activiti.engine.impl.db.DbSqlSession.flush(
Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalArgumentException: NaN
at oracle.jdbc.driver.OraclePreparedStatement.setDoubleInternal(
at oracle.jdbc.driver.OraclePreparedStatement.setDouble(
at oracle.jdbc.driver.OraclePreparedStatementWrapper.setDouble(
at org.apache.ibatis.type.DoubleTypeHandler.setNonNullParameter(
at org.apache.ibatis.type.DoubleTypeHandler.setNonNullParameter(
Truncated. see log file for complete stacktrace


Now, the interesting part is that it fails randomly. It can fail on step 2, or even step 999. It can even complete the whole process successfully and then fail after it has completed. I can assure you that the data remain exactly the same between different executions.

The process consists exclusively of service tasks (no human actors) which perform some calculations. So the result variables which are stored in activiti variables are mainly numbers or arrays of numbers (which can reach large sizes - e.g. 8.000).

I am working with Activiti version 5.17.0 on an Oracle 12c database.


Any ideas? I am thinking of performance issues. I make a calculation, then Activiti takes too much time to write the result into the database but the next step tries to retrieve the same value. Are steps being executed sequentially? For sure I am not using any parallelism components (split and join etc)