Hi Asanka, If you are using synapse specific xpath functions like "get-property()" within a xpath 2.0 function you have to use them with the prefix "syn".
i.e: <property xmlns:fn="http://www.w3.org/2005/xpath-functions" name="MY_VALUE" expression="fn:replace(*syn:* get-property('ERROR_URL_POSTFIX'),'\\/','/')"/> Thanks SumedhaS On Fri, Nov 7, 2014 at 12:34 PM, Asanka Vithanage <asan...@wso2.com> wrote: > Hi All, > > When invoke the following proxy service on ESB 481 using soapui, I am > getting the below exception. > > Note: ESB runs with synapse.xpath.dom.failover.enabled=true property > > Am i getting these exceptions due to any configuration issues on proxy or > is there any more configurations required on ESB side. > Appreciate any help on this. > > <?xml version="1.0" encoding="UTF-8"?> > <proxy xmlns="http://ws.apache.org/ns/synapse" > name="MyProxyA" > transports="https,http" > statistics="disable" > trace="disable" > startOnLoad="true"> > <target> > <inSequence> > <log> > <property name="ERROR_URL" value="\/greet?name=Hi"/> > <property xmlns:fn="http://www.w3.org/2005/xpath-functions" > name="MY_VALUE" > > expression="fn:replace(get-property('ERROR_URL'),'\\/','/')"/> > </log> > </inSequence> > <outSequence> > <send/> > </outSequence> > <endpoint> > <address uri=" > https://10.100.0.58:9473/services/SimpleStockQuoteService"/> > </endpoint> > </target> > <description/> > </proxy> > > > Issue: > > [2014-11-06 22:31:35,731] ERROR - SynapseXPath Evaluation of the XPath > expression fn:replace(get-property('ERROR_URL_POSTFIX'),'\\/','/') resulted > in an error > net.sf.saxon.trans.XPathException: Unknown system function get-property() > at > net.sf.saxon.expr.parser.ExpressionParser.grumble(ExpressionParser.java:263) > at > net.sf.saxon.expr.parser.ExpressionParser.parseFunctionCall(ExpressionParser.java:2375) > at > net.sf.saxon.expr.parser.ExpressionParser.parseBasicStep(ExpressionParser.java:1731) > at > net.sf.saxon.expr.parser.ExpressionParser.parseStepExpression(ExpressionParser.java:1654) > at > net.sf.saxon.expr.parser.ExpressionParser.parseRelativePath(ExpressionParser.java:1573) > at > net.sf.saxon.expr.parser.ExpressionParser.parsePathExpression(ExpressionParser.java:1557) > at > net.sf.saxon.expr.parser.ExpressionParser.parseUnaryExpression(ExpressionParser.java:1447) > at > net.sf.saxon.expr.parser.ExpressionParser.parseExprSingle(ExpressionParser.java:517) > at > net.sf.saxon.expr.parser.ExpressionParser.parseFunctionArgument(ExpressionParser.java:2532) > at > net.sf.saxon.expr.parser.ExpressionParser.parseFunctionCall(ExpressionParser.java:2336) > at > net.sf.saxon.expr.parser.ExpressionParser.parseBasicStep(ExpressionParser.java:1731) > at > net.sf.saxon.expr.parser.ExpressionParser.parseStepExpression(ExpressionParser.java:1654) > at > net.sf.saxon.expr.parser.ExpressionParser.parseRelativePath(ExpressionParser.java:1573) > at > net.sf.saxon.expr.parser.ExpressionParser.parsePathExpression(ExpressionParser.java:1557) > at > net.sf.saxon.expr.parser.ExpressionParser.parseUnaryExpression(ExpressionParser.java:1447) > at > net.sf.saxon.expr.parser.ExpressionParser.parseExprSingle(ExpressionParser.java:517) > at > net.sf.saxon.expr.parser.ExpressionParser.parseExpression(ExpressionParser.java:455) > at > net.sf.saxon.expr.parser.ExpressionParser.parse(ExpressionParser.java:391) > at net.sf.saxon.expr.parser.ExpressionTool.make(ExpressionTool.java:94) > at > net.sf.saxon.xpath.XPathEvaluator.createExpressionInternal(XPathEvaluator.java:235) > at net.sf.saxon.xpath.XPathEvaluator.compile(XPathEvaluator.java:376) > at > org.apache.synapse.util.xpath.SynapseXPath.evaluateDOMXPath(SynapseXPath.java:529) > at > org.apache.synapse.util.xpath.SynapseXPath.stringValueOf(SynapseXPath.java:364) > at > org.apache.synapse.mediators.MediatorProperty.getEvaluatedExpression(MediatorProperty.java:138) > at > org.apache.synapse.mediators.builtin.LogMediator.setCustomProperties(LogMediator.java:192) > at > org.apache.synapse.mediators.builtin.LogMediator.getSimpleLogMessage(LogMediator.java:153) > at > org.apache.synapse.mediators.builtin.LogMediator.getLogMessage(LogMediator.java:119) > at > org.apache.synapse.mediators.builtin.LogMediator.mediate(LogMediator.java:91) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47) > at > org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131) > at > org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:166) > at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) > at > org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:411) > at > org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:183) > at > org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) > at java.lang.Thread.run(Thread.java:662) > --------------- linked to ------------------ > javax.xml.xpath.XPathExpressionException: > net.sf.saxon.trans.XPathException: Unknown system function get-property() > at net.sf.saxon.xpath.XPathEvaluator.compile(XPathEvaluator.java:378) > at > org.apache.synapse.util.xpath.SynapseXPath.evaluateDOMXPath(SynapseXPath.java:529) > at > org.apache.synapse.util.xpath.SynapseXPath.stringValueOf(SynapseXPath.java:364) > at > org.apache.synapse.mediators.MediatorProperty.getEvaluatedExpression(MediatorProperty.java:138) > at > org.apache.synapse.mediators.builtin.LogMediator.setCustomProperties(LogMediator.java:192) > at > org.apache.synapse.mediators.builtin.LogMediator.getSimpleLogMessage(LogMediator.java:153) > at > org.apache.synapse.mediators.builtin.LogMediator.getLogMessage(LogMediator.java:119) > at > org.apache.synapse.mediators.builtin.LogMediator.mediate(LogMediator.java:91) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47) > at > org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131) > at > org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:166) > at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) > at > org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:411) > at > org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:183) > at > org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) > at java.lang.Thread.run(Thread.java:662) > Caused by: net.sf.saxon.trans.XPathException: Unknown system function > get-property() > at > net.sf.saxon.expr.parser.ExpressionParser.grumble(ExpressionParser.java:263) > at > net.sf.saxon.expr.parser.ExpressionParser.parseFunctionCall(ExpressionParser.java:2375) > at > net.sf.saxon.expr.parser.ExpressionParser.parseBasicStep(ExpressionParser.java:1731) > at > net.sf.saxon.expr.parser.ExpressionParser.parseStepExpression(ExpressionParser.java:1654) > at > net.sf.saxon.expr.parser.ExpressionParser.parseRelativePath(ExpressionParser.java:1573) > at > net.sf.saxon.expr.parser.ExpressionParser.parsePathExpression(ExpressionParser.java:1557) > at > net.sf.saxon.expr.parser.ExpressionParser.parseUnaryExpression(ExpressionParser.java:1447) > at > net.sf.saxon.expr.parser.ExpressionParser.parseExprSingle(ExpressionParser.java:517) > at > net.sf.saxon.expr.parser.ExpressionParser.parseFunctionArgument(ExpressionParser.java:2532) > at > net.sf.saxon.expr.parser.ExpressionParser.parseFunctionCall(ExpressionParser.java:2336) > at > net.sf.saxon.expr.parser.ExpressionParser.parseBasicStep(ExpressionParser.java:1731) > at > net.sf.saxon.expr.parser.ExpressionParser.parseStepExpression(ExpressionParser.java:1654) > at > net.sf.saxon.expr.parser.ExpressionParser.parseRelativePath(ExpressionParser.java:1573) > at > net.sf.saxon.expr.parser.ExpressionParser.parsePathExpression(ExpressionParser.java:1557) > at > net.sf.saxon.expr.parser.ExpressionParser.parseUnaryExpression(ExpressionParser.java:1447) > at > net.sf.saxon.expr.parser.ExpressionParser.parseExprSingle(ExpressionParser.java:517) > at > net.sf.saxon.expr.parser.ExpressionParser.parseExpression(ExpressionParser.java:455) > at > net.sf.saxon.expr.parser.ExpressionParser.parse(ExpressionParser.java:391) > at net.sf.saxon.expr.parser.ExpressionTool.make(ExpressionTool.java:94) > at > net.sf.saxon.xpath.XPathEvaluator.createExpressionInternal(XPathEvaluator.java:235) > at net.sf.saxon.xpath.XPathEvaluator.compile(XPathEvaluator.java:376) > ... 18 more > > > > When replace <property xmlns:fn=" > http://www.w3.org/2005/xpath-functions" > name="MY_VALUE" > > expression="fn:replace(get-property('ERROR_URL'),'\\/','/')"/> > with > <property xmlns:fn="http://www.w3.org/2005/xpath-functions" > name="MY_VALUE" > expression="fn:replace(get-property('axis2','REST_URL_POSTFIX'),'\\/','/')"/> > on proxy, getting the below exception. > > [2014-11-06 22:47:40,924] ERROR - SynapseXPath Evaluation of the > XPath expression > fn:replace(get-property('axis2','REST_URL_POSTFIX'),'\\/','/') resulted in > an error > javax.xml.transform.TransformerException: Could not find function: > get-property > at org.apache.xpath.compiler.XPathParser.error(XPathParser.java:610) > at > org.apache.xpath.compiler.XPathParser.FunctionCall(XPathParser.java:1507) > at > org.apache.xpath.compiler.XPathParser.PrimaryExpr(XPathParser.java:1446) > at > org.apache.xpath.compiler.XPathParser.FilterExpr(XPathParser.java:1345) > at > org.apache.xpath.compiler.XPathParser.PathExpr(XPathParser.java:1278) > at > org.apache.xpath.compiler.XPathParser.UnionExpr(XPathParser.java:1236) > at > org.apache.xpath.compiler.XPathParser.UnaryExpr(XPathParser.java:1142) > at > org.apache.xpath.compiler.XPathParser.MultiplicativeExpr(XPathParser.java:1063) > at > org.apache.xpath.compiler.XPathParser.AdditiveExpr(XPathParser.java:1005) > at > org.apache.xpath.compiler.XPathParser.RelationalExpr(XPathParser.java:930) > at > org.apache.xpath.compiler.XPathParser.EqualityExpr(XPathParser.java:870) > at org.apache.xpath.compiler.XPathParser.AndExpr(XPathParser.java:834) > at org.apache.xpath.compiler.XPathParser.OrExpr(XPathParser.java:807) > at org.apache.xpath.compiler.XPathParser.Expr(XPathParser.java:790) > at > org.apache.xpath.compiler.XPathParser.Argument(XPathParser.java:1469) > at > org.apache.xpath.compiler.XPathParser.FunctionCall(XPathParser.java:1537) > at > org.apache.xpath.compiler.XPathParser.PrimaryExpr(XPathParser.java:1446) > at > org.apache.xpath.compiler.XPathParser.FilterExpr(XPathParser.java:1345) > at > org.apache.xpath.compiler.XPathParser.PathExpr(XPathParser.java:1278) > at > org.apache.xpath.compiler.XPathParser.UnionExpr(XPathParser.java:1236) > at > org.apache.xpath.compiler.XPathParser.UnaryExpr(XPathParser.java:1142) > at > org.apache.xpath.compiler.XPathParser.MultiplicativeExpr(XPathParser.java:1063) > at > org.apache.xpath.compiler.XPathParser.AdditiveExpr(XPathParser.java:1005) > at > org.apache.xpath.compiler.XPathParser.RelationalExpr(XPathParser.java:930) > at > org.apache.xpath.compiler.XPathParser.EqualityExpr(XPathParser.java:870) > at org.apache.xpath.compiler.XPathParser.AndExpr(XPathParser.java:834) > at org.apache.xpath.compiler.XPathParser.OrExpr(XPathParser.java:807) > at org.apache.xpath.compiler.XPathParser.Expr(XPathParser.java:790) > at > org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:129) > at org.apache.xpath.XPath.<init>(XPath.java:178) > at org.apache.xpath.XPath.<init>(XPath.java:266) > at org.apache.xpath.jaxp.XPathImpl.compile(XPathImpl.java:400) > at > org.apache.synapse.util.xpath.SynapseXPath.evaluateDOMXPath(SynapseXPath.java:529) > at > org.apache.synapse.util.xpath.SynapseXPath.stringValueOf(SynapseXPath.java:364) > at > org.apache.synapse.mediators.builtin.PropertyMediator.getResultValue(PropertyMediator.java:302) > at > org.apache.synapse.mediators.builtin.PropertyMediator.mediate(PropertyMediator.java:96) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47) > at > org.apache.synapse.config.xml.AnonymousListMediator.mediate(AnonymousListMediator.java:30) > at > org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:197) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47) > at > org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:61) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47) > at > org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131) > at > org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:228) > at > org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83) > at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) > at > org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:344) > at > org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:168) > at > org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) > at java.lang.Thread.run(Thread.java:662) > --------------- linked to ------------------ > javax.xml.xpath.XPathExpressionException: > javax.xml.transform.TransformerException: Could not find function: > get-property > at org.apache.xpath.jaxp.XPathImpl.compile(XPathImpl.java:408) > at > org.apache.synapse.util.xpath.SynapseXPath.evaluateDOMXPath(SynapseXPath.java:529) > at > org.apache.synapse.util.xpath.SynapseXPath.stringValueOf(SynapseXPath.java:364) > at > org.apache.synapse.mediators.builtin.PropertyMediator.getResultValue(PropertyMediator.java:302) > at > org.apache.synapse.mediators.builtin.PropertyMediator.mediate(PropertyMediator.java:96) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47) > at > org.apache.synapse.config.xml.AnonymousListMediator.mediate(AnonymousListMediator.java:30) > at > org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:197) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47) > at > org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:61) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47) > at > org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131) > at > org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:228) > at > org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83) > at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) > at > org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:344) > at > org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:168) > at > org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) > at java.lang.Thread.run(Thread.java:662) > Caused by: javax.xml.transform.TransformerException: Could not find > function: get-property > at org.apache.xpath.compiler.XPathParser.error(XPathParser.java:610) > at > org.apache.xpath.compiler.XPathParser.FunctionCall(XPathParser.java:1507) > at > org.apache.xpath.compiler.XPathParser.PrimaryExpr(XPathParser.java:1446) > at > org.apache.xpath.compiler.XPathParser.FilterExpr(XPathParser.java:1345) > at > org.apache.xpath.compiler.XPathParser.PathExpr(XPathParser.java:1278) > at > org.apache.xpath.compiler.XPathParser.UnionExpr(XPathParser.java:1236) > at > org.apache.xpath.compiler.XPathParser.UnaryExpr(XPathParser.java:1142) > at > org.apache.xpath.compiler.XPathParser.MultiplicativeExpr(XPathParser.java:1063) > at > org.apache.xpath.compiler.XPathParser.AdditiveExpr(XPathParser.java:1005) > at > org.apache.xpath.compiler.XPathParser.RelationalExpr(XPathParser.java:930) > at > org.apache.xpath.compiler.XPathParser.EqualityExpr(XPathParser.java:870) > at org.apache.xpath.compiler.XPathParser.AndExpr(XPathParser.java:834) > at org.apache.xpath.compiler.XPathParser.OrExpr(XPathParser.java:807) > at org.apache.xpath.compiler.XPathParser.Expr(XPathParser.java:790) > at > org.apache.xpath.compiler.XPathParser.Argument(XPathParser.java:1469) > at > org.apache.xpath.compiler.XPathParser.FunctionCall(XPathParser.java:1537) > at > org.apache.xpath.compiler.XPathParser.PrimaryExpr(XPathParser.java:1446) > at > org.apache.xpath.compiler.XPathParser.FilterExpr(XPathParser.java:1345) > at > org.apache.xpath.compiler.XPathParser.PathExpr(XPathParser.java:1278) > at > org.apache.xpath.compiler.XPathParser.UnionExpr(XPathParser.java:1236) > at > org.apache.xpath.compiler.XPathParser.UnaryExpr(XPathParser.java:1142) > at > org.apache.xpath.compiler.XPathParser.MultiplicativeExpr(XPathParser.java:1063) > at > org.apache.xpath.compiler.XPathParser.AdditiveExpr(XPathParser.java:1005) > at > org.apache.xpath.compiler.XPathParser.RelationalExpr(XPathParser.java:930) > at > org.apache.xpath.compiler.XPathParser.EqualityExpr(XPathParser.java:870) > at org.apache.xpath.compiler.XPathParser.AndExpr(XPathParser.java:834) > at org.apache.xpath.compiler.XPathParser.OrExpr(XPathParser.java:807) > at org.apache.xpath.compiler.XPathParser.Expr(XPathParser.java:790) > at > org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:129) > at org.apache.xpath.XPath.<init>(XPath.java:178) > at org.apache.xpath.XPath.<init>(XPath.java:266) > at org.apache.xpath.jaxp.XPathImpl.compile(XPathImpl.java:400) > ... 23 more > > > > -- > Asanka Vithanage > Senior Software Engineer -QA > Mobile: +94 0716286708 > Email: asan...@wso2.com > WSO2 Inc. www.wso2.com > > > _______________________________________________ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- *Sumedha Kodithuwakku* Software Engineer WSO2 Inc. : wso2.com lean . enterprise . middleware Email: sumed...@wso2.com; Mobile: +94 71 808 1124 Blog: http://sumedhask.blogspot.com/
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev