You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2015/08/06 09:36:05 UTC

[jira] [Commented] (CAMEL-9058) Spring Boot startup failure when running executable war file with libraries containing TypeConverter services file and classes annotated @Converter

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

Claus Ibsen commented on CAMEL-9058:
------------------------------------

What version of Smooks do you use? 

> Spring Boot startup failure when running executable war file with libraries containing TypeConverter services file and classes annotated @Converter
> ---------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-9058
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9058
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-spring-boot
>    Affects Versions: 2.15.2
>         Environment: Mac OS X
> Java 8
>            Reporter: pavan dinavahi
>            Priority: Critical
>
> When running Camel within Spring Boot and using Smooks, the AnnotationTypeConverterLoader is not able find any @Converter annotated classes with the Spring Boot Executable War file, this causes a startup failure of the Spring Boot application. The @Converter annotated classes are within the Smooks library within WEB-INF/lib/ of the Spring Boot generated executable War file. 
> The AnnotationTypeConverterLoader default strategy is using the Resolver's findAnnotated method for loading @Converter annotated classes within the WAR. There is no way to configure a custom TypeConverterLoader within CamelContext or SpringCamelContext either. 
>  
> I had to rebuild the Smooks library without the META-INF/services/org/apache/camel/TypeConverter file to get the application running.
>  
> Please note that this was not an issue when running Spring Boot using "gradle bootRun".
>  
> 2015-08-05 15:53:16.440 ERROR 5915 --- [           main] o.s.boot.SpringApplication               : Application startup failed
> org.apache.camel.spring.boot.CamelSpringBootInitializationException: org.apache.camel.RuntimeCamelException: org.apache.camel.TypeConverterLoaderException: Failed to load type converters because of: Cannot find any type converter classes from the following packages: [org.milyn.smooks.camel.converters]
>     at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:69)
>     at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:29)
>     at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
>     at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
>     at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)
>     at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773)
>     at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:140)
>     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
>     at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
>     at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
>     at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
>     at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
>     at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
>     at com.ea.it.coalesce.CamelConfig.main(CamelConfig.java:69)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:483)
>     at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
>     at java.lang.Thread.run(Thread.java:744)
> Caused by: org.apache.camel.RuntimeCamelException: org.apache.camel.TypeConverterLoaderException: Failed to load type converters because of: Cannot find any type converter classes from the following packages: [org.milyn.smooks.camel.converters]
>     at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1619)
>     at org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:1979)
>     at org.apache.camel.impl.DefaultCamelContext.getTypeConverterRegistry(DefaultCamelContext.java:2000)
>     at org.apache.camel.impl.DefaultCamelContext.forceLazyInitialization(DefaultCamelContext.java:3220)
>     at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2579)
>     at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:167)
>     at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2467)
>     at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2463)
>     at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2486)
>     at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2463)
>     at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
>     at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2432)
>     at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:67)
>     ... 19 common frames omitted
> Caused by: org.apache.camel.TypeConverterLoaderException: Failed to load type converters because of: Cannot find any type converter classes from the following packages: [org.milyn.smooks.camel.converters]
>     at org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:119)
>     at org.apache.camel.impl.converter.BaseTypeConverterRegistry.loadTypeConverters(BaseTypeConverterRegistry.java:544)
>     at org.apache.camel.impl.converter.DefaultTypeConverter.doStart(DefaultTypeConverter.java:53)
>     at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
>     at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:2869)
>     at org.apache.camel.impl.DefaultCamelContext.doAddService(DefaultCamelContext.java:1097)
>     at org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:1058)
>     at org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:1054)
>     at org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:1977)
>     ... 30 common frames omitted



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)