[midPoint] Error with inbound mapping in latest build.
Deepak Natarajan
dnataraj at trilobytesystems.com
Wed Jun 18 11:26:57 CEST 2014
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
More information about the midPoint
mailing list