AnsweredAssumed Answered

Error setting null for parameter #1 with JdbcType OTHER

Question asked by gi00vani_kun on May 19, 2015
Latest reply on May 26, 2015 by gi00vani_kun
I'm trying to create a new task on an complete event

<activiti:taskListener event="complete" class="ec.eu.activiti.listener.UserListener"></activiti:taskListener>

Java Code below :


ProcessEngine processEngine = ProcessEngines
            .getDefaultProcessEngine();
      TaskService taskService = processEngine.getTaskService();   
      SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");
       Task task = taskService.newTask();
       task.setDescription("description 12131");
       task.setName("taskname 2121");
       task.setPriority(50);
       task.setAssignee("dataexpert2");
       task.setOwner("dataexpert2");
       Date dueDate;
      try {
      dueDate = sdf.parse("01/05/2015 04:05:06");
      task.setDueDate(dueDate);
           
      } catch (ParseException e1) {
         // TODO Auto-generated catch block
         e1.printStackTrace();
      }
      taskService.saveTask(task);


Error resulted :
<blockcode>
Caused by: org.activiti.engine.ActivitiException: Exception while invoking TaskListener:
### Error querying database.  Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: Invalid column type: 1111
### The error may exist in org/activiti/db/mapping/entity/HistoricTaskInstance.xml
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: select * from ACT_HI_TASKINST where ID_ = ?
### Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: Invalid column type: 1111
   at org.activiti.engine.impl.bpmn.helper.ClassDelegate.notify(ClassDelegate.java:109)
   at org.activiti.engine.impl.delegate.TaskListenerInvocation.invoke(TaskListenerInvocation.java:34)
   at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37)
   at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25)
   at org.activiti.engine.impl.persistence.entity.TaskEntity.fireEvent(TaskEntity.java:723)
   … 61 more
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: Invalid column type: 1111
### The error may exist in org/activiti/db/mapping/entity/HistoricTaskInstance.xml
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: select * from ACT_HI_TASKINST where ID_ = ?
### Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: Invalid column type: 1111
   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:62)
   at org.activiti.engine.impl.db.DbSqlSession.selectById(DbSqlSession.java:457)
   at org.activiti.engine.impl.history.DefaultHistoryManager.recordTaskDescriptionChange(DefaultHistoryManager.java:468)
   at org.activiti.engine.impl.persistence.entity.TaskEntity.setDescription(TaskEntity.java:501)
   at ec.eu.activiti.listener.UserListener.notify(UserListener.java:63)
   at org.activiti.engine.impl.delegate.TaskListenerInvocation.invoke(TaskListenerInvocation.java:34)
   at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37)
   at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25)
   at org.activiti.engine.impl.bpmn.helper.ClassDelegate.notify(ClassDelegate.java:105)
</blockcode>

Outcomes