[midPoint] The OID is null and filter could not be evaluated in assignment targetRef in org

Lubomir Odlevak odlevak.lubomir at gmail.com
Mon May 4 18:20:17 CEST 2020


I upgraded mP from 3.6.1 to 4.1 . I have a problem with role assignment in
4.1. MP created assignment without targetRef atribute. I have the following
TC:
1) I create organization unit and metarole is automatically assigned for OU
(defined in object template)
2) Metarole contains inducement to assign another read role to OU. In case
that read role does not exists it create it (createOnDemand ) and assign it
to OU.
3) Metarole is assigned automatically, read role is created ok,  but
assignemnt is NOT added successfully and I've got the following error:
com.evolveum.midpoint.util.exception.SchemaException: The OID is null and
filter could not be evaluated in assignment targetRef in
org:2d4af0f0-7297-4c72-a445-6f70d8e98a8a(88888833) at
com.evolveum.midpoint.model.impl.lens.AssignmentEvaluator.resolveTargetsFromFilter(AssignmentEvaluator.java:756)
at
com.evolveum.midpoint.model.impl.lens.AssignmentEvaluator.resolveTargets(AssignmentEvaluator.java:720)
at
com.evolveum.midpoint.model.impl.lens.AssignmentEvaluator.getTargets(AssignmentEvaluator.java:681)
at
com.evolveum.midpoint.model.impl.lens.AssignmentEvaluator.evaluateSegmentContent(AssignmentEvaluator.java:506)
at
com.evolveum.midpoint.model.impl.lens.AssignmentEvaluator.evaluateFromSegment(AssignmentEvaluator.java:401)
at
com.evolveum.midpoint.model.impl.lens.AssignmentEvaluator.evaluate(AssignmentEvaluator.java:270)
at
com.evolveum.midpoint.model.impl.lens.projector.focus.AssignmentTripleEvaluator.evaluateAssignment(AssignmentTripleEvaluator.java:577)
at
com.evolveum.midpoint.model.impl.lens.projector.focus.AssignmentTripleEvaluator.processAssignment(AssignmentTripleEvaluator.java:377)
at
com.evolveum.midpoint.model.impl.lens.projector.focus.AssignmentTripleEvaluator.processAllAssignments(AssignmentTripleEvaluator.java:223)
at
com.evolveum.midpoint.model.impl.lens.projector.focus.AssignmentProcessor.processAssignmentsProjectionsWithFocus(AssignmentProcessor.java:211)
at
com.evolveum.midpoint.model.impl.lens.projector.focus.AssignmentProcessor.processAssignments(AssignmentProcessor.java:137)
at
com.evolveum.midpoint.model.impl.lens.projector.focus.AssignmentHolderProcessor.lambda$processFocusFocus$4(AssignmentHolderProcessor.java:254)
at
com.evolveum.midpoint.model.impl.lens.ClockworkMedic.partialExecute(ClockworkMedic.java:211)
at
com.evolveum.midpoint.model.impl.lens.ClockworkMedic.partialExecute(ClockworkMedic.java:154)
at
com.evolveum.midpoint.model.impl.lens.projector.focus.AssignmentHolderProcessor.processFocusFocus(AssignmentHolderProcessor.java:253)
at
com.evolveum.midpoint.model.impl.lens.projector.focus.AssignmentHolderProcessor.processFocus(AssignmentHolderProcessor.java:101)
at
com.evolveum.midpoint.model.impl.lens.projector.Projector.lambda$projectInternal$1(Projector.java:221)
at
com.evolveum.midpoint.model.impl.lens.ClockworkMedic.partialExecute(ClockworkMedic.java:211)
at
com.evolveum.midpoint.model.impl.lens.ClockworkMedic.partialExecute(ClockworkMedic.java:154)
at
com.evolveum.midpoint.model.impl.lens.projector.Projector.projectInternal(Projector.java:219)
at
com.evolveum.midpoint.model.impl.lens.projector.Projector.project(Projector.java:95)
at
com.evolveum.midpoint.model.impl.lens.Clockwork.click(Clockwork.java:587)
at com.evolveum.midpoint.model.impl.lens.Clockwork.run(Clockwork.java:204)
at
com.evolveum.midpoint.model.impl.controller.ModelController.executeChangesNonRaw(ModelController.java:421)
at
com.evolveum.midpoint.model.impl.controller.ModelController.executeChanges(ModelController.java:389)
at jdk.internal.reflect.GeneratedMethodAccessor1476.invoke(Unknown Source)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566) at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at
com.evolveum.midpoint.util.aspect.MidpointInterceptor.invoke(MidpointInterceptor.java:32)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy147.executeChanges(Unknown Source) at
com.evolveum.midpoint.web.component.progress.ProgressPanel$14.callWithContextPrepared(ProgressPanel.java:668)
at
com.evolveum.midpoint.web.component.progress.ProgressPanel$14.callWithContextPrepared(ProgressPanel.java:654)
at
com.evolveum.midpoint.web.component.SecurityContextAwareCallable.call(SecurityContextAwareCallable.java:50)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

