Top Navigation

XSLT-Mediator Problem, xslt file cannot be compiled when using xpath function replace()

Hi all,



I discovered a problem when working with the xslt mediator. I put the following xslt file into the integrated registry of the wso2 esb.





<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://myhello" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" version="2.0" exclude-result-prefixes="fn">

    <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>

    <xsl:template match="/">

        <xsl:apply-templates select="//ns:helloResponse"/>

    </xsl:template>

    <xsl:template match="ns:helloResponse">

        <ns:helloResponse>

        <ns:return>Original was: <xsl:value-of select="replace(//ns:return,'MYNAME','SOMEOTHERNAME')"/></ns:return>

            </ns:helloResponse>

    </xsl:template>

</xsl:stylesheet>





It is used within an XSLT Transformation Mediator which should take a web service's response and substitute a string in a field. Here is the soap message:





<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:helloResponse xmlns:ns="http://myhello"><ns:return>Hello MYNAME from >>>>p14984&lt;&lt;&lt;&lt;</ns:return></ns:helloResponse></soapenv:Body></soapenv:Envelope>





When not using the xpath replace() function, the transformation works fine. When using it, the esb reports an error:



ERROR XSLTMediator Error compiling the XSLT with key : XSLT/changecontent.xslt

X.X.X.X [HttpClientWorker-3] ERROR XSLTMediator Error creating XSLT transformer using : XSLT/changecontent.xslt

org.apache.synapse.SynapseException: Error compiling the XSLT with key : XSLT/changecontent.xslt

        at org.apache.synapse.mediators.AbstractMediator.handleException(AbstractMediator.java:187)

        at org.apache.synapse.mediators.transform.XSLTMediator.performXSLT(XSLTMediator.java:272)

        at org.apache.synapse.mediators.transform.XSLTMediator.mediate(XSLTMediator.java:177)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:58)

        at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:95)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:58)

        at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:125)

        at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:147)

        at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:301)

        at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:131)

        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)

        at org.apache.synapse.transport.nhttp.ClientWorker.run(ClientWorker.java:200)

        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)

X.X.X.X [HttpClientWorker-3] ERROR XSLTMediator Unable to perform XSLT transformation using : XSLT/changecontent.xslt against source XPath :  source XPath : //ns:helloResponse

org.apache.synapse.SynapseException: Error creating XSLT transformer using : XSLT/changecontent.xslt

        at org.apache.synapse.mediators.AbstractMediator.handleException(AbstractMediator.java:220)

        at org.apache.synapse.mediators.transform.XSLTMediator.performXSLT(XSLTMediator.java:275)

        at org.apache.synapse.mediators.transform.XSLTMediator.mediate(XSLTMediator.java:177)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:58)

        at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:95)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:58)

        at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:125)

        at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:147)

        at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:301)

        at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:131)

        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)

        at org.apache.synapse.transport.nhttp.ClientWorker.run(ClientWorker.java:200)

        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.synapse.SynapseException: Error compiling the XSLT with key : XSLT/changecontent.xslt

        at org.apache.synapse.mediators.AbstractMediator.handleException(AbstractMediator.java:187)

        at org.apache.synapse.mediators.transform.XSLTMediator.performXSLT(XSLTMediator.java:272)

        ... 13 more





Please help, regards Clemens

Please prefix the standard XSLT function using "fn"

Hi

Please prefix the standard XSLT function using "fn".

Example fn:replace

Thanks
Indika

problem still not solved...

Hi, thanks for the reply.

Adding the fn prefix as suggested resulted in a different Exception:

[HttpClientWorker-11] ERROR XSLTMediator Unable to perform XSLT transformation using : XSLT/changecontent.xslt against source XPath :  source XPath : //ns:helloResponse

