AnsweredAssumed Answered

Problem with createTaskQuery().taskCandidateGroup and user

Question asked by cweber on Jun 27, 2012
Latest reply on Apr 16, 2013 by jbarrez
Hi everybody.
I got a problem by using
return taskService.createTaskQuery().taskCandidateGroup("sales").list();
and
return taskService.createTaskQuery().taskCandidateUser("kermit").list();

If I run this commands from eclipse with contacting the h2 database from the activiti demo 5.9 on my computer it works allright.
But I copied the  "apps\h2" folder from the demo into a virtual maschine.

There I also can run different commands like…
taskService.createTaskQuery().taskAssignee(pUserId).list();

but if I try to run this…
return taskService.createTaskQuery().taskCandidateGroup("sales").list();

I got the following error.
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'candidateGroups != null && candidateGroups.size() > 0'. Cause: org.apache.ibatis.ognl.MethodFailedException: Method "size" failed for object [sales] [java.lang.IllegalAccessException: Method [public int java.util.Collections$SingletonList.size()] cannot be accessed.]
### The error may exist in org/activiti/db/mapping/entity/Task.xml
### The error may involve org.activiti.engine.impl.persistence.entity.TaskEntity.selectTaskByQueryCriteria
### The error occurred while executing a query
### Cause: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'candidateGroups != null && candidateGroups.size() > 0'. Cause: org.apache.ibatis.ognl.MethodFailedException: Method "size" failed for object [sales] [java.lang.IllegalAccessException: Method [public int java.util.Collections$SingletonList.size()] cannot be accessed.]
    org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
    org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:81)
    org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:73)
    org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:188)
    org.activiti.engine.impl.persistence.entity.TaskManager.findTasksByQueryCriteria(TaskManager.java:91)
    org.activiti.engine.impl.TaskQueryImpl.executeList(TaskQueryImpl.java:368)
    org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:138)
    org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
    org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
    org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
    org.activiti.engine.impl.AbstractQuery.list(AbstractQuery.java:112)
    de.mettenmeier.activiti.engine.MBSActivitiTask.getAllFreeTasksForGroup(MBSActivitiTask.java:72)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    java.lang.reflect.Method.invoke(Method.java:611)
    com.ibm.jscript.types.JavaAccessObject.call(JavaAccessObject.java:321)
    com.ibm.jscript.types.FBSObject.call(FBSObject.java:161)
    com.ibm.jscript.ASTTree.ASTCall.interpret(ASTCall.java:175)
    com.ibm.jscript.ASTTree.ASTProgram.interpret(ASTProgram.java:119)
    com.ibm.jscript.ASTTree.ASTProgram.interpretEx(ASTProgram.java:139)
    com.ibm.jscript.JSExpression._interpretExpression(JSExpression.java:435)
    com.ibm.jscript.JSExpression.access$1(JSExpression.java:424)
    com.ibm.jscript.JSExpression$2.run(JSExpression.java:414)
    java.security.AccessController.doPrivileged(AccessController.java:284)
    com.ibm.jscript.JSExpression.interpretExpression(JSExpression.java:410)
    com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:251)
    com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:234)
    com.ibm.xsp.javascript.JavaScriptInterpreter.interpret(JavaScriptInterpreter.java:221)
    com.ibm.xsp.javascript.JavaScriptInterpreter.interpret(JavaScriptInterpreter.java:193)
    com.ibm.xsp.binding.javascript.JavaScriptValueBinding.getValue(JavaScriptValueBinding.java:78)
    com.ibm.xsp.component.UIDataEx.resolveValue(UIDataEx.java:371)
    com.ibm.xsp.component.UIDataEx._createDataModel(UIDataEx.java:209)
    com.ibm.xsp.component.UIDataEx.createDataModel(UIDataEx.java:162)
    com.ibm.xsp.component.UIDataEx.getDataModel(UIDataEx.java:136)
    com.ibm.xsp.renderkit.html_extended.DataTableRendererEx.encodeChildren(DataTableRendererEx.java:1347)
    com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildren(ReadOnlyAdapterRenderer.java:162)
    javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:979)
    com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:842)
    com.ibm.xsp.renderkit.html_extended.TabbedPanelRenderer.encodeChildren(TabbedPanelRenderer.java:272)
    com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildren(ReadOnlyAdapterRenderer.java:162)
    javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:979)
    com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:842)
    com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:851)
    com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:851)
    com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:851)
    com.ibm.xsp.component.UIViewRootEx._renderView(UIViewRootEx.java:1317)
    com.ibm.xsp.component.UIViewRootEx.renderView(UIViewRootEx.java:1255)
    com.ibm.xsp.application.ViewHandlerExImpl.doRender(ViewHandlerExImpl.java:641)
    com.ibm.xsp.application.ViewHandlerExImpl._renderView(ViewHandlerExImpl.java:320)
    com.ibm.xsp.application.ViewHandlerExImpl.renderView(ViewHandlerExImpl.java:335)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:103)
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:120)
    com.ibm.xsp.controller.FacesControllerImpl.render(FacesControllerImpl.java:264)
    com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:248)
    com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:204)
    com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
    com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
    com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1281)
    com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:847)
    com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1265)
    com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:653)
    com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:476)
    com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:341)
    com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:297)
    com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
