AnsweredAssumed Answered

useing   taskService.complete(task.getId()) Occur exception?

Question asked by sunxinzi on Jun 27, 2011
Latest reply on Jun 27, 2011 by frederikheremans1
when useing   taskService.complete(task.getId()) Occur exception?  request help me,thanks!

detail informatiion:
activiti.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans.xsd">

  <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration"> 
    <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/activiti?autoReconnect=true" />
    <property name="jdbcDriver" value="com.mysql.jdbc.Driver" />
    <property name="jdbcUsername" value="root" />
    <property name="jdbcPassword" value="root" />
    <property name="databaseType" value="mysql"></property>   
    <!– Database configurations –>
    <property name="databaseSchemaUpdate" value="false" />   
    <!– job executor configurations –>
    <property name="jobExecutorActivate" value="false" />
   
    <!– mail server configurations
    <property name="mailServerPort" value="5025" />  –>  
  </bean>

</beans>

code:
//完成任务
   public String completeapply() throws Exception{
      
      TaskService    taskService = this.processEngine.getTaskService();
      
      taskService.complete(this.taskId);
      
      
      return SUCCESS;
   }
exception detail information:
严重: Error while closing command context
org.activiti.engine.ActivitiException: Cannot find task with id 5435
   at org.activiti.engine.impl.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:45)
   at org.activiti.engine.impl.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:27)
   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.TaskServiceImpl.complete(TaskServiceImpl.java:138)
   at com.test.action.PrecessDefAction.completeapply(PrecessDefAction.java:104)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

Outcomes