2 Replies Latest reply on Nov 9, 2012 10:39 AM by Maciej Swiderski

    EntityNotFoundException: Unable to find org.jbpm.task.User with id group1

    sftzptrck Newbie

      I am using JBPM 5.3 and trying to get all tasks assigned to a specific group using getTasksAssignedAsPotentialOwner.

       

      List<String> groups = new ArrayList<String>();
      groups.add("group1");
      BlockingTaskSummaryResponseHandler taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
      taskClient.getTasksAssignedAsPotentialOwner(user, groups, "en-UK", taskSummaryResponseHandler);
      List <TaskSummary> tasks = taskSummaryResponseHandler.getResults();
      return this.convertTasks(tasks);
      

       

      I am getting an EntityNotFoundException because it looks like its searching for users based on my group name.

       

      Hibernate: select task0_.id as col_0_0_, task0_.processInstanceId as col_1_0_, names5_.text as col_2_0_, subjects3_.text as col_3_0_, descriptio4_.text as col_4_0_, task0_.status as col_5_0_, task0_.priority as col_6_0_, task0_.skipable as col_7_0_, task0_.actualOwner_id as col_8_0_, task0_.createdBy_id as col_9_0_, task0_.createdOn as col_10_0_, task0_.activationTime as col_11_0_, task0_.expirationTime as col_12_0_, task0_.processId as col_13_0_, task0_.processSessionId as col_14_0_ from Task task0_ left outer join OrganizationalEntity user1_ on task0_.createdBy_id=user1_.id left outer join OrganizationalEntity user2_ on task0_.actualOwner_id=user2_.id left outer join I18NText subjects3_ on task0_.id=subjects3_.Task_Subjects_Id left outer join I18NText descriptio4_ on task0_.id=descriptio4_.Task_Descriptions_Id left outer join I18NText names5_ on task0_.id=names5_.Task_Names_Id inner join OrganizationalEntity user7_ on task0_.actualOwner_id=user7_.id inner join OrganizationalEntity user8_ on task0_.createdBy_id=user8_.id cross join OrganizationalEntity organizati6_ where task0_.archived=0 and (organizati6_.id=? or organizati6_.id in (?)) and (organizati6_.id in (select potentialo9_.entity_id from PeopleAssignments_PotOwners potentialo9_ where task0_.id=potentialo9_.task_id)) and (names5_.language=? or (select count(names10_.Task_Names_Id) from I18NText names10_ where task0_.id=names10_.Task_Names_Id)=0) and (subjects3_.language=? or (select count(subjects11_.Task_Subjects_Id) from I18NText subjects11_ where task0_.id=subjects11_.Task_Subjects_Id)=0) and (descriptio4_.language=? or (select count(descriptio12_.Task_Descriptions_Id) from I18NText descriptio12_ where task0_.id=descriptio12_.Task_Descriptions_Id)=0) and (task0_.status in ('Created' , 'Ready' , 'Reserved' , 'InProgress' , 'Suspended')) and (task0_.expirationTime is null)
      Hibernate: select user0_.id as id9_0_ from OrganizationalEntity user0_ where user0_.id=? and user0_.DTYPE='User'
      javax.persistence.EntityNotFoundException: Unable to find org.jbpm.task.User with id group1
          at org.hibernate.ejb.Ejb3Configuration$Ejb3EntityNotFoundDelegate.handleEntityNotFound(Ejb3Configuration.java:137)
          at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:233)
          at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
          at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
          at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)
          at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1038)
          at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:630)
          at org.hibernate.type.EntityType.resolve(EntityType.java:438)
          at org.hibernate.type.EntityType.nullSafeGet(EntityType.java:234)
          at org.hibernate.loader.hql.QueryLoader.getResultColumnOrRow(QueryLoader.java:407)
          at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:639)
          at org.hibernate.loader.Loader.doQuery(Loader.java:829)
          at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
          at org.hibernate.loader.Loader.doList(Loader.java:2542)
          at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
          at org.hibernate.loader.Loader.list(Loader.java:2271)
          at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:459)
          at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:365)
          at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
          at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
          at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
          at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:246)
          at org.jbpm.task.service.TaskServiceSession.getTasksAssignedAsPotentialOwner(TaskServiceSession.java:730)
          at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:375)
          at org.jbpm.task.service.mina.MinaTaskServerHandler.messageReceived(MinaTaskServerHandler.java:41)
          at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713)
          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
          at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:375)
          at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:229)
          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
          at org.apache.mina.filter.logging.LoggingFilter.messageReceived(LoggingFilter.java:176)
          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
          at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)
          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
          at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)
          at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:638)
          at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598)
          at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587)
          at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61)
          at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969)
          at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:662)
      

       

      I have made sure to add all of my users and groups to the TaskServiceSession.

       

      What am I doing wrong?