AnsweredAssumed Answered

need help:about runtimeService.startProcessInstanceByKey(key,businessID,map)

Question asked by liuhuaqing on Apr 27, 2016
Latest reply on Apr 29, 2016 by liuhuaqing
about the map
my map:
                String str1="test1";
      String str2="test2";
      String str3="test3";
   
      map.put(str1, str1);
      map.put(str2, str2);
      map.put(str3, str3);



1   when i put one parameter in map ,it works fine。
2   when i put one more parameters in map,occur  error 。

thank you inadvance.

the erro :
Error updating database.  Cause: java.sql.SQLException: Invalid argument value: java.io.NotSerializableException
### The error may involve org.activiti.engine.impl.persistence.entity.HistoricVariableInstanceEntity.bulkInsertHistoricVariableInstance-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_HI_VARINST (ID_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, NAME_, REV_, VAR_TYPE_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_, CREATE_TIME_, LAST_UPDATED_TIME_)     values                   (?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?)         ,          (?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?)
### Cause: java.sql.SQLException: Invalid argument value: java.io.NotSerializableException
   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:147)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:134)
   at org.activiti.engine.impl.db.DbSqlSession.flushBulkInsert(DbSqlSession.java:850)
   at org.activiti.engine.impl.db.DbSqlSession.flushPersistentObjects(DbSqlSession.java:820)
   at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:797)
   at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:618)
   at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:212)
   at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:138)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
   at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:84)
   at demo.EngineController.startProcess(EngineController.java:58)
   at demo.Test.testStartProcess(Test.java:52)
   at demo.Test.main(Test.java:30)
Caused by: java.sql.SQLException: Invalid argument value: java.io.NotSerializableException
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
   at com.mysql.jdbc.PreparedStatement.setSerializableObject(PreparedStatement.java:4412)
   at com.mysql.jdbc.PreparedStatement.setObject(PreparedStatement.java:4083)
   at org.apache.ibatis.type.ObjectTypeHandler.setNonNullParameter(ObjectTypeHandler.java:28)
   at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:46)
   at org.apache.ibatis.type.UnknownTypeHandler.setNonNullParameter(UnknownTypeHandler.java:37)
   at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:46)
   at org.apache.ibatis.executor.parameter.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:91)
   at org.apache.ibatis.executor.statement.PreparedStatementHandler.parameterize(PreparedStatementHandler.java:77)
   at org.apache.ibatis.executor.statement.RoutingStatementHandler.parameterize(RoutingStatementHandler.java:58)
   at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:71)
   at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:44)
   at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:108)
   at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:145)
   … 15 more
Caused by: java.io.NotSerializableException: org.activiti.engine.impl.variable.StringType
   at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
   at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
   at com.mysql.jdbc.PreparedStatement.setSerializableObject(PreparedStatement.java:4401)
   … 28 more

Outcomes