1

我们正在尝试在 Fuse ESB 7.1.0 中使用 osgi 安装包。在这个包中,在骆驼上下文中,我们使用如下:

<camelContext xmlns="http://camel.apache.org/schema/spring">
    <endpoint uri="http://IPADDRESS:8080/LOB_Webservice/LOBSampleWebService?throwExceptionOnFailure=false" id="callLOBServer"/>
    <route>
        <from uri="cxf:bean:lobclient?dataFormat=MESSAGE"/>
        <to uri="log:output"/>
        <bean ref="enrichBean"/>
        <to uri="xslt:etc/8.xsl"/>
         <bean ref="enrichBean"/>
         <to ref="callLOBServer"/>
         <bean ref="enrichBean"/>
        ***<to uri="xslt:etc/3.xsl"/>***
         <bean ref="enrichBean"/>
        <to uri="xslt:etc/7.xsl"/> 
        <bean ref="enrichBean"/>
        <to uri="log:output"/> 
    </route>
</camelContext>

上面的 3.xsl 使用的是XSLT 2.0.

当我们尝试安装它时,它会失败并显示以下信息:

15:11:23,047 | ERROR | ExtenderThread-4 | XsltErrorListener                | 147 - org.apache.camel.camel-core - 2.10.0.fuse-71-047 | A location step was expected following the '/' or '//' token.; Line#: 8; Column#: 77
15:11:23,047 | ERROR | ExtenderThread-4 | ContextLoaderListener            | 113 - org.springframework.osgi.extender - 1.2.1 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=org.apache.camel.camel-example-cxf-proxy, config=osgibundle:/META-INF/spring/*.xml))
java.lang.StackOverflowError
    at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_07]
    at org.osgi.framework.FrameworkUtil.getBundle(FrameworkUtil.java:208)[karaf.jar:2.3.0.fuse-71-047]
    at org.ops4j.pax.logging.util.OsgiUtil.getBundleOrNull(OsgiUtil.java:114)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.OsgiThrowableRenderer.getClassDetail(OsgiThrowableRenderer.java:148)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.OsgiThrowableRenderer.formatElement(OsgiThrowableRenderer.java:135)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.OsgiThrowableRenderer.doRender(OsgiThrowableRenderer.java:105)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.OsgiThrowableRenderer.doRender(OsgiThrowableRenderer.java:52)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.spi.ThrowableInformation.getThrowableStrRep(ThrowableInformation.java:89)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.spi.LoggingEvent.getThrowableStrRep(LoggingEvent.java:413)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:313)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.RollingFileAppender.subAppend(RollingFileAppender.java:276)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.WriterAppender.append(WriterAppender.java:162)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.Category.callAppenders(Category.java:193)[4:org.ops4j.pax.logging.pax-logging-api:1.7.0]
    at org.apache.log4j.Category.forcedLog(Category.java:365)[4:org.ops4j.pax.logging.pax-logging-api:1.7.0]
    at org.apache.log4j.Category.log(Category.java:772)[4:org.ops4j.pax.logging.pax-logging-api:1.7.0]
    at org.ops4j.pax.logging.service.internal.PaxLoggerImpl.error(PaxLoggerImpl.java:159)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.ops4j.pax.logging.internal.TrackingLogger.error(TrackingLogger.java:96)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.ops4j.pax.logging.slf4j.Slf4jLogger.error(Slf4jLogger.java:911)[4:org.ops4j.pax.logging.pax-logging-api:1.7.0]
    at org.apache.camel.builder.xml.XsltErrorListener.fatalError(XsltErrorListener.java:44)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.xpath.compiler.XPathParser.error(XPathParser.java:614)[:]
    at org.apache.xpath.compiler.XPathParser.RelativeLocationPath(XPathParser.java:1639)[:]

这里也是的内容3.xsl

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output method="xml" indent="yes"/>

   <xsl:template match="return">
      <xsl:copy>
         <xsl:apply-templates select="@*|node()"/>
         <ordertotal>
            <xsl:value-of select="sum(orderDetails/(itemPrice * itemQty))"/>
         </ordertotal>
      </xsl:copy>
   </xsl:template>

   <xsl:template match="@*|node()">
      <xsl:copy>
         <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
   </xsl:template>
</xsl:stylesheet>

但是当我们尝试用等效的 XSLT 1.0 功能替换 3.xsl 时,它工作正常。作为要求的一部分,我们只需要使用 XSLT 2.0。

有人可以帮忙吗?谢谢。

最新的堆栈跟踪..

16:06:46,210 | ERROR | ExtenderThread-2 | XsltErrorListener                | 147 - org.apache.camel.camel-core - 2.10.0.fuse-71-047 | A location step was expected following the '/' or '//' token.; Line#: 8; Column#: 78
16:06:46,210 | ERROR | ExtenderThread-2 | ContextLoaderListener            | 113 - org.springframework.osgi.extender - 1.2.1 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=org.apache.camel.camel-example-cxf-proxy, config=osgibundle:/META-INF/spring/*.xml))
java.lang.StackOverflowError
    at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:332)[:1.7.0_07]
    at java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1144)[:1.7.0_07]
    at java.lang.ClassLoader.getClassLoadingLock(ClassLoader.java:462)[:1.7.0_07]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:403)[:1.7.0_07]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:410)[:1.7.0_07]
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)[:1.7.0_07]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:410)[:1.7.0_07]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_07]
    at org.apache.felix.framework.ExtensionManager$ExtensionManagerWiring.getClassByDelegation(ExtensionManager.java:873)
    at org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1520)
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1466)
    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1882)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_07]
    at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1814)
    at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:929)
    at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99)[114:org.springframework.osgi.core:1.2.1]
    at org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)[114:org.springframework.osgi.core:1.2.1]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_07]
    at org.ops4j.pax.logging.util.OsgiUtil.loadClass(OsgiUtil.java:99)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.OsgiThrowableRenderer.findClass(OsgiThrowableRenderer.java:221)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.OsgiThrowableRenderer.formatElement(OsgiThrowableRenderer.java:134)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.OsgiThrowableRenderer.doRender(OsgiThrowableRenderer.java:105)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.OsgiThrowableRenderer.doRender(OsgiThrowableRenderer.java:52)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.spi.ThrowableInformation.getThrowableStrRep(ThrowableInformation.java:89)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.spi.LoggingEvent.getThrowableStrRep(LoggingEvent.java:413)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:313)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.RollingFileAppender.subAppend(RollingFileAppender.java:276)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.WriterAppender.append(WriterAppender.java:162)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.apache.log4j.Category.callAppenders(Category.java:193)[4:org.ops4j.pax.logging.pax-logging-api:1.7.0]
    at org.apache.log4j.Category.forcedLog(Category.java:365)[4:org.ops4j.pax.logging.pax-logging-api:1.7.0]
    at org.apache.log4j.Category.log(Category.java:772)[4:org.ops4j.pax.logging.pax-logging-api:1.7.0]
    at org.ops4j.pax.logging.service.internal.PaxLoggerImpl.error(PaxLoggerImpl.java:159)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.ops4j.pax.logging.internal.TrackingLogger.error(TrackingLogger.java:96)[3:org.ops4j.pax.logging.pax-logging-service:1.7.0]
    at org.ops4j.pax.logging.slf4j.Slf4jLogger.error(Slf4jLogger.java:911)[4:org.ops4j.pax.logging.pax-logging-api:1.7.0]
    at org.apache.camel.builder.xml.XsltErrorListener.fatalError(XsltErrorListener.java:44)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.xpath.compiler.XPathParser.error(XPathParser.java:614)[:]
    at org.apache.xpath.compiler.XPathParser.RelativeLocationPath(XPathParser.java:1639)[:]
    at org.apache.xpath.compiler.XPathParser.LocationPath(XPathParser.java:1597)[:]
    at org.apache.xpath.compiler.XPathParser.PathExpr(XPathParser.java:1317)[:]
    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)[:]

输入 XML 文件

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:fetchOrderListResponse xmlns:ns2="http://impl.lob.wipro.com/">
         <return>
            <customerOrderNumber>1</customerOrderNumber>
            <orderDetails>
               <itemPrice>50.0</itemPrice>
               <itemQty>2</itemQty>
               <itemUnit>0</itemUnit>
               <orderDetailsId>37516016-D71B-4790-951F-55D00B0CC159</orderDetailsId>
               <camelAddedDtlField>0.1</camelAddedDtlField>
            </orderDetails>
            <orderDetails>
               <itemPrice>39.0</itemPrice>
               <itemQty>3</itemQty>
               <itemUnit>0</itemUnit>
               <orderDetailsId>6095ABC7-0D0D-4B2E-92E5-80F24E9092B8</orderDetailsId>
               <camelAddedDtlField>0.1</camelAddedDtlField>
            </orderDetails>
            <orderId>84EC371D-40CA-455E-A0FA-7EA733E9BFD3</orderId>
            <ordertotal>0.0</ordertotal>
            <camelAddedHdrField>0.0</camelAddedHdrField>
         </return>
         <return>
            <customerOrderNumber>1</customerOrderNumber>
            <orderId>54712493-2172-4ADB-814B-BC7AA0BB72C3</orderId>
            <ordertotal>0.0</ordertotal>
            <camelAddedHdrField>0.0</camelAddedHdrField>
         </return>
         <return>
            <customerOrderNumber>1</customerOrderNumber>
            <deliverydate>2013-02-06T00:00:00+05:30</deliverydate>
            <orderDetails>
               <itemPrice>565.0</itemPrice>
               <itemQty>1</itemQty>
               <itemUnit>0</itemUnit>
               <orderDetailsId>9A5030BE-F95F-4C62-B5A2-41FF85423218</orderDetailsId>
               <camelAddedDtlField>0.1</camelAddedDtlField>
            </orderDetails>
            <orderDetails>
               <itemPrice>4.0</itemPrice>
               <itemQty>90</itemQty>
               <itemUnit>0</itemUnit>
               <orderDetailsId>65A8B3BE-D407-43D8-8754-EA1E26AA56E4</orderDetailsId>
               <camelAddedDtlField>0.1</camelAddedDtlField>
            </orderDetails>
            <orderId>0BDCB222-0117-47A9-8813-DF03A1D19E5E</orderId>
            <ordertotal>0.0</ordertotal>
            <camelAddedHdrField>0.0</camelAddedHdrField>
         </return>
         <return>
            <customerOrderNumber>1</customerOrderNumber>
            <orderId>8E4220DC-884B-47BC-A565-E26B80BA5249</orderId>
            <ordertotal>0.0</ordertotal>
           <camelAddedHdrField>0.0</camelAddedHdrField>
         </return>
         <return>
            <customerOrderNumber>1</customerOrderNumber>
            <deliverydate>2013-02-06T00:00:00+05:30</deliverydate>
            <orderDetails>
               <itemPrice>10.0</itemPrice>
               <itemQty>4</itemQty>
               <itemUnit>0</itemUnit>
               <orderDetailsId>5A2DF895-BB0F-4039-80DB-F44CED31697B</orderDetailsId>
               <camelAddedDtlField>0.1</camelAddedDtlField>
            </orderDetails>
            <orderDetails>
               <itemPrice>20.0</itemPrice>
               <itemQty>3</itemQty>
               <itemUnit>0</itemUnit>
               <orderDetailsId>8034FBF4-B573-4B19-BDF5-FAF6C4247A55</orderDetailsId>
               <camelAddedDtlField>0.1</camelAddedDtlField>
            </orderDetails>
            <orderId>60161E3E-3C4A-4CE6-AAC3-E4D2BC240046</orderId>
            <ordertotal>0.0</ordertotal>
            <camelAddedHdrField>0.0</camelAddedHdrField>
         </return>
      </ns2:fetchOrderListResponse>
   </soap:Body>
</soap:Envelope>

XSLT 如下:

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

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

    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
     </xsl:template>

     <xsl:template match="ordertotal">
         <xsl:copy>
            <xsl:value-of select="sum(../orderDetails/(itemPrice*itemQty))" />
         </xsl:copy>
    </xsl:template>

</xsl:stylesheet>

预期输出..

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:fetchOrderListResponse xmlns:ns2="http://impl.lob.wipro.com/">
         <return>
            <customerOrderNumber>1</customerOrderNumber>
            <orderDetails>
               <itemPrice>50.0</itemPrice>
               <itemQty>2</itemQty>
               <itemUnit>0</itemUnit>
               <orderDetailsId>37516016-D71B-4790-951F-55D00B0CC159</orderDetailsId>
               <camelAddedDtlField>0.1</camelAddedDtlField>
            </orderDetails>
            <orderDetails>
               <itemPrice>39.0</itemPrice>
               <itemQty>3</itemQty>
               <itemUnit>0</itemUnit>
               <orderDetailsId>6095ABC7-0D0D-4B2E-92E5-80F24E9092B8</orderDetailsId>
               <camelAddedDtlField>0.1</camelAddedDtlField>
            </orderDetails>
            <orderId>84EC371D-40CA-455E-A0FA-7EA733E9BFD3</orderId>
            <ordertotal>217</ordertotal>
            <camelAddedHdrField>0.0</camelAddedHdrField>
         </return>
         <return>
            <customerOrderNumber>1</customerOrderNumber>
            <orderId>54712493-2172-4ADB-814B-BC7AA0BB72C3</orderId>
            <ordertotal>0</ordertotal>
            <camelAddedHdrField>0.0</camelAddedHdrField>
         </return>
         <return>
            <customerOrderNumber>1</customerOrderNumber>
            <deliverydate>2013-02-06T00:00:00+05:30</deliverydate>
            <orderDetails>
               <itemPrice>565.0</itemPrice>
               <itemQty>1</itemQty>
               <itemUnit>0</itemUnit>
               <orderDetailsId>9A5030BE-F95F-4C62-B5A2-41FF85423218</orderDetailsId>
               <camelAddedDtlField>0.1</camelAddedDtlField>
            </orderDetails>
            <orderDetails>
               <itemPrice>4.0</itemPrice>
               <itemQty>90</itemQty>
               <itemUnit>0</itemUnit>
               <orderDetailsId>65A8B3BE-D407-43D8-8754-EA1E26AA56E4</orderDetailsId>
               <camelAddedDtlField>0.1</camelAddedDtlField>
            </orderDetails>
            <orderId>0BDCB222-0117-47A9-8813-DF03A1D19E5E</orderId>
            <ordertotal>925</ordertotal>
            <camelAddedHdrField>0.0</camelAddedHdrField>
         </return>
         <return>
            <customerOrderNumber>1</customerOrderNumber>
            <orderId>8E4220DC-884B-47BC-A565-E26B80BA5249</orderId>
            <ordertotal>0</ordertotal>
           <camelAddedHdrField>0.0</camelAddedHdrField>
         </return>
         <return>
            <customerOrderNumber>1</customerOrderNumber>
            <deliverydate>2013-02-06T00:00:00+05:30</deliverydate>
            <orderDetails>
               <itemPrice>10.0</itemPrice>
               <itemQty>4</itemQty>
               <itemUnit>0</itemUnit>
               <orderDetailsId>5A2DF895-BB0F-4039-80DB-F44CED31697B</orderDetailsId>
               <camelAddedDtlField>0.1</camelAddedDtlField>
            </orderDetails>
            <orderDetails>
               <itemPrice>20.0</itemPrice>
               <itemQty>3</itemQty>
               <itemUnit>0</itemUnit>
               <orderDetailsId>8034FBF4-B573-4B19-BDF5-FAF6C4247A55</orderDetailsId>
               <camelAddedDtlField>0.1</camelAddedDtlField>
            </orderDetails>
            <orderId>60161E3E-3C4A-4CE6-AAC3-E4D2BC240046</orderId>
            <ordertotal>100</ordertotal>
            <camelAddedHdrField>0.0</camelAddedHdrField>
         </return>
      </ns2:fetchOrderListResponse>
   </soap:Body>
</soap:Envelope>

从日志中......(重复打印......)

16:06:45,883 | ERROR | ExtenderThread-2 | XsltErrorListener                | 147 - org.apache.camel.camel-core - 2.10.0.fuse-71-047 | A location step was expected following the '/' or '//' token.; Line#: 8; Column#: 78
javax.xml.transform.TransformerException: A location step was expected following the '/' or '//' token.
    at org.apache.xpath.compiler.XPathParser.error(XPathParser.java:610)[:]
    at org.apache.xpath.compiler.XPathParser.RelativeLocationPath(XPathParser.java:1639)[:]
    at org.apache.xpath.compiler.XPathParser.LocationPath(XPathParser.java:1597)[:]
    at org.apache.xpath.compiler.XPathParser.PathExpr(XPathParser.java:1317)[:]
    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.compiler.XPathParser.initXPath(XPathParser.java:157)[:]
    at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:157)[:]
    at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:157)[:]
    at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:157)[:]
    at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:157)[:]
    at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:157)[:]
    at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:157)[:]
    at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:157)[:]
    at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:157)[:]
    at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:157)[:]
4

1 回答 1

1

以防万一,如果在使用Karaf + Apache camel时遇到如下所述的 XSLT 2.0 错误,只需强制camel xslt 组件使用 saxon (camel-saxon) 而不是 JDK 中的默认值。

如果您在karaf 4.x+中创建新节点并且使用根节点相同的 xslt 组件可以工作,但新节点将尝试从 JDK 选择 xslt 处理器,也会发生这种情况。

问题(错误示例):

 javax.xml.transform.TransformerConfigurationException: Error checking type of the expression 'funcall(current-dateTime, [])'.

解决方案(示例):

<to uri="xslt:transformers/XSLT-Mappers/CustomerService-Response.xsl?saxon=true" />
于 2016-11-11T15:43:13.660 回答