There is "n/a" assignment on the created OU and there is missing targetRef
attribute in xml assignment code:
    <assignment id="2">
        <metadata>

<requestTimestamp>2020-05-04T16:21:04.377+02:00</requestTimestamp>
            <requestorRef oid="00000000-0000-0000-0000-000000000002"
relation="org:default" type="c:UserType">
                <!-- administrator -->
            </requestorRef>
            <createTimestamp>2020-05-04T16:21:04.514+02:00</createTimestamp>
            <creatorRef oid="00000000-0000-0000-0000-000000000002"
relation="org:default" type="c:UserType">
                <!-- administrator -->
            </creatorRef>
            <createChannel>
http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user
</createChannel>
            <originMappingName>Add READ Role</originMappingName>
        </metadata>
        <targetRef relation="org:default" type="c:RoleType"/>
        <activation>
            <effectiveStatus>enabled</effectiveStatus>
        </activation>
    </assignment>

Metarole contains following inducement to role assignment:
<inducement id="2">
        <focusMappings>
            <mapping id="4">
                <name>Add READ Role</name>
                <trace>true</trace>
                <strength>strong</strength>
                <source>
                    <c:path>name</c:path>
                </source>
                <source>
                    <c:path>displayName</c:path>
                </source>
                <expression>
                    <assignmentTargetSearch xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:c="
http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xsi:type="c:AssignmentTargetSearchExpressionEvaluatorType">
                        <targetType>c:RoleType</targetType>
                        <filter>
                            <q:equal>
                                <q:path xmlns:c="
http://midpoint.evolveum.com/xml/ns/public/common/common-3">c:name</q:path>
                                <q:matching>polyStringOrig</q:matching>
                                <expression>
                                    <script>
                                        <code>name + '_r'</code>
                                    </script>
                                </expression>
                            </q:equal>
                        </filter>
                        <createOnDemand>true</createOnDemand>
                        <populateObject>
                            <populateItem>
                                <expression>
                                    <script xmlns:c="
http://midpoint.evolveum.com/xml/ns/public/common/common-3" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:type="c:ScriptExpressionEvaluatorType">
                                        <code>
name + '_r'
</code>
                                    </script>
                                </expression>
                                <target>
                                    <c:path>name</c:path>
                                </target>
                            </populateItem>
                            <populateItem>
                                <expression>
                                    <script xmlns:c="
http://midpoint.evolveum.com/xml/ns/public/common/common-3" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:type="c:ScriptExpressionEvaluatorType">
                                        <code>
displayName + '(' + name +')_r'
</code>
                                    </script>
                                </expression>
                                <target>
                                    <c:path>displayName</c:path>
                                </target>
                            </populateItem>
                            <populateItem>
                                <expression>
                                    <value>LOC</value>
                                </expression>
                                <target>
                                    <c:path>subtype</c:path>
                                </target>
                            </populateItem>
                        </populateObject>
                    </assignmentTargetSearch>
                </expression>
                <target>
                    <c:path>assignment</c:path>
                </target>
            </mapping>
        </focusMappings>
    </inducement>

I also have tried mentioned TC on non-migrated and clean mP 4.1 and there
works everything OK.
 Any idea what  should check ?  Why midpoint is allowed to create
assignment without targetRef atribut ?

Thanks
Lubomir Odlevak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20200504/15d3d4b8/attachment.htm>


More information about the midPoint mailing list