3 Replies Latest reply on Sep 18, 2013 4:17 AM by davsclaus

    Issue with XSLT in camel

    kishor_pawar89

      Hi,

       

      I have created a camel route as below. I am facing issue with the xslt transformation highlighted below.

       

      org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route jms-cbr-route at: >>> To[xslt://transforms/Employee.xsl] <<< in route: Route[[From[activemq:incomingOrders]] -> [Log[**** Consuming... because of Failed to resolve endpoint: xslt://transforms/Employee.xsl due to: java.io.FileNotFoundException: Cannot find resource in classpath for URI: transforms/Employee.xsl

       

      <camelContext xmlns="http://camel.apache.org/schema/spring">

              <route id="file-to-jms-route">

                  <from uri="file:work/jms/input" />

                  <log message="Receiving order ${file:name}" />

                  <to uri="activemq:incomingOrders" />

              </route>

              <route id="jms-cbr-route">

                  <from uri="activemq:incomingOrders" />

                  <log message="**** Consuming message from activemq ****" />

                  <log message="${body}" />

                  <!-- <to uri="xslt:file:///home/admin/Desktop/RPM/poc/camel-routing-su/src/main/resources/transforms/Employee.xsl"/> -->

                  <to uri="xslt://transforms/Employee.xsl" />

                  <log message="**** Transformation Completed ****" />

                  <log message="${body}" />

                  <unmarshal>

                      <jaxb prettyPrint="true" contextPath="com.specsavers.xml.ss.schema.poc" />

                  </unmarshal>

                  <log message="**** Unmarshalling Completed ****" />

                  <process ref="beanService" />

                  <log message="Done processing ${file:name}" />

              </route>

          </camelContext>

        • 1. Re: Issue with XSLT in camel
          davsclaus

          What version of JBoss Fuse do you use?

           

          And do you have the transforms/Employee.xsl included in the JAR of your Camel application?

          • 2. Re: Issue with XSLT in camel
            kishor_pawar89

            Hi,

             

            I am using JBoss fuse 6.0. I have the xsl file included in the jar.

            Below is the project structure. The transformation works with the absolue path(xslt:file:D:/poc/camel-routing-su/src/main/resources/transforms/Employee.xsl) but not with the relative path(xslt://transforms/Employee.xsl)

            ProjectStructure.png

            • 3. Re: Issue with XSLT in camel
              davsclaus

              There is a bug loading resources on classpath on Windows.

               

              It has since been fixed.

               

              320501-Author: Claus Ibsen <davsclaus@apache.org>

              320544-Date:   Thu Mar 14 17:16:05 2013 +0000

              320583-

              320584:    xslt component has problem loading resource from classpath on windows.

              320659-

              320664-    git