Error
When executing XPATH 2.0 functions within the mediation flow of the ESB you can come accross the following exception,
ERROR - SynapseXPath Evaluation of the XPath expression fn:tokenize(syn:get-property('axis2','ContentType'),';')[1] resulted in an error org.jaxen.UnresolvableException: No Such Function {http://www.w3.org/2005/xpath-functions}:tokenize at org.jaxen.SimpleFunctionContext.getFunction(SimpleFunctionContext.java:127) at org.apache.synapse.util.xpath.SynapseXPathFunctionContext.getFunction(SynapseXPathFunctionContext.java:93) at org.jaxen.ContextSupport.getFunction(ContextSupport.java:242) at org.jaxen.Context.getFunction(Context.java:216) at org.jaxen.expr.DefaultFunctionCallExpr.evaluate(DefaultFunctionCallExpr.java:172) at org.jaxen.expr.DefaultFilterExpr.evaluate(DefaultFilterExpr.java:168) at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:102) at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:674) at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:213) at org.jaxen.BaseXPath.evaluate(BaseXPath.java:172) at org.apache.synapse.util.xpath.SynapseXPath.stringValueOf(SynapseXPath.java:302) at org.apache.synapse.mediators.builtin.PropertyMediator.getResultValue(PropertyMediator.java:299) at org.apache.synapse.mediators.builtin.PropertyMediator.mediate(PropertyMediator.java:95) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71) at org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:55) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71) at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114) at org.apache.synapse.rest.Resource.process(Resource.java:306) at org.apache.synapse.rest.API.process(API.java:308) at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:76) at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:63) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:182) at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144) at org.apache.axis2.transport.http.util.RESTUtil.processXMLRequest(RESTUtil.java:89) at org.apache.synapse.transport.nhttp.util.RESTUtil.processPOSTRequest(RESTUtil.java:195) at org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:450) at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:275) at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)
Possible Solution
The above Error can occur if you haven't enabled Xpath 2.0 functionality in WSO2 ESB. So you can enable XAPTH 2.0 by following this post.
If you still get this error check whether you have defined the Namespaces correctly as well.
No comments:
Post a Comment