ODE
  1. ODE
  2. ODE-531

Failing copy from xquery query leads to failing whole job

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.2
    • Fix Version/s: 1.3.2
    • Component/s: BPEL Runtime
    • Labels:
      None

      Description

      I did
      <copy>
      <from variable="myVar" part="TestPart">
      <query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0">
      let $j := 10 div 0
      return concat("abc", $j)
      </query>
      </from>
      <to variable="myVar" part="TestPart"/>
      </copy>

      After it, I got:

      02-27@13:27:54 ERROR (JacobVPU.java:463) - Method "run" in class "org.apache.ode.bpel.runtime.ASSIGN" threw an unexpected exception.
      org.apache.ode.bpel.runtime.InvalidProcessException: Expression Failed:

      {OXPath10Expression null}

      at org.apache.ode.bpel.runtime.ExprEvaluationContextImpl.evaluateQuery(ExprEvaluationContextImpl.java:108)
      at org.apache.ode.bpel.runtime.ASSIGN.evalQuery(ASSIGN.java:619)
      at org.apache.ode.bpel.runtime.ASSIGN.evalRValue(ASSIGN.java:187)
      at org.apache.ode.bpel.runtime.ASSIGN.copy(ASSIGN.java:360)
      at org.apache.ode.bpel.runtime.ASSIGN.run(ASSIGN.java:81)
      at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:451)
      at org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
      at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(BpelRuntimeContextImpl.java:854)
      at org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeNewInstance(PartnerLinkMyRoleImpl.java:206)
      at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:220)
      at org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(BpelProcess.java:392)
      at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(BpelEngineImpl.java:391)
      at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(BpelServerImpl.java:387)
      at org.apache.ode.il.MockScheduler.doExecute(MockScheduler.java:265)
      at org.apache.ode.il.MockScheduler.access$000(MockScheduler.java:46)
      at org.apache.ode.il.MockScheduler$3$1.call(MockScheduler.java:110)
      at org.apache.ode.il.MockScheduler.execTransaction(MockScheduler.java:134)
      at org.apache.ode.il.MockScheduler$4.call(MockScheduler.java:151)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
      at java.util.concurrent.FutureTask.run(FutureTask.java:123)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: org.apache.ode.bpel.explang.EvaluationException: Error while executing an XQuery expression: net.sf.saxon.trans.XPathException: Integer division by zero
      at org.apache.ode.bpel.elang.xquery10.runtime.XQuery10ExpressionRuntime.evaluate(XQuery10ExpressionRuntime.java:435)
      at org.apache.ode.bpel.elang.xquery10.runtime.XQuery10ExpressionRuntime.evaluate(XQuery10ExpressionRuntime.java:154)
      at org.apache.ode.bpel.elang.xquery10.runtime.XQuery10ExpressionRuntime.evaluateNode(XQuery10ExpressionRuntime.java:219)
      at org.apache.ode.bpel.runtime.ExpressionLanguageRuntimeRegistry.evaluateNode(ExpressionLanguageRuntimeRegistry.java:84)
      at org.apache.ode.bpel.runtime.ExprEvaluationContextImpl.evaluateQuery(ExprEvaluationContextImpl.java:102)
      ... 25 more
      Caused by: net.sf.saxon.trans.XPathException: Integer division by zero
      at net.sf.saxon.value.Int64Value.div(Int64Value.java:575)
      at net.sf.saxon.expr.Calculator$IntegerDivInteger.compute(Calculator.java:781)
      at net.sf.saxon.expr.ArithmeticExpression.evaluateItem(ArithmeticExpression.java:292)
      at net.sf.saxon.functions.Concat.evaluateItem(Concat.java:38)
      at net.sf.saxon.expr.Expression.iterate(Expression.java:370)
      at net.sf.saxon.query.XQueryExpression.iterator(XQueryExpression.java:307)
      at net.sf.saxon.xqj.SaxonXQPreparedExpression.executeQuery(SaxonXQPreparedExpression.java:87)
      at org.apache.ode.bpel.elang.xquery10.runtime.XQuery10ExpressionRuntime.evaluate(XQuery10ExpressionRuntime.java:402)
      ... 29 more

      which lead to failing the whole job.
      Instead, there ought to be 'selectionFailure' fault raised.

      1. xqueryquery-testcase.diff
        1 kB
        Rafal Rusin
      2. xqueryquery-patch.diff
        5 kB
        Rafal Rusin

        Activity

        Hide
        Karthick Sankarachary added a comment -

        Thanks to Rafal for identifying and resolving this issue with query evaluation that had gone undetected for way too long. Thanks to Mark for identifying the right type of standard fault to throw in this particular case (I too believe that the root cause of the problem qualifies as an "unhandled fault" as opposed to an "inability to select nodes".) The revised patch has been applied at revision 748707.

        I guess that "neat little trick" in the ASSIGN activity wasn't so neat after all

        Show
        Karthick Sankarachary added a comment - Thanks to Rafal for identifying and resolving this issue with query evaluation that had gone undetected for way too long. Thanks to Mark for identifying the right type of standard fault to throw in this particular case (I too believe that the root cause of the problem qualifies as an "unhandled fault" as opposed to an "inability to select nodes".) The revised patch has been applied at revision 748707. I guess that "neat little trick" in the ASSIGN activity wasn't so neat after all
        Hide
        Mark Ford added a comment -

        The fault raised should be bpel:subLanguageExecutionFault as opposed to bpel:selectionFailure. The former indicates that something is wrong with the expression while the latter indicates that it failed to return the right value to the from-spec.

        Show
        Mark Ford added a comment - The fault raised should be bpel:subLanguageExecutionFault as opposed to bpel:selectionFailure. The former indicates that something is wrong with the expression while the latter indicates that it failed to return the right value to the from-spec.
        Hide
        Rafal Rusin added a comment -

        I did a patch for it.
        It adds an EvaluationException to evaluateQuery and try/catch block for interception in ASSIGN.

        I also added a test case for it, which extended TestXQueryExpression/HelloXQueryWorld.bpel

        Show
        Rafal Rusin added a comment - I did a patch for it. It adds an EvaluationException to evaluateQuery and try/catch block for interception in ASSIGN. I also added a test case for it, which extended TestXQueryExpression/HelloXQueryWorld.bpel

          People

          • Assignee:
            Karthick Sankarachary
            Reporter:
            Rafal Rusin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development