org.apache.ibatis.builder.BuilderException: Error evaluating expression 'candidateGroups != null && candidateGroups.size() > 0'. Cause: org.apache.ibatis.ognl.MethodFailedException: Method "size" failed for object [sales] [java.lang.IllegalAccessException: Method [public int java.util.Collections$SingletonList.size()] cannot be accessed.]
    org.apache.ibatis.builder.xml.dynamic.ExpressionEvaluator.evaluateBoolean(ExpressionEvaluator.java:23)
    org.apache.ibatis.builder.xml.dynamic.IfSqlNode.apply(IfSqlNode.java:15)
    org.apache.ibatis.builder.xml.dynamic.MixedSqlNode.apply(MixedSqlNode.java:14)
    org.apache.ibatis.builder.xml.dynamic.IfSqlNode.apply(IfSqlNode.java:16)
    org.apache.ibatis.builder.xml.dynamic.MixedSqlNode.apply(MixedSqlNode.java:14)
    org.apache.ibatis.builder.xml.dynamic.TrimSqlNode.apply(TrimSqlNode.java:27)
    org.apache.ibatis.builder.xml.dynamic.MixedSqlNode.apply(MixedSqlNode.java:14)
    org.apache.ibatis.builder.xml.dynamic.MixedSqlNode.apply(MixedSqlNode.java:14)
    org.apache.ibatis.builder.xml.dynamic.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:22)
    org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:198)
    org.apache.ibatis.executor.BaseExecutor.createCacheKey(BaseExecutor.java:142)
    org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:112)
    org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:72)
    org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:79)
    org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:73)
    org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:188)
    org.activiti.engine.impl.persistence.entity.TaskManager.findTasksByQueryCriteria(TaskManager.java:91)
    org.activiti.engine.impl.TaskQueryImpl.executeList(TaskQueryImpl.java:368)
    org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:138)
    org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
    org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
    org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
    org.activiti.engine.impl.AbstractQuery.list(AbstractQuery.java:112)
    de.mettenmeier.activiti.engine.MBSActivitiTask.getAllFreeTasksForGroup(MBSActivitiTask.java:72)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    java.lang.reflect.Method.invoke(Method.java:611)
    com.ibm.jscript.types.JavaAccessObject.call(JavaAccessObject.java:321)
    com.ibm.jscript.types.FBSObject.call(FBSObject.java:161)
    com.ibm.jscript.ASTTree.ASTCall.interpret(ASTCall.java:175)
    com.ibm.jscript.ASTTree.ASTProgram.interpret(ASTProgram.java:119)
    com.ibm.jscript.ASTTree.ASTProgram.interpretEx(ASTProgram.java:139)
    com.ibm.jscript.JSExpression._interpretExpression(JSExpression.java:435)


Any idea what I have to do to get it work on the copy of the database? (as I said: the other queries work on that)

Outcomes