1 Reply Latest reply on Nov 1, 2009 8:19 PM by Willem Jiang

    Getting error in using camel xslt with apache-servicemix-4.2.0.0M1-fuse?

    jawed khan Newbie

      I am trying to use camel xslt and getting exception in deployment. Here is my route builder:

      public class MyRouteBuilder extends RouteBuilder {

          public void configure() {

              // set up the transform bean

                from("direct:start")                                                                 // 1

                  .to("log:lab1-SMX4.2")                                                  // 2

               .process(new Processor() {                                                            // 3

                       public void process(Exchange arg0) throws Exception {

                           // TODO Auto-generated method stub

                           Message msg = arg0.getIn();

                           System.out.println("Processor 1"+msg.getBody().toString());

                       }

       

              })

                   .to("xslt:com/example/RQ.xsl")

                                .to("log:Got response");

       

      Here is the karaf.log:

      12:25:12,468 | INFO  | xtenderThread-12 | DefaultCamelContext              | e.camel.impl.DefaultCamelContext  888 | Apache Camel 2.0.0.0M1-fuse (CamelContext:camelContext) is starting

      12:25:12,468 | INFO  | xtenderThread-12 | DefaultCamelContext              | e.camel.impl.DefaultCamelContext 1276 | JMX enabled. Using DefaultManagedLifecycleStrategy.

      12:25:12,609 | WARN  | xtenderThread-12 | ObjectHelper                     | g.apache.camel.util.ObjectHelper  625 | Cannot find class: org.apache.xalan.xsltc.trax.DOM2SAX

      12:25:12,750 | INFO  | xtenderThread-12 | DefaultCamelContext              | e.camel.impl.DefaultCamelContext  963 | Apache Camel 2.0.0.0M1-fuse (CamelContext:camelContext) is stopping

      12:25:12,750 | INFO  | xtenderThread-12 | DefaultCamelContext              | e.camel.impl.DefaultCamelContext  993 | Apache Camel 2.0.0.0M1-fuse (CamelContext:camelContext) stopped

      12:25:12,750 | ERROR | xtenderThread-12 | ContextLoaderListener            | BundleApplicationContextListener   50 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=camel-example-api, config=osgibundle:/META-INF/spring/*.xml))

      org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: xslt://com/example/RQ.xsl due to: Could not compile stylesheet

           at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:419)

           at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:52)

           at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:140)

           at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:103)

           at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:109)

           at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:63)

           at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:57)

           at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:283)

           at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:113)

           at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:496)

           at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:128)

           at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:571)

           at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1024)

           at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:955)

           at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:892)

           at org.apache.camel.spring.SpringCamelContext.maybeDoStart(SpringCamelContext.java:168)

           at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:163)

           at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:52)

           at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:826)

           at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:99)

           at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:119)

           at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:510)

           at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)

           at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)

           at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)

           at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)

           at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)

           at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)

           at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)

           at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)

           at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)

           at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136)

           at java.lang.Thread.run(Thread.java:619)

      Caused by: javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet

           at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:825)

           at org.apache.camel.builder.xml.XsltBuilder.setTransformerSource(XsltBuilder.java:204)

           at org.apache.camel.builder.xml.XsltBuilder.setTransformerInputStream(XsltBuilder.java:234)

           at org.apache.camel.component.xslt.XsltComponent.createEndpoint(XsltComponent.java:88)

           at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:78)

           at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:398)

           ... 32 more

       

       

      Thanks

      Jawed