java.lang.AssertionError: Value of variable is undefined (null)

2012-11-08
2012-11-09
  • Praveen G S
    Praveen G S
    2012-11-08

    Hi,
    The following issue was noticed in one of our environments while using SAXON 8.9.0.4 from Saxonica (build 062523).

    The stack trace pasted below is thrown when one of our application service starts to process an incoming message by transforming it(This occurred at the very first instance of transformation and not any further). It is not reproducible up until now, but if occurred in the production environment could very well result in the loss of important messages.

    I have been searching through the bug database to find if there has been any similar issues reported, and I did find one in (http://sourceforge.net/p/saxon/bugs/495). But this seems to have been fixed in 8.7. And we are using the 8.9 version. So could some one please help me to find out if we need to try a different version of the jar?

    I am pasting the full stack trace for your reference. Any help will be much appreciated.
    java.lang.AssertionError: Value of variable is undefined (null)
    at net.sf.saxon.value.Value.getIterator(Value.java:218)
    at net.sf.saxon.expr.VariableReference.iterate(VariableReference.java:276)
    at net.sf.saxon.instruct.ForEach.iterate(ForEach.java:260)
    at net.sf.saxon.expr.CardinalityChecker.iterate(CardinalityChecker.java:143)
    at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:89)
    at net.sf.saxon.expr.Literal.iterate(Literal.java:162)
    at net.sf.saxon.expr.FilterExpression.iterate(FilterExpression.java:682)
    at net.sf.saxon.functions.Existence.effectiveBooleanValue(Existence.java:34)
    at net.sf.saxon.functions.Existence.evaluateItem(Existence.java:54)
    at net.sf.saxon.expr.Expression.iterate(Expression.java:283)
    at net.sf.saxon.expr.LetExpression.iterate(LetExpression.java:218)
    at net.sf.saxon.instruct.ForEach.map(ForEach.java:279)
    at net.sf.saxon.expr.ContextMappingIterator.next(ContextMappingIterator.java:54)
    at net.sf.saxon.expr.CardinalityChecker.evaluateItem(CardinalityChecker.java:276)
    at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:361)
    at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:229)
    at net.sf.saxon.expr.LetExpression.iterate(LetExpression.java:210)
    at net.sf.saxon.instruct.Choose.iterate(Choose.java:422)
    at net.sf.saxon.expr.CardinalityChecker.iterate(CardinalityChecker.java:143)
    at net.sf.saxon.functions.Existence.effectiveBooleanValue(Existence.java:34)
    at net.sf.saxon.instruct.Choose.iterate(Choose.java:416)
    at net.sf.saxon.instruct.ForEach.map(ForEach.java:279)
    at net.sf.saxon.expr.ContextMappingIterator.next(ContextMappingIterator.java:54)
    at net.sf.saxon.expr.CardinalityCheckingIterator.<init>(CardinalityCheckingIterator.java:42)
    at net.sf.saxon.expr.CardinalityChecker.iterate(CardinalityChecker.java:165)
    at net.sf.saxon.instruct.ForEach.processLeavingTail(ForEach.java:219)
    at net.sf.saxon.instruct.Instruction.process(Instruction.java:91)
    at net.sf.saxon.instruct.ForEach.processLeavingTail(ForEach.java:243)
    at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:365)
    at net.sf.saxon.instruct.Instruction.process(Instruction.java:91)
    at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:240)
    at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:365)
    at net.sf.saxon.instruct.Instruction.process(Instruction.java:91)
    at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:240)
    at net.sf.saxon.instruct.Instruction.process(Instruction.java:91)
    at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:240)
    at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:365)
    at net.sf.saxon.instruct.Instruction.process(Instruction.java:91)
    at net.sf.saxon.expr.LetExpression.process(LetExpression.java:268)
    at net.sf.saxon.instruct.ForEach.processLeavingTail(ForEach.java:243)
    at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:365)
    at net.sf.saxon.instruct.Instruction.process(Instruction.java:91)
    at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:240)
    at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:98)
    at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:317)
    at net.sf.saxon.Controller.transformDocument(Controller.java:1706)
    at net.sf.saxon.Controller.transform(Controller.java:1513)

    Thanks,
    Praveen

     
  • Michael Kay
    Michael Kay
    2012-11-08

    Unfortunately 8.9.0.4 is a very old release and we can't really investigate the problem unless it can be reproduced in a more recent version. The current release is 9.4.0.6. I know it's always tempting to stay on an old release if it appears to be stable, but this is the risk that you run.

    The particular problem is a symptom of an incorrect tree rewrite during the optimization phase, and unfortunately the same symptom has/had quite a variety of underlying possible causes. A quick search shows that there were quite a few incidents with this symptom between 8.5 and 9.0, but few or none more recently.

    Finally, please note that the preferred place for Saxon support is now the server at http://saxonica.plan.io.

     
    • Praveen G S
      Praveen G S
      2012-11-09

      Thanks for the quick response Michael, really appreciate it. I will push the use of the latest saxon jar.

      Thanks.