AnsweredAssumed Answered

How to integrate activiti with struts2 query todo list?

Question asked by kafeitu on Nov 18, 2011
I want to query todo lists of current user, there are codes and configurations below.


package com.wsria.demo.activiti.web.activiti;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import org.activiti.engine.TaskService;
import org.activiti.engine.task.Task;
import org.activiti.engine.task.TaskQuery;
import org.apache.struts2.ServletActionContext;
import org.codehaus.jackson.map.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springside.modules.orm.Page;

import com.opensymphony.xwork2.ActionSupport;
import com.wsria.demo.activiti.util.account.UserUtil;

/**
* 流程查询
*
* @author HenryYan
*
*/
public class TaskQueryAction extends ActionSupport {

   private static final long serialVersionUID = 1L;

   protected Logger logger = LoggerFactory.getLogger(getClass());

   @Autowired
   TaskService taskService;

   private Page<Task> page = new Page<Task>();

   /**
    * running list
    * @return
    */
   public String runningList() {
      try {
         TaskQuery taskQuery = taskService.createTaskQuery().processDefinitionKey("leave")
               .taskCandidateUser(UserUtil.getCurrentUserId());
         List<Task> tasks = taskQuery.listPage(0, 10);
         page.setTotalCount(taskQuery.count());
         page.setResult(tasks);
         page.setTotalCount(tasks.size());
         Map<String, Object> result = new HashMap<String, Object>();
         result.put("page", page);

         ObjectMapper mapper = new ObjectMapper();
         HttpServletResponse response = ServletActionContext.getResponse();
         String fullContentType = "application/jso;charset=UTF-8";
         response.setContentType(fullContentType);
         mapper.writeValue(response.getWriter(), result);
      } catch (Exception e) {
         logger.error("读取运行中流程出错:{}", e);
      }
      return null;
   }

   public void setPage(Page<Task> page) {
      this.page = page;
   }

}

Activiti configuration with spring:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
   xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd"
   default-lazy-init="true">

   <description>Spring公共配置 </description>

   <!– 定义受环境影响易变的变量 –>
   <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
      <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
      <property name="ignoreResourceNotFound" value="true" />
      <property name="locations">
         <list>
            <!– 标准配置 –>
            <value>classpath*:/application.properties</value>
            <!– 和环境相关 –>
            <value>${env.spring.application.file}</value>
         </list>
      </property>
   </bean>

   <!– 使用annotation 自动注册bean,并保证@Required,@Autowired的属性被注入 –>
   <context:component-scan base-package="com.wsria.demo.activiti" />
   <!– 数据源配置,使用应用内的DBCP数据库连接池 –>
   <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
      <!– Connection Info –>
      <property name="driverClassName" value="${jdbc.driver}" />
      <property name="url" value="${jdbc.url}" />
      <property name="username" value="${jdbc.username}" />
      <property name="password" value="${jdbc.password}" />

      <!– Connection Pooling Info –>
      <property name="initialSize" value="${dbcp.initialSize}" />
      <property name="maxActive" value="${dbcp.maxActive}" />
      <property name="maxIdle" value="${dbcp.maxIdle}" />
      <property name="defaultAutoCommit" value="false" />
   </bean>

   <!– 数据源配置,使用应用服务器的数据库连接池 –>
   <!– <jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/ExampleDB" /> –>

   <!– Hibernate配置 –>
   <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
      <property name="dataSource" ref="dataSource" />
      <property name="namingStrategy">
         <bean class="org.hibernate.cfg.ImprovedNamingStrategy" />
      </property>
      <property name="hibernateProperties">
         <props>
            <prop key="hibernate.dialect">${hibernate.dialect}</prop>
            <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
            <prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
            <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
            <prop key="hibernate.cache.provider_configuration_file_resource_path">ehcache/ehcache-hibernate-local.xml</prop>
         </props>
      </property>
      <property name="packagesToScan" value="com.wsria.demo.activiti.entity" />
   </bean>

   <!– 注入SpringContextHolder –>
   <bean class="org.springside.modules.utils.spring.SpringContextHolder" lazy-init="false"></bean>

   <!– 事务管理器配置,单数据源事务 –>
   <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
      <property name="sessionFactory" ref="sessionFactory" />
   </bean>

   <!– 使用annotation定义事务 –>
   <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" />
   
   <!– activiti begin –>
   <bean id="jdbcTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
      <property name="dataSource" ref="dataSource" />
   </bean>

   <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
      <property name="dataSource" ref="dataSource" />
      <property name="transactionManager" ref="jdbcTransactionManager" />
      <property name="databaseSchemaUpdate" value="false" />
      <property name="jobExecutorActivate" value="false" />
      <property name="deploymentResources" value="classpath*:/com/wsria/demo/activiti/*.bpmn20.xml"></property>
   </bean>

   <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
      <property name="processEngineConfiguration" ref="processEngineConfiguration" />
   </bean>

   <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
   <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
   <bean id="formService" factory-bean="processEngine" factory-method="getFormService" />
   <bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" />
   <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
   <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
   <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
   <!– activiti end –>
