Defect #2542
closedImporting automatic roles by tree nodes may fail for multiple roles (AcceptedException in ImportAutomaticRoleForTreeNodeFromCSVExecutor)
100%
Description
Importing automatic roles by tree nodes may fail for multiple roles (= some of them are not processed) when using extras 2.6.0 with product 10.4.8.
Maybe the same issue will happen when using other versions of the product.
The reason is that ImportAutomaticRoleForTreeNodeFromCSVExecutor saves them directly. But after some issues fixed in versions 10.4.x and 10.5.x (e.g. #2524), multiple automatic roles can not be processed at the same time, so they are processed one by one (the corresponding ProcessAutomaticRoleByTreeTaskExecutor wait for each other in the LRT queue) and the save method throws AcceptedException.
After consultation with Vítek, the reliable way to create automatic roles is using automatic role requests.
There is a helping method automaticRoleManager.createAutomaticRoleByTree.
The exception thrown by ImportAutomaticRoleForTreeNodeFromCSVExecutor when this happens on 10.4.8:
eu.bcvsolutions.idm.core.api.exception.AcceptedException: at eu.bcvsolutions.idm.core.model.service.impl.DefaultIdmRoleTreeNodeService.save(DefaultIdmRoleTreeNodeService.java:107) at eu.bcvsolutions.idm.core.model.service.impl.DefaultIdmRoleTreeNodeService.save(DefaultIdmRoleTreeNodeService.java:57) at eu.bcvsolutions.idm.core.model.service.impl.DefaultIdmRoleTreeNodeService$$FastClassBySpringCGLIB$$b5b44e46.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) at eu.bcvsolutions.idm.core.model.service.impl.DefaultIdmRoleTreeNodeService$$EnhancerBySpringCGLIB$$ac263aab.save(<generated>) at eu.bcvsolutions.idm.extras.scheduler.task.impl.ImportAutomaticRoleForTreeNodeFromCSVExecutor.createRoleTreeNode(ImportAutomaticRoleForTreeNodeFromCSVExecutor.java:135)