NullPointerException in Saxon-HE-9.9.1-3
Added by Vladimir Nesterovsky over 5 years ago
While running xslts in batch I can see the following error:
Caused by: java.lang.RuntimeException: Internal error evaluating function x at line y in module z
at net.sf.saxon.expr.instruct.UserFunction.call(UserFunction.java:611)
at net.sf.saxon.expr.UserFunctionCall.callFunction(UserFunctionCall.java:543)
at net.sf.saxon.expr.UserFunctionCall.iterate(UserFunctionCall.java:487)
at net.sf.saxon.expr.CardinalityChecker.evaluateItem(CardinalityChecker.java:276)
at net.sf.saxon.expr.parser.Evaluator$5.evaluate(Evaluator.java:191)
at net.sf.saxon.expr.parser.Evaluator$5.evaluate(Evaluator.java:188)
at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:531)
at net.sf.saxon.expr.LetExpression.process(LetExpression.java:600)
at net.sf.saxon.expr.TryCatch.process(TryCatch.java:322)
at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:723)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:735)
at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:352)
Caused by: java.lang.NullPointerException
at net.sf.saxon.functions.KeyFn.getOrigin(KeyFn.java:209)
at net.sf.saxon.functions.KeyFn.call(KeyFn.java:177)
at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:532)
at net.sf.saxon.expr.FilterExpression.iterate(FilterExpression.java:1123)
at net.sf.saxon.expr.CardinalityChecker.evaluateItem(CardinalityChecker.java:276)
at net.sf.saxon.expr.ItemChecker.evaluateItem(ItemChecker.java:250)
at net.sf.saxon.expr.parser.Evaluator$6.evaluate(Evaluator.java:213)
at net.sf.saxon.expr.instruct.UserFunction.call(UserFunction.java:601)
... 53 more
I yet need to try to find and reproduce what exactly happens.
Replies (4)
Please register to reply
RE: NullPointerException in Saxon-HE-9.9.1-3 - Added by Vladimir Nesterovsky over 5 years ago
Xslt code where fail happens is:
<xsl:function name="t:get-root-element" as="element()?">
<xsl:param name="id" as="xs:string"/>
<xsl:sequence select="key('t:id', $id, $t:root)[self::d:element!parent::d:group]"/>
</xsl:function>
RE: NullPointerException in Saxon-HE-9.9.1-3 - Added by Vladimir Nesterovsky over 5 years ago
My shallow analysis shows that there is a way of returning null for $t:root global variable when GlobalVariable.evaluateVariable(), and Bindery.getGlobalVariable() refer to wrong slot.
I cannot reproduce the problem for now.
RE: NullPointerException in Saxon-HE-9.9.1-3 - Added by Michael Kay over 5 years ago
I think you are probably correct that this is an issue with binding slot numbers; most likely, the "current component" in the XPathContext object is wrong and therefore we are looking in the wrong binding vector. But that's just a guess; I'm afraid that without a repro, there is no chance of pinning this down.
RE: NullPointerException in Saxon-HE-9.9.1-3 - Added by Vladimir Nesterovsky over 5 years ago
Unfortunately, I cannot reproduce it locally neither in batch run, though it has happened once. I'll write here if I will be able to come up with repro.
Please register to reply