org.apache.synapse.SynapseException: Error performing XSLT transformation using : XSLT/changecontent.xslt

        at org.apache.synapse.mediators.AbstractMediator.handleException(AbstractMediator.java:220)

        at org.apache.synapse.mediators.transform.XSLTMediator.performXSLT(XSLTMediator.java:432)

        at org.apache.synapse.mediators.transform.XSLTMediator.mediate(XSLTMediator.java:177)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:58)

        at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:95)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:58)

        at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:125)

        at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:147)

        at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:301)

        at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:131)

        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)

        at org.apache.synapse.transport.nhttp.ClientWorker.run(ClientWorker.java:200)

        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: javax.xml.transform.TransformerException: java.lang.NoSuchMethodException: For extension function, could not find method org.apache.xml.utils.NodeVector.replace([ExpressionContext,] #STRING, #STRING).

        at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:420)

        at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:438)

        at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:220)

        at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:473)

        at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:206)

        at org.apache.xpath.Expression.executeCharsToContentHandler(Expression.java:311)

        at org.apache.xalan.templates.ElemValueOf.execute(ElemValueOf.java:272)

        at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)

        at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374)

        at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)

        at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374)

        at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:393)

        at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:176)

        at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)

        at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2281)

        at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1367)

        at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:709)

        at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1284)

        at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1262)

        at org.apache.synapse.mediators.transform.XSLTMediator.performXSLT(XSLTMediator.java:319)

        ... 13 more

Caused by: java.lang.NoSuchMethodException: For extension function, could not find method org.apache.xml.utils.NodeVector.replace([ExpressionContext,] #STRING, #STRING).

        at org.apache.xalan.extensions.MethodResolver.getMethod(MethodResolver.java:274)

        at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:381)

        ... 32 more

 

Another clue is, that when calling a different XPath function without the fn prefix, everything is fine.

For Example when using     <ns:return>Original was: <xsl:value-of select="string(//ns:return)"/></ns:return>      in the xslt, the output is correct.

When adding the fn prefix, the result is a java.lang.NoSuchMethodException again.

This leads me to the assumption that there is an explicit problem with the replace function.

regards, Clemens

Use following solutions

Normal
0

false
false
false

MicrosoftInternetExplorer4

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0mm 5.4pt 0mm 5.4pt;
mso-para-margin:0mm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}

 

Replace function is a XPath 2.0 function   and xalan does not support XPath 2.0. When, setting fn:replace , it treat it as an extension function. (But prefixing with fn : is the correct way for jaxen XPath….So confuse …two ways of implementation) .. Our default XSLT engine seems Xalan , therefore,  replace function is not working.

 

In order to get work, you have to do two things. Actually second one is only need if you are using ESB 1.7 or 1.7.1 as there is an issue with those when using ‘saxon’ which have been fixed in the trunk

 

1)    add

wrapper.java.additional.8=-  Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl

     wrapper.conf if in webapp/WEB-INF/classes/conf

 

 

11)    You have to add following feature for XSLT mediator

<feature name="http://ws.apache.org/ns/synapse/transform/feature/dom" value="true"/>

 

 

