[
https://issues.apache.org/jira/browse/CAMEL-4231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Freeman Fang updated CAMEL-4231:
--------------------------------
Attachment: CAMEL-4231-new.patch
attach CAMEL-4231-new.patch which change the load order, loadCoreTypeConverters
firstly, keep it same as the scenario out-of OSGi container.
> shouldn't call BaseTypeConverterRegistry.loadTypeConverters() in OSGi
> container
> -------------------------------------------------------------------------------
>
> Key: CAMEL-4231
> URL: https://issues.apache.org/jira/browse/CAMEL-4231
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Reporter: Freeman Fang
> Assignee: Claus Ibsen
> Fix For: 2.8.0
>
> Attachments: CAMEL-4231-new.patch, CAMEL-4231.patch
>
>
> the Activator in camel-core take care of loading the converters from bundles,
> we should avoid calling BaseTypeConverterRegistry.loadTypeConverters() in
> OSGi container, otherwise due to no classloader was specified, see this code
> in OsgiTypeConverter
> @Override
> public Set<ClassLoader> getClassLoaders() {
> // we don't need any classloaders as we use osgi service
> tracker instead
> return Collections.emptySet();
> }
> we'll get exception like
> Caused by: org.apache.camel.TypeConverterLoaderException: Failed to load type
> converters because of: Cannot find any type converter classes from the
> following packages: [org.apache.servicemix.camel.converter]
> at
> org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:90)
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.loadTypeConverters(BaseTypeConverterRegistry.java:406)
> at
> org.apache.camel.impl.converter.DefaultTypeConverter.doStart(DefaultTypeConverter.java:42)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
> at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:56)
> at
> org.apache.camel.core.osgi.OsgiTypeConverter.createRegistry(OsgiTypeConverter.java:163)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira