[midPoint] Error with inbound mapping in latest build.

Deepak Natarajan dnataraj at trilobytesystems.com
Mon Jun 23 08:51:51 CEST 2014


Hi Karatina / Ivan -

Many thanks for taking the time to look at this issue despite your busy
schedule.

I worked on it a bit more this weekend and I have managed to "avoid" the
error - rather than figure out the root cause and I think I have to
stick with this for now in order to proceed with what I was originally
doing.

It turns out that on my local environment (where this problem occurs) I
was using a 3.1-SNAPSHOT build of Midpoint against a 3.0 repository. I
am not sure what the consequences of this are (or whether the schema for
MySQL had any changes since 3.0 was released). But I did notice that
once I commented out the mapping below, other errors started appearing
(and strange exceptions such as "clob property type not supported for
...RRole" or something like that).

So I reverted to a 3.0 build, reset my repository, redeployed everything
from scratch from a clean slate, and the error vanished (I wanted to try
this as a last resort).

Thank you!

BR/Deepak
> Katarina Valalikova <mailto:k.valalikova at evolveum.com>
> June 20, 2014 at 9:50 AM
> Hi Deepak,
>
> I tried to replicate your problem but without success. I tested it
> with revision v3.0.1devel-19-gb708da1 . As Ivan stated, maybe the logs
> will be usefull to find out the reason.
>
> I used both of your mappings for tests. I added column "orgdesc" into
> the .csv file and fill it with different values (a/b/c, a/b, a, empty
> value, copy&paste of your value). Then I run import accounts. Accounts
> were imported, users created and no exception was thrown.
>
> Regards,
> Katarina Valalikova
>
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
> Ivan Noris <mailto:ivan.noris at evolveum.com>
> June 20, 2014 at 12:20 AM
> Hi Deepak,
>
> this is strange, by looking at:
>
>> I fiddled around and changed it to this :
>>
>>                     <ref>ri:orgdesc</ref>
>>                     <inbound>
>>                         <expression>
>>                             <script>
>>                                 <code>
>>                                     return input?.split("/")?.last()
>>                                 </code>
>>                             </script>
>>                         </expression>
>>                         <target>
>>                            
>> <path>$user/extension/apos:aposUnitAttributes</path>
>>                         </target>
>>                     </inbound>
>
> it should never fail on NPE because of the "?." operators...
>
>
>> And it fails. The error is :
>>
>> Caused by:
>> com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
>> java.lang.NullPointerException: Cannot invoke method last() on null
>> object expression in mapping in inbound expression for
>> {http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}orgdesc
>> in resource:036f0100-2fe8-49e1-a8fd-5548374f8703(APOS CSV Feeder
>> Resource Definition)
>>         at
>> com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.evaluate(Jsr223ScriptEvaluator.java:124)
>> ~[model-common-3.1-SNAPSHOT.jar:na]
>>         at
>> com.evolveum.midpoint.model.common.expression.script.ScriptExpression.evaluate(ScriptExpression.java:108)
>> ~[model-common-3.1-SNAPSHOT.jar:na]
>>         at
>> com.evolveum.midpoint.model.common.expression.script.ScriptExpressionEvaluator.transformSingleValue(ScriptExpressionEvaluator.java:58)
>> ~[model-common-3.1-SNAPSHOT.jar:na]
>>         at
>> com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator$1.process(AbstractValueTransformationExpressionEvaluator.java:420)
>> ~[model-common-3.1-SNAPSHOT.jar:na]
>>         ... 50 common frames omitted
>> Caused by: javax.script.ScriptException: java.lang.NullPointerException:
>> Cannot invoke method last() on null object
>>         at
>> org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:323)
>> ~[groovy-1.8.6.jar:1.8.6]
>>         at
>> org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:41)
>> ~[groovy-1.8.6.jar:1.8.6]
>>         at javax.script.CompiledScript.eval(CompiledScript.java:92)
>> ~[na:1.7.0_45]
>>         at
>> com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.evaluate(Jsr223ScriptEvaluator.java:122)
>> ~[model-common-3.1-SNAPSHOT.jar:na]
>>         ... 53 common frames omitted
>> Caused by: java.lang.NullPointerException: Cannot invoke method last()
>> on null object
>>         at
>> org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
>> ~[groovy-1.8.6.jar:1.8.6]
>>         at
>> org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
>> ~[groovy-1.8.6.jar:1.8.6]
>>         at
>> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
>> ~[groovy-1.8.6.jar:1.8.6]
>>         at
>> org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32)
>> ~[groovy-1.8.6.jar:1.8.6]
>>         at
>> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
>> ~[groovy-1.8.6.jar:1.8.6]
>>         at
>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
>> ~[groovy-1.8.6.jar:1.8.6]
>>         at
>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
>> ~[groovy-1.8.6.jar:1.8.6]
>>         at Script4.run(Script4.groovy:3) ~[na:na]
>>         at
>> org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:320)
>> ~[groovy-1.8.6.jar:1.8.6]
>>         ... 56 common frames omitted
>>
>> I actually have another installation of Midpoint 3.0 where this is
>> running and working correctly (I haven't touched this mapping in ages).
>>
>> Is there anything that could break this in the latest version?
>>
>> Thanks!
>>
>> BR/deepak
>
> Please turn on your mapping and expression tracing (on Logging
> configuration page in standard loggers) and then try to RESTART your
> midpoint (application server). I'm trying to differentiate if this could
> be some strange expression caching bug (there was something similar in
> April).
>
> Related to this: have you enhanced this expression (in Groovy) by the
> "?." operators, or have you used them in this specific expression since
> the very beginning?
> (because the last() method should not be called on null object at all in
> this setup)
>
> This is still just my wild guess; coleagues are already trying to
> replicate this.
>
> Regards,
> Ivan
>
>
>
> Deepak Natarajan <mailto:dnataraj at trilobytesystems.com>
> June 18, 2014 at 12:26 PM
> Hi Everyone -
>
> I just deployed the latest build and one of my inbound mappings from a
> CSV resource is failing :
>
> <attribute>
> <ref>ri:orgdesc</ref>
> <inbound>
> <expression>
> <script>
>
> <language>http://www.w3.org/TR/xpath/</language>
> <code>
> tokenize($c:input,"/")[last()]
> </code>
> </script>
> </expression>
> <target>
>
> <path>$user/extension/apos:aposUnitAttributes</path>
> </target>
> </inbound>
> </attribute>
>
> Caused by: java.lang.RuntimeException:
> null({.../common/common-3}input=PPV(String:/NVK,99999/AV,38/VoksPsyk,43/VoksSociMis,71/,1070/VMNR,959);
> ) in expression
> in mapping in inbound expression for
> {http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}orgdesc
> in resource:036f0100-2fe8-49e1-a8fd-5548374f8703
> (APOS CSV Feeder Resource Definition)
> at
> com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator$1.process(AbstractValueTransformationExpress
> ionEvaluator.java:432) ~[model-common-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator$1.process(AbstractValueTransformationExpress
> ionEvaluator.java:350) ~[model-common-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.util.MiscUtil.carthesian(MiscUtil.java:285)
> ~[util-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.util.MiscUtil.carthesian(MiscUtil.java:275)
> ~[util-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator.evaluateRelativeExpression(AbstractValueTransformationExpressionEvaluator.java:440)
> ~[model-common-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator.evaluate(AbstractValueTransformationExpressionEvaluator.java:112)
> ~[model-common-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.common.expression.Expression.evaluate(Expression.java:136)
> ~[model-common-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.common.mapping.Mapping.evaluateExpression(Mapping.java:967)
> ~[model-common-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.common.mapping.Mapping.evaluate(Mapping.java:501)
> ~[model-common-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.impl.lens.LensUtil.evaluateMapping(LensUtil.java:563)
> ~[model-impl-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.impl.lens.projector.InboundProcessor.evaluateInboundMapping(InboundProcessor.java:386)
> ~[model-impl-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.impl.lens.projector.InboundProcessor.processInboundExpressionsForAccount(InboundProcessor.java:248)
> ~[model-impl-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.impl.lens.projector.InboundProcessor.processInboundFocal(InboundProcessor.java:167)
> ~[model-impl-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.impl.lens.projector.InboundProcessor.processInbound(InboundProcessor.java:113)
> ~[model-impl-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.impl.lens.projector.FocusProcessor.processFocusFocus(FocusProcessor.java:265)
> ~[model-impl-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.impl.lens.projector.FocusProcessor.processFocus(FocusProcessor.java:180)
> ~[model-impl-3.1-SNAPSHOT.jar:na]
>
> I fiddled around and changed it to this :
>
> <ref>ri:orgdesc</ref>
> <inbound>
> <expression>
> <script>
> <code>
> return input?.split("/")?.last()
> </code>
> </script>
> </expression>
> <target>
>
> <path>$user/extension/apos:aposUnitAttributes</path>
> </target>
> </inbound>
>
> And it fails. The error is :
>
> Caused by:
> com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
> java.lang.NullPointerException: Cannot invoke method last() on null
> object expression in mapping in inbound expression for
> {http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}orgdesc
> in resource:036f0100-2fe8-49e1-a8fd-5548374f8703(APOS CSV Feeder
> Resource Definition)
> at
> com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.evaluate(Jsr223ScriptEvaluator.java:124)
> ~[model-common-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.common.expression.script.ScriptExpression.evaluate(ScriptExpression.java:108)
> ~[model-common-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.common.expression.script.ScriptExpressionEvaluator.transformSingleValue(ScriptExpressionEvaluator.java:58)
> ~[model-common-3.1-SNAPSHOT.jar:na]
> at
> com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator$1.process(AbstractValueTransformationExpressionEvaluator.java:420)
> ~[model-common-3.1-SNAPSHOT.jar:na]
> ... 50 common frames omitted
> Caused by: javax.script.ScriptException: java.lang.NullPointerException:
> Cannot invoke method last() on null object
> at
> org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:323)
> ~[groovy-1.8.6.jar:1.8.6]
> at
> org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:41)
> ~[groovy-1.8.6.jar:1.8.6]
> at javax.script.CompiledScript.eval(CompiledScript.java:92)
> ~[na:1.7.0_45]
> at
> com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.evaluate(Jsr223ScriptEvaluator.java:122)
> ~[model-common-3.1-SNAPSHOT.jar:na]
> ... 53 common frames omitted
> Caused by: java.lang.NullPointerException: Cannot invoke method last()
> on null object
> at
> org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
> ~[groovy-1.8.6.jar:1.8.6]
> at
> org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
> ~[groovy-1.8.6.jar:1.8.6]
> at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
> ~[groovy-1.8.6.jar:1.8.6]
> at
> org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32)
> ~[groovy-1.8.6.jar:1.8.6]
> at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
> ~[groovy-1.8.6.jar:1.8.6]
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
> ~[groovy-1.8.6.jar:1.8.6]
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
> ~[groovy-1.8.6.jar:1.8.6]
> at Script4.run(Script4.groovy:3) ~[na:na]
> at
> org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:320)
> ~[groovy-1.8.6.jar:1.8.6]
> ... 56 common frames omitted
>
> I actually have another installation of Midpoint 3.0 where this is
> running and working correctly (I haven't touched this mapping in ages).
>
> Is there anything that could break this in the latest version?
>
> Thanks!
>
> BR/deepak
>
>
>
>

-- 
Deepak Natarajan
Director

Trilobyte Systems ApS

Falkoner Alle 1, 3            Frederikinkatu 61A, 6th Floor
2000 Frederiksberg         Business Center Papula
Denmark                          00100 Helsinki
                                        Finland

Tel : +45 29375068
http://www.trilobytesystems.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20140623/308216a2/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compose-unknown-contact.jpg
Type: image/jpeg
Size: 770 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20140623/308216a2/attachment.jpg>


More information about the midPoint mailing list