I have edit synapse_sample_8  (Our example for XSLT transform - looks ESB samples ) and add replace function for testing and it works.

 

 

 <definitions xmlns="http://ws.apache.org/ns/synapse">



    <!-- the SimpleURLRegistry allows access to a URL based registry (e.g. file:/// or http://) -->

    <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">

        <!-- the root property of the simple URL registry helps resolve a resource URL as root + key -->

        <parameter name="root">file:repository/conf/sample/resources/</parameter>

        <!-- all resources loaded from the URL registry would be cached for this number of milli seconds -->

        <parameter name="cachableDuration">15000</parameter>

    </registry>



    <!-- define the request processing XSLT resource as a static URL source -->

    <localEntry key="xslt-key-req" src="file:repository/conf/sample/resources/transform/transform.xslt"/>



    <in>

        <!-- transform the custom quote request into a standard quote requst expected by the service -->

        <xslt key="xslt-key-req">

             <feature name="http://ws.apache.org/ns/synapse/transform/feature/dom" value="true"/>

        </xslt>

    </in>

    <out>

        <!-- transform the standard response back into the custom format the client expects -->

        <!-- the key is looked up in the remote registry and loaded as a 'dynamic' registry resource -->

        <xslt key="transform/transform_back.xslt">

             <feature name="http://ws.apache.org/ns/synapse/transform/feature/dom" value="true"/>

        </xslt>

    </out>

    <send/>

</definitions>

 

... XSLT file

 

<xsl:stylesheet version="2.0"

    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

    xmlns:fn="http://www.w3.org/2005/02/xpath-functions"

    xmlns:m0="http://services.samples/xsd"

    exclude-result-prefixes="m0 fn">

<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>



<xsl:template match="/">

  <xsl:apply-templates select="//m0:CheckPriceRequest" />

</xsl:template>

 

<xsl:template match="m0:CheckPriceRequest">



<m:getQuote xmlns:m="http://services.samples/xsd">

    <m:request>

        <m:symbol><xsl:value-of select="replace(&quot;Bella Italia&quot;, &quot;l&quot;, &quot;*&quot;)"/></m:symbol>

    </m:request>

</m:getQuote>



</xsl:template>

</xsl:stylesheet>

 

Thanks

Indika

 

 

 

not resolved yet

Hi,

I have tested the suggested changes. First I set the value in the wrapper.conf, then I performed the second step as well since I am using ESB v 1.7.1. It did not resolve my problem.

After that I tried to get the sample 8 to work, because you said that it worked in your case. I used your configuration and xslt file. Here I am getting the same error as with my own stuff.

See stacktrace:

 DEBUG SynapseMessageReceiver SOAPAction: urn:getQuote

 DEBUG SynapseMessageReceiver WSA-Action: urn:getQuote

 DEBUG Axis2SynapseEnvironment Injecting MessageContext

 DEBUG Axis2SynapseEnvironment Using Main Sequence for injected message

 DEBUG SequenceMediator Start : Sequence <main>

 DEBUG SequenceMediator Sequence <SequenceMediator> :: mediate()

 DEBUG InMediator Start : In mediator

 DEBUG InMediator Current message is incoming - executing child mediators

 DEBUG InMediator Sequence <InMediator> :: mediate()

 DEBUG XSLTMediator Start : XSLT mediator

 DEBUG XSLTMediator Using a DOMSource for transformation

SystemId Unknown; Line #13; Column #120; Could not find function: replace

SystemId Unknown; Line #13; Column #120; function token not found.

(Location of error unknown)java.lang.NullPointerException

 ERROR XSLTMediator Error compiling the XSLT with key : xslt-key-req

 ERROR XSLTMediator Error creating XSLT transformer using : xslt-key-req

org.apache.synapse.SynapseException: Error compiling the XSLT with key : xslt-key-req

        at org.apache.synapse.mediators.AbstractMediator.handleException(AbstractMediator.java:187)

        at org.apache.synapse.mediators.transform.XSLTMediator.performXSLT(XSLTMediator.java:272)

        at org.apache.synapse.mediators.transform.XSLTMediator.mediate(XSLTMediator.java:177)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:58)

        at org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:60)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:58)

        at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:125)

        at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:176)

        at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:89)

        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)

        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)

        at org.apache.synapse.transport.nhttp.ServerWorker.processPost(ServerWorker.java:253)

        at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:194)

        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)

 ERROR XSLTMediator Unable to perform XSLT transformation using : xslt-key-req against source XPath : s11:Body/child::*[position()=1] | s12:Body/child::*[position()=1]