</beans>

Sent a request use ajax(jquery), example:

$.getJSON('task-query!runningList.action', {
……
}, function(response) {

});

But recevied error infos:
2011-11-18 12:56:18,469 [http-9910-7] DEBUG [java.sql.Connection] - ooo Connection Opened
2011-11-18 12:56:18,741 [http-9910-7] DEBUG [java.sql.PreparedStatement] - ==>  Executing: select VALUE_ from ACT_GE_PROPERTY where NAME_ = 'schema.version'
2011-11-18 12:56:18,742 [http-9910-7] DEBUG [java.sql.PreparedStatement] - ==> Parameters:
2011-11-18 12:56:18,763 [http-9910-7] DEBUG [java.sql.ResultSet] - <==    Columns: VALUE_
2011-11-18 12:56:18,763 [http-9910-7] DEBUG [java.sql.ResultSet] - <==        Row: 5.8
2011-11-18 12:56:18,784 [http-9910-7] DEBUG [java.sql.PreparedStatement] - ==>  Executing: select * from ACT_GE_PROPERTY where NAME_ = ?
2011-11-18 12:56:18,786 [http-9910-7] DEBUG [java.sql.PreparedStatement] - ==> Parameters: historyLevel(String)
2011-11-18 12:56:18,788 [http-9910-7] DEBUG [java.sql.ResultSet] - <==    Columns: NAME_, VALUE_, REV_
2011-11-18 12:56:18,788 [http-9910-7] DEBUG [java.sql.ResultSet] - <==        Row: historyLevel, 2, 1
2011-11-18 12:56:18,794 [http-9910-7] DEBUG [java.sql.Connection] - xxx Connection Closed
Nov 18, 2011 12:56:18 PM org.activiti.engine.impl.ProcessEngineImpl <init>
INFO: ProcessEngine default created
2011-11-18 12:56:30,654 [http-9910-7] DEBUG [java.sql.Connection] - ooo Connection Opened
2011-11-18 12:56:30,732 [http-9910-7] DEBUG [java.sql.PreparedStatement] - ==>  Executing: select g.* from ACT_ID_GROUP g, ACT_ID_MEMBERSHIP membership where g.ID_ = membership.GROUP_ID_ and membership.USER_ID_ = ?
2011-11-18 12:56:30,733 [http-9910-7] DEBUG [java.sql.PreparedStatement] - ==> Parameters: billzheng(String)
2011-11-18 12:56:30,735 [http-9910-7] DEBUG [java.sql.ResultSet] - <==    Columns: ID_, REV_, NAME_, TYPE_
2011-11-18 12:56:30,735 [http-9910-7] DEBUG [java.sql.ResultSet] - <==        Row: generalManager, 1, 总经理, assignment
2011-11-18 12:56:30,736 [http-9910-7] DEBUG [java.sql.ResultSet] - <==        Row: departmentManager, 1, 部门经理, assignment
2011-11-18 12:56:30,762 [http-9910-7] DEBUG [java.sql.PreparedStatement] - ==>  Executing: select distinct T.* from ACT_RU_TASK T inner join ACT_RU_IDENTITYLINK I on I.TASK_ID_ = T.ID_ inner join ACT_RE_PROCDEF D on T.PROC_DEF_ID_ = D.ID_ WHERE D.KEY_ = ? and T.ASSIGNEE_ is null and I.TYPE_ = 'candidate' and ( I.USER_ID_ = ? or I.GROUP_ID_ IN ( ? , ? ) )
2011-11-18 12:56:30,762 [http-9910-7] DEBUG [java.sql.PreparedStatement] - ==> Parameters: leave(String), billzheng(String), generalManager(String), departmentManager(String)
2011-11-18 12:56:30,773 [http-9910-7] DEBUG [java.sql.ResultSet] - <==    Columns: ID_, REV_, EXECUTION_ID_, PROC_INST_ID_, PROC_DEF_ID_, NAME_, PARENT_TASK_ID_, DESCRIPTION_, TASK_DEF_KEY_, OWNER_, ASSIGNEE_, DELEGATION_, PRIORITY_, CREATE_TIME_, DUE_DATE_
2011-11-18 12:56:30,773 [http-9910-7] DEBUG [java.sql.ResultSet] - <==        Row: 4303, 1, 4301, 4301, leave:1:4012, 部门领导审核, null, null, usertask1, null, null, null, 50, 2011-11-15.23.32. 1. 198000000, null
2011-11-18 12:56:30,775 [http-9910-7] DEBUG [java.sql.Connection] - xxx Connection Closed
2011-11-18 12:56:30,776 [http-9910-7] DEBUG [java.sql.Connection] - ooo Connection Opened
2011-11-18 12:56:30,787 [http-9910-7] DEBUG [java.sql.PreparedStatement] - ==>  Executing: select g.* from ACT_ID_GROUP g, ACT_ID_MEMBERSHIP membership where g.ID_ = membership.GROUP_ID_ and membership.USER_ID_ = ?
2011-11-18 12:56:30,787 [http-9910-7] DEBUG [java.sql.PreparedStatement] - ==> Parameters: billzheng(String)
2011-11-18 12:56:30,789 [http-9910-7] DEBUG [java.sql.ResultSet] - <==    Columns: ID_, REV_, NAME_, TYPE_
2011-11-18 12:56:30,789 [http-9910-7] DEBUG [java.sql.ResultSet] - <==        Row: generalManager, 1, 总经理, assignment
2011-11-18 12:56:30,789 [http-9910-7] DEBUG [java.sql.ResultSet] - <==        Row: departmentManager, 1, 部门经理, assignment
2011-11-18 12:56:30,804 [http-9910-7] DEBUG [java.sql.PreparedStatement] - ==>  Executing: select count(distinct T.ID_) from ACT_RU_TASK T inner join ACT_RU_IDENTITYLINK I on I.TASK_ID_ = T.ID_ inner join ACT_RE_PROCDEF D on T.PROC_DEF_ID_ = D.ID_ WHERE D.KEY_ = ? and T.ASSIGNEE_ is null and I.TYPE_ = 'candidate' and ( I.USER_ID_ = ? or I.GROUP_ID_ IN ( ? , ? ) )
2011-11-18 12:56:30,804 [http-9910-7] DEBUG [java.sql.PreparedStatement] - ==> Parameters: leave(String), billzheng(String), generalManager(String), departmentManager(String)
2011-11-18 12:56:30,806 [http-9910-7] DEBUG [java.sql.ResultSet] - <==    Columns: COUNT(DISTINCTT.ID_)
2011-11-18 12:56:30,806 [http-9910-7] DEBUG [java.sql.ResultSet] - <==        Row: 1
2011-11-18 12:56:30,806 [http-9910-7] DEBUG [java.sql.Connection] - xxx Connection Closed
2011-11-18 12:56:30,901 [http-9910-7] ERROR [com.wsria.demo.activiti.web.activiti.TaskQueryAction] - 读取运行中流程出错:{}
org.codehaus.jackson.map.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: java.util.HashMap["page"]->org.springside.modules.orm.Page["result"]->java.util.ArrayList[0]->org.activiti.engine.impl.persistence.entity.TaskEntity["identityLinks"])
   at org.codehaus.jackson.map.JsonMappingException.wrapWithPath(JsonMappingException.java:215)
   at org.codehaus.jackson.map.JsonMappingException.wrapWithPath(JsonMappingException.java:180)
   at org.codehaus.jackson.map.ser.SerializerBase.wrapAndThrow(SerializerBase.java:99)
   at org.codehaus.jackson.map.ser.BeanSerializer.serializeFields(BeanSerializer.java:167)
   at org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer.java:131)
   at org.codehaus.jackson.map.ser.ContainerSerializers$IndexedListSerializer.serializeContents(ContainerSerializers.java:238)
   at org.codehaus.jackson.map.ser.ContainerSerializers$IndexedListSerializer.serializeContents(ContainerSerializers.java:190)
   at org.codehaus.jackson.map.ser.ContainerSerializers$AsArraySerializer.serialize(ContainerSerializers.java:112)
   at org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:268)
   at org.codehaus.jackson.map.ser.BeanSerializer.serializeFields(BeanSerializer.java:160)
   at org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer.java:131)
   at org.codehaus.jackson.map.ser.MapSerializer.serializeFields(MapSerializer.java:207)
   at org.codehaus.jackson.map.ser.MapSerializer.serialize(MapSerializer.java:140)
   at org.codehaus.jackson.map.ser.MapSerializer.serialize(MapSerializer.java:22)
   at org.codehaus.jackson.map.ser.StdSerializerProvider._serializeValue(StdSerializerProvider.java:297)
   at org.codehaus.jackson.map.ser.StdSerializerProvider.serializeValue(StdSerializerProvider.java:224)
   at org.codehaus.jackson.map.ObjectMapper._configAndWriteValue(ObjectMapper.java:1846)
   at org.codehaus.jackson.map.ObjectMapper.writeValue(ObjectMapper.java:1457)
   at com.wsria.demo.activiti.web.activiti.TaskQueryAction.runningList(TaskQueryAction.java:59)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)
   at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)
   at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
   at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
   at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
   at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
   at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
   at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
   at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
   at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at org.apache.struts2.interceptor.MessageStoreInterceptor.intercept(MessageStoreInterceptor.java:204)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
   at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:498)
   at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
   at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:102)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343)
   at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
   at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
   at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
   at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
   at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
   at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
   at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
   at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
   at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
   at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
   at com.wsria.demo.activiti.web.security.AutoLoginFilter.doFilter(AutoLoginFilter.java:44)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
   at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
   at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149)
   at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
   at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
   at org.activiti.engine.impl.persistence.entity.TaskEntity.getIdentityLinks(TaskEntity.java:342)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.codehaus.jackson.map.ser.BeanPropertyWriter.get(BeanPropertyWriter.java:285)
   at org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:240)
   at org.codehaus.jackson.map.ser.BeanSerializer.serializeFields(BeanSerializer.java:160)
   … 122 more

Outcomes