kazik666 opened a new issue #671: Camel routes with xslt does't work in native 
mode
URL: https://github.com/apache/camel-quarkus/issues/671
 
 
   Hi,
   
   I've problem with running my camel quarkus application(Which contains route 
to xslt) in native mode. I've got an error:
   Caused by: org.apache.camel.RuntimeCamelException: 
java.lang.NoSuchMethodException: 
org.apache.camel.component.xslt.XsltBuilder.<init>
           at 
org.apache.camel.support.ObjectHelper.newInstance(ObjectHelper.java:222)
           at 
org.apache.camel.impl.engine.DefaultInjector.newInstance(DefaultInjector.java:66)
           at 
org.apache.camel.impl.engine.DefaultInjector.newInstance(DefaultInjector.java:45)
           at 
org.apache.camel.component.xslt.XsltEndpoint.createXsltBuilder(XsltEndpoint.java:340)
           at 
org.apache.camel.component.xslt.XsltEndpoint.doStart(XsltEndpoint.java:329)
           at 
org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:117)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:70)
           at 
org.apache.camel.processor.SendProcessor.doStart(SendProcessor.java:212)
           at 
org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:117)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:70)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:87)
           at 
org.apache.camel.processor.errorhandler.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:1271)
           at 
org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:56)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:70)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:87)
           at 
org.apache.camel.processor.channel.DefaultChannel.doStart(DefaultChannel.java:134)
           at 
org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:117)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:70)
           at 
org.apache.camel.support.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)
           at 
org.apache.camel.processor.FilterProcessor.doStart(FilterProcessor.java:116)
           at 
org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:117)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:70)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:73)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:87)
           at 
org.apache.camel.processor.ChoiceProcessor.doStart(ChoiceProcessor.java:200)
           at 
org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:117)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:70)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:87)
           at 
org.apache.camel.processor.errorhandler.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:1271)
           at 
org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:56)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:70)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:87)
           at 
org.apache.camel.processor.channel.DefaultChannel.doStart(DefaultChannel.java:134)
           at 
org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:117)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:70)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:73)
           at org.apache.camel.processor.Pipeline.doStart(Pipeline.java:135)
           at 
org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:117)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:70)
           at 
org.apache.camel.support.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)
           at 
org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:117)
           at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:70)
           at 
org.apache.camel.impl.engine.BaseRouteService.startChildService(BaseRouteService.java:336)
           at 
org.apache.camel.impl.engine.BaseRouteService.doWarmUp(BaseRouteService.java:181)
           at 
org.apache.camel.impl.engine.BaseRouteService.warmUp(BaseRouteService.java:129)
           ... 18 more
   Caused by: java.lang.NoSuchMethodException: 
org.apache.camel.component.xslt.XsltBuilder.<init>
           at java.lang.Class.getConstructor0(DynamicHub.java:3082)
           at java.lang.Class.getDeclaredConstructor(DynamicHub.java:2178)
           at 
org.apache.camel.support.ObjectHelper.newInstance(ObjectHelper.java:220)
   
   My pom looks like below:
   <?xml version="1.0"?>
   <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd"; 
xmlns="http://maven.apache.org/POM/4.0.0";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.example</groupId>
     <artifactId>camel-route</artifactId>
     <version>1.0-SNAPSHOT</version>
     <properties>
       <compiler-plugin.version>3.8.1</compiler-plugin.version>
       <maven.compiler.parameters>true</maven.compiler.parameters>
       <maven.compiler.source>1.8</maven.compiler.source>
       <maven.compiler.target>1.8</maven.compiler.target>
       <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
       
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
       <quarkus-plugin.version>1.2.0.Final</quarkus-plugin.version>
       
<quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
       <quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
       <quarkus.platform.version>1.2.0.Final</quarkus.platform.version>
       <surefire-plugin.version>2.22.1</surefire-plugin.version>
       <lombok.version>1.18.10</lombok.version>
       <camel.version>3.0.1</camel.version>
     </properties>
     <dependencyManagement>
       <dependencies>
         <dependency>
           <groupId>${quarkus.platform.group-id}</groupId>
           <artifactId>${quarkus.platform.artifact-id}</artifactId>
           <version>${quarkus.platform.version}</version>
           <type>pom</type>
           <scope>import</scope>
         </dependency>
       </dependencies>
     </dependencyManagement>
     <dependencies>
       <dependency>
         <groupId>org.apache.camel.quarkus</groupId>
         <artifactId>camel-quarkus-platform-http</artifactId>
       </dependency>
       <dependency>
         <groupId>org.apache.camel</groupId>
         <artifactId>camel-xslt</artifactId>
       </dependency>
       <dependency>
         <groupId>org.apache.camel</groupId>
         <artifactId>camel-xpath</artifactId>
         <version>${camel.version}</version>
       </dependency>
       <dependency>
         <groupId>org.projectlombok</groupId>
         <artifactId>lombok</artifactId>
         <version>${lombok.version}</version>
         <scope>provided</scope>
       </dependency>
       <dependency>
         <groupId>io.quarkus</groupId>
         <artifactId>quarkus-junit5</artifactId>
         <scope>test</scope>
       </dependency>
       <dependency>
         <groupId>io.rest-assured</groupId>
         <artifactId>rest-assured</artifactId>
         <scope>test</scope>
       </dependency>
     </dependencies>
     <build>
       <plugins>
         <plugin>
           <groupId>io.quarkus</groupId>
           <artifactId>quarkus-maven-plugin</artifactId>
           <version>${quarkus-plugin.version}</version>
           <executions>
             <execution>
               <goals>
                 <goal>build</goal>
               </goals>
             </execution>
           </executions>
         </plugin>
         <plugin>
           <artifactId>maven-compiler-plugin</artifactId>
           <version>${compiler-plugin.version}</version>
         </plugin>
         <plugin>
           <artifactId>maven-surefire-plugin</artifactId>
           <version>${surefire-plugin.version}</version>
           <configuration>
             <systemProperties>
               
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
             </systemProperties>
           </configuration>
         </plugin>
       </plugins>
     </build>
     <profiles>
       <profile>
         <id>native</id>
         <activation>
           <property>
             <name>native</name>
           </property>
         </activation>
         <build>
           <plugins>
             <plugin>
               <artifactId>maven-failsafe-plugin</artifactId>
               <version>${surefire-plugin.version}</version>
               <executions>
                 <execution>
                   <goals>
                     <goal>integration-test</goal>
                     <goal>verify</goal>
                   </goals>
                   <configuration>
                     <systemProperties>
                       
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
                     </systemProperties>
                   </configuration>
                 </execution>
               </executions>
             </plugin>
           </plugins>
         </build>
         <properties>
           <quarkus.package.type>native</quarkus.package.type>
           
<quarkus.native.additional-build-args>-J-Xmx2G,-H:ResourceConfigurationFiles=resources-config.json</quarkus.native.additional-build-args>
         </properties>
       </profile>
     </profiles>
   </project>
   
   My Route class looks as below:
   public class MockRoute extends RouteBuilder {
   
       @Override
       public void configure() {
           Namespaces ns = new Namespaces("s", 
"http://schemas.xmlsoap.org/soap/envelope/";)
                   .add("c", 
"http://www.deltavista.com/dspone/customerlist-if/V001";)
                   .add("o", 
"http://www.deltavista.com/dspone/ordercheck-if/V001";);
   
           
from("platform-http:/dvs-test/services/CustomerListService?httpMethodRestrict=POST").streamCaching().log("${body}")
                   .choice()
                   .when(xpath("/s:Envelope/s:Body/c:addCustomerRequest", 
ns)).to("xslt:xslt/add_customer.xslt")
                   .when(xpath("/s:Envelope/s:Body/c:removeCustomerRequest", 
ns)).to("xslt:xslt/remove_customer.xslt")
                   .otherwise().to("xslt:xslt/unknown_operation.xslt");
   
           
from("platform-http:/dvs-soap/services/OrderCheckService?httpMethodRestrict=POST").streamCaching().log("${body}")
                   .choice()
                   .when(xpath("/s:Envelope/s:Body/o:orderCheckRequest", 
ns)).to("xslt:xslt/order_check.xslt")
                   .otherwise().to("xslt:xslt/unknown_operation.xslt");
       }
   }
   
   Regards,
   Ɓukasz
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to