org.apache.synapse.SynapseException: Error creating XSLT transformer using : xslt-key-req

        at org.apache.synapse.mediators.AbstractMediator.handleException(AbstractMediator.java:220)

        at org.apache.synapse.mediators.transform.XSLTMediator.performXSLT(XSLTMediator.java:275)

        at org.apache.synapse.mediators.transform.XSLTMediator.mediate(XSLTMediator.java:177)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:58)

        at org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:60)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:58)

        at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:125)

        at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:176)

        at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:89)

        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)

        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)

        at org.apache.synapse.transport.nhttp.ServerWorker.processPost(ServerWorker.java:253)

        at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:194)

        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.synapse.SynapseException: Error compiling the XSLT with key : xslt-key-req

        at org.apache.synapse.mediators.AbstractMediator.handleException(AbstractMediator.java:187)

        at org.apache.synapse.mediators.transform.XSLTMediator.performXSLT(XSLTMediator.java:272)

I am using JDK: jdk1.5.0_16

Any other suggestions would be highly appreciated.

regards, Clemens

What I did

 Just now , I get a fresh ESB 1.7.1 release.



1) Then add



wrapper.java.additional.7=-Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl


After adding above line  , wrapper conf fragment will be as follows  



# Java Additional Parameters

wrapper.java.additional.1=-Djava.endorsed.dirs=webapp/WEB-INF/lib/endorsed

wrapper.java.additional.2=-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XMLGrammarCachingConfiguration

wrapper.java.additional.3=-Djava.io.tmpdir=work/temp/esb

wrapper.java.additional.4=-Dcom.sun.management.jmxremote

wrapper.java.additional.5= # leave blank - used to run samples in Windows

wrapper.java.additional.6= # e.g. -DserverName=localhost

wrapper.java.additional.7=-Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl

# ----- Uncoment this to enable SSL debug options -----------

#wrapper.java,additional.7=-Djavax.net.debug=all

  

2 ) replacse the synapse_sample_8.xml with

 

 <definitions xmlns="http://ws.apache.org/ns/synapse">







    <!-- the SimpleURLRegistry allows access to a URL based registry (e.g. file:/// or http://) -->



    <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">



        <!-- the root property of the simple URL registry helps resolve a resource URL as root + key -->



        <parameter name="root">file:repository/conf/sample/resources/</parameter>



        <!-- all resources loaded from the URL registry would be cached for this number of milli seconds -->



        <parameter name="cachableDuration">15000</parameter>



    </registry>







    <!-- define the request processing XSLT resource as a static URL source -->



    <localEntry key="xslt-key-req" src="file:repository/conf/sample/resources/transform/transform.xslt"/>







    <in>



        <!-- transform the custom quote request into a standard quote requst expected by the service -->



        <xslt key="xslt-key-req">



             <feature name="http://ws.apache.org/ns/synapse/transform/feature/dom" value="true"/>



        </xslt>



    </in>



    <out>



        <!-- transform the standard response back into the custom format the client expects -->



        <!-- the key is looked up in the remote registry and loaded as a 'dynamic' registry resource -->



        <xslt key="transform/transform_back.xslt">



             <feature name="http://ws.apache.org/ns/synapse/transform/feature/dom" value="true"/>



        </xslt>



    </out>



    <send/>



</definitions>

 

3)





replace transform.xslt (repository/conf/samples/resources/transform/ transform.xslt) with following

 <xsl:stylesheet version="2.0"



    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"



    xmlns:fn="http://www.w3.org/2005/02/xpath-functions"



    xmlns:m0="http://services.samples/xsd"



    exclude-result-prefixes="m0 fn">



<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>







<xsl:template match="/">



  <xsl:apply-templates select="//m0:CheckPriceRequest" />



</xsl:template>



 



<xsl:template match="m0:CheckPriceRequest">







<m:getQuote xmlns:m="http://services.samples/xsd">



    <m:request>



        <m:symbol><xsl:value-of select="replace(&quot;Bella Italia&quot;, &quot;l&quot;, &quot;*&quot;)"/></m:symbol>



    </m:request>



</m:getQuote>







</xsl:template>



</xsl:stylesheet>

 

