xquery returns: Error while parsing: 'ExprSingle' expected!
search cancel

xquery returns: Error while parsing: 'ExprSingle' expected!

book

Article ID: 88855

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

xquery returns: Error while parsing: 'ExprSingle' expected!

Environment

Release: AOMBOA99000-3.0-Automic-Operations Manager-Business Objects Agent
Component:

Resolution

Detailed Description and Symptoms

When running a RA Web Service job with a Response Parsing of XQuery, the below error occurs and the job ends abnormally with a return code of 2:

ch.ethz.mxquery.exceptions.StaticException: Error while parsing: 'ExprSingle' expected!

Investigation

An error message can be found in the "Agent log" tab (only available if "Agent log" in the Optional Report section of the "RA" tab is selected).  It will look like:

+++++++++++++++++++++++++++++++++++++ Start of Runtime Exception ++++++++++++++++++++++++++++++++++++
ch.ethz.mxquery.exceptions.StaticException: Error while parsing: 'ExprSingle' expected!
 at ch.ethz.mxquery.query.parser.Parser.generateStaticError(Parser.java:369)
 at ch.ethz.mxquery.query.parser.Parser.FFLWORExpr(Parser.java:2046)
 at ch.ethz.mxquery.query.parser.Parser.ExprSingle(Parser.java:1925)
 at ch.ethz.mxquery.query.parser.Parser.ConcatExpr(Parser.java:1856)
 at ch.ethz.mxquery.query.parser.Parser.Expr(Parser.java:1844)
 at ch.ethz.mxquery.query.parser.Parser.QueryBody(Parser.java:1833)
 at ch.ethz.mxquery.query.parser.Parser.MainModule(Parser.java:395)
 at ch.ethz.mxquery.query.parser.Parser.Module(Parser.java:378)
 at ch.ethz.mxquery.query.parser.Parser.parse(Parser.java:321)
 at ch.ethz.mxquery.query.impl.CompilerImpl.compile(CompilerImpl.java:34)
 at com.uc4.resp_parser.XPathXQueryExecutor.executeXQuery(XPathXQueryExecutor.java:326)
 at com.uc4.resp_parser.XPathXQueryExecutor.executeXQuery(XPathXQueryExecutor.java:291)
 at com.uc4.resp_parser.XPathXQueryExecutor.processQuery(XPathXQueryExecutor.java:151)
 at com.uc4.resp_parser.QueryExecutor.executeQuery(QueryExecutor.java:76)
 at com.uc4.resp_parser.QueryExecutor.processQueries(QueryExecutor.java:63)
 at com.uc4.resp_parser.QueryExecutor$processQueries.call(Unknown Source)
 at SOAP.runJob(WebService.groovy:3747)
 at com.uc4.extensibility.types.CITAgent.dispatchJob(CITAgent.java:258)
 at com.uc4.ex.cit.CITJob.execute(CITJob.java:176)
 at com.uc4.ex.Job.run(Job.java:464)
 at com.uc4.ex.ThreadPool$RunnableDecorator.run(ThreadPool.java:53)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:662)
++++++++++++++++++++++++++++++++++++++ End of Runtime Exception ++++++++++++++++++++++++++++++++++++++


Solution

Check the XQuery parsing to be sure that the "return" section has xml tags.  For example, the following cannot be used:

$ia in $input//getRecordsResponse/getRecordsResult
return :put_var VARA.GET.KBE.NUMBER {$ia/number/text()}, {$ia/number/text()}, {$ia/u_query_include/text()}

to correct this, the following is necessary:

$ia in $input//getRecordsResponse/getRecordsResult
return <result>:put_var VARA.GET.KBE.NUMBER {$ia/number/text()}, {$ia/number/text()}, {$ia/u_query_include/text()}</result>