[midPoint] Error with inbound mapping in latest build.
Katarina Valalikova
k.valalikova at evolveum.com
Fri Jun 20 08:50:29 CEST 2014
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
Dňa 19. 6. 2014 23:20 Ivan Noris wrote / napísal(a):
> 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
>
>
>
More information about the midPoint
mailing list