[ 
https://issues.apache.org/jira/browse/CAMEL-16419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17311223#comment-17311223
 ] 

Claus Ibsen commented on CAMEL-16419:
-------------------------------------

So its the jar-with-dependencies goal that assemble a fat jar which causes 
service files from camel to be overridden.
So when adding camel-main the order of the JARs is shifted and the plugin then 
causes the services files to be overriden in different order causing it to fail.

So that it worked before, was a "bit of luck".

> Adding core-main dependency throws a NoTypeConversionAvailableException on 
> Duration converter
> ---------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-16419
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16419
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-main
>    Affects Versions: 3.8.0
>            Reporter: Paolo Patierno
>            Priority: Minor
>
> This project [1] uses the maven-assembly-plugin to build fat JARs for the 
> Camel applications it provides; if fat JARs are built and run they work 
> perfectly.
> I tried to add the camel-main dependency to the root pom and to the 
> f1-telemetry-udp-kafka project pom as well, in order to change the 
> application to use the Main class but I noticed that even if without using 
> that class but just adding the camel-main in the pom, the JAR doesn't work 
> anymore.
> If you try to do so, doing a mvn package and then running
> {code:java}
> java -jar 
> f1-telemetry-udp-kafka/target/f1-telemetry-udp-kafka-1.0-SNAPSHOT-jar-with-dependencies.jar
> {code}
> it fails with the following error:
> {code:java}
> 2021-03-28 22:11:19 ERROR F1UdpKafkaApp:52 - Error starting CamelContext
> org.apache.camel.FailedToCreateRouteException: Failed to create route route1 
> at: >>> Aggregate[io.ppatierno.formula1.DriversRouteBuilder$1@1649b0e6 -> 
> [Split[bean[ref:drivers-splitter method:splitDrivers] -> 
> [process[Processor@0x5f8edcc5], 
> To[kafka:f1-telemetry-drivers?brokers=localhost:9092&clientId=drivers&valueSerializer=io.ppatierno.formula1.DriverSerializer],
>  Log[${body}], Log[Driver[id = ${body.participantData.driverId}, hashtag = 
> ${body.hashtag}]]]]]] <<< in route: Route(route1)[From[direct:drivers] -> 
> [Aggregate[io.ppatiern... because of Error parsing [10000] as a 
> java.time.Duration.
>         at 
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:240)
>         at 
> org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74)
>         at 
> org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49)
>         at 
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:604)
>         at 
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:556)
>         at 
> org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2756)
>         at 
> org.apache.camel.support.service.BaseService.init(BaseService.java:83)
>         at 
> org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2475)
>         at 
> org.apache.camel.support.service.BaseService.start(BaseService.java:111)
>         at 
> org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2492)
>         at io.ppatierno.formula1.F1UdpKafkaApp.main(F1UdpKafkaApp.java:49)
> Caused by: java.lang.IllegalArgumentException: Error parsing [10000] as a 
> java.time.Duration.
>         at 
> org.apache.camel.support.CamelContextHelper.parse(CamelContextHelper.java:556)
>         at 
> org.apache.camel.support.CamelContextHelper.parseDuration(CamelContextHelper.java:500)
>         at 
> org.apache.camel.reifier.AbstractReifier.parseDuration(AbstractReifier.java:74)
>         at 
> org.apache.camel.reifier.AggregateReifier.createAggregator(AggregateReifier.java:138)
>         at 
> org.apache.camel.reifier.AggregateReifier.createProcessor(AggregateReifier.java:52)
>         at 
> org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:835)
>         at 
> org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:576)
>         at 
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:236)
>         ... 10 more
> Caused by: org.apache.camel.NoTypeConversionAvailableException: No type 
> converter available to convert from type: java.lang.String to the required 
> type: java.time.Duration with value 10000
>         at 
> org.apache.camel.impl.converter.CoreTypeConverterRegistry.mandatoryConvertTo(CoreTypeConverterRegistry.java:275)
>         at 
> org.apache.camel.impl.converter.CoreTypeConverterRegistry.mandatoryConvertTo(CoreTypeConverterRegistry.java:207)
>         at 
> org.apache.camel.support.CamelContextHelper.parse(CamelContextHelper.java:553)
>         ... 17 more
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to