Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-20113

Infinite recursion StackOverFlow error while using groupServiceImpl or userService in expressions

    Details

    • Bug Priority:
      Category 1
    • ACT Numbers:

      00976451, 00974304

      Description

      Summary
      While using the userService or groupServiceImpl in an expression to assign parallel multi-instance user tasks to all members of a specific group, an infinite recursion StackOverFlow error is thrown similar to the following:

      06:59:50 [http-nio-8443-exec-3] WARN  com.activiti.service.reporting.eventhandler.AbstractActivitiEventHandler --MDC--  --MDC-- - Could not serialize event data. Data will not be written to the database
      com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: org.hibernate.collection.internal.PersistentSet[0]->com.activiti.domain.idm.User["groups"]->org.hibernate.collection.internal.PersistentBag[0]->com.activiti.domain.idm.Group["users"]->
      org.hibernate.collection.internal.PersistentSet[0]->com.activiti.domain.idm.User["groups"]->org.hibernate.collection.internal.PersistentBag[0]->com.activiti.domain.idm.Group["users"]->
      org.hibernate.collection.internal.PersistentSet[0]->com.activiti.domain.idm.User["groups"]->org.hibernate.collection.internal.PersistentBag[0]->com.activiti.domain.idm.Group["users"]->
      org.hibernate.collection.internal.PersistentSet[0]->com.activiti.domain.idm.User["groups"]->org.hibernate.collection.internal.PersistentBag[0]->com.activiti.domain.idm.Group["users"]->
      org.hibernate.collection.internal.PersistentSet[0]->com.activiti.domain.idm.User["groups"]->org.hibernate.collection.internal.PersistentBag[0]->com.activiti.domain.idm.Group["users"]->
      org.hibernate.collection.internal.PersistentSet[0]->com.activiti.domain.idm.User["groups"]->org.hibernate.collection.internal.PersistentBag[0]->com.activiti.domain.idm.Group["users"]->
      org.hibernate.collection.internal.PersistentSet[0]->com.activiti.domain.idm.User["groups"]->org.hibernate.collection.internal.PersistentBag[0]->com.activiti.domain.idm.Group["users"]->
      org.hibernate.collection.internal.PersistentSet[0]->com.activiti.domain.idm.User["groups"]->org.hibernate.collection.internal.PersistentBag[0]->com.activiti.domain.idm.Group["users"]->
      ...
      	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:734)
      	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155)
      	at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents(CollectionSerializer.java:145)
      	at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:107)
      ...
      

      Steps to reproduce
      1. Make sure you have expression language and bean whitelisting disabled
      2. Login to activiti-app as admin
      3. Via Identity Management -> Users create some users, e.g. userA, userB and userC
      4. Via Identity Management -> Organization create a group "test" and add the users you created in previous step as group members
      5. Via App Designer create a new process: start event->user task->end event
      6. Define the properties for the user task as followed:

      Multi-instance type: Parallel
      Collection (Multi-instance): ${groupServiceImpl.getGroupByNameAndTenantId("test", 1).get(0).getUsers()} 
      Element variable (Multi-instance): user
      Assignee:${user.getId()} 
      

      NOTE: Above configuration means, that APS should create a new parallel user task, which is assigned to each member of the "test" group.
      7. Save process and create and publish an app containing the process
      8. From the published app on the landing page, start a new process
      9. Inspect the logs

      Expected behaviour
      Process starts and there are as many user tasks created as there are members in the group "test". Every group member has one task assigned. There are no errors in the APS logs.

      Current behaviour
      Process starts and there are as many user tasks created as there are members in the group "test". Every group member has one task assigned. The APS logs is full of errors similar to:

      06:59:50 [http-nio-8443-exec-3] WARN  com.activiti.service.reporting.eventhandler.AbstractActivitiEventHandler --MDC--  --MDC-- - Could not serialize event data. Data will not be written to the database
      com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) 
      ...
      

      Customer also complains that caused by this infinite recursion, in their case it takes up to 18 minutes for all parallel tasks to be created.

      Supporting evidence

        Attachments

          Structure

            Activity

              People

              • Assignee:
                mhowarth Mark Howarth
                Reporter:
                dkoch Dennis Koch
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Structure Helper Panel