4) Run the sample according to the sample guide for sample 8

 

 Out put form the client side

 

  [java] Custom :: Stock price = $179.45498294865908

 

You can see, in sample axis2 server console 

 

 Tue Sep 30 22:59:40 IST 2008 samples.services.SimpleStockQuoteService :: Generating quote for : Be**a Ita*ia

 

 

 

 

 

 

Hi, this time I took a new,

Hi,

this time I took a new, absolutely clean installation of wso2 esb v 1.7.1. Again I performed exactely the steps, which you described in your latest response (with example 8).

Again I am getting the same error as before:

SystemId Unknown; Line #45; Column #108; Could not find function: replace

SystemId Unknown; Line #45; Column #108; function token not found.

(Location of error unknown)java.lang.NullPointerException

[HttpServerWorker-1] ERROR XSLTMediator Error compiling the XSLT with key : xslt-key-req

[HttpServerWorker-1] ERROR XSLTMediator Error creating XSLT transformer using : xslt-key-req

org.apache.synapse.SynapseException: Error compiling the XSLT with key : xslt-key-req

and so on...

Finally, I made a last desperate attempt to get it working.

For that I decided to use another new, clean installation on a different machine with a different operating system.

I installed wso2 esb on my laptop, running Windows XP on it.

This time it worked!!!

Wed Oct 01 13:35:34 CEST 2008 samples.services.SimpleStockQuoteService :: Genera

ting quote for : Be**a Ita*ia

So, my question to you is: on which operating system and with wich JDK (exact version/update) did you perform your test?

Could it be possible, that there are additional configurations needed to get our little testcase to work on a linux machine?

regards, Clemens

maybe escape sequence bug under linux?

Hi again,

recently I found out something else. When running my first test case on the linux machine an interesting behaviour can be observed.

EVERY Xpath function on strings using double quotes (") fails with the error described. When i used matches(), for example as a test in my xslt-file:

<ns:return><xsl:value-of select="matches(&quot;Merano&quot;, &quot;ran&quot;)"/></ns:return>

I got the error described before:

[HttpClientWorker-2] DEBUG XSLTMediator Using a DOMSource for transformation

[HttpClientWorker-2] DEBUG AbstractRegistry Cached object has expired for key : XSLT/changecontent.xslt

[HttpClientWorker-2] DEBUG AbstractRegistry Expired version number is same as current version in registry

[HttpClientWorker-2] DEBUG AbstractRegistry Renew cache lease for another 5s

SystemId Unknown; Line #10; Column #82; Could not find function: matches

SystemId Unknown; Line #10; Column #82; function token not found.

(Location of error unknown)java.lang.NullPointerException

[HttpClientWorker-2] ERROR XSLTMediator Error compiling the XSLT with key : XSLT/changecontent.xslt

[HttpClientWorker-2] ERROR XSLTMediator Error creating XSLT transformer using : XSLT/changecontent.xslt

org.apache.synapse.SynapseException: Error compiling the XSLT with key : XSLT/changecontent.xslt

        at org.apache.synapse.mediators.AbstractMediator.handleException(AbstractMediator.java:187)

        at org.apache.synapse.mediators.transform.XSLTMediator.performXSLT(XSLTMediator.java:272)

and so on...

When using a string function containing only single quotes (') in the call, everything works fine! For example:

contains('XML','XM'), substring('Beatles',1,4) and others only using single quotes work fine.

Could it be that there is some bug concerning escape sequences with linux os?

Please investigate that, this would really help.

regards, Clemens

problem solved!

Hi,

after adding the parameter to the .sh everything works fine under linux.
Thank you for your help.

regards, Clemens

Oh ... just edit wso2esb.sh

I was forgot to mention that we aren't using wrapper.conf for Linux. I was on windows ….So I didn’t encounter issue

The wso2esb.sh isn't used wrapper.conf...

Please edit wso2esb.sh and pass following as a parameter when running ESB

-Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl