Problem with Camel Properties in Talend ESB 6.4.1

Talend Version       6.4.1

Summary

In Talend ESB 6.4.1, when a route is using custom class org.apache.camel.component.properties.PropertiesComponent, a deployment error occurs.
Additional Versions  
Product Talend ESB
Component Routes
Problem Description

When a route is deployed to runtime, you see the following error:

 

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ipf_esb_001v00.ro_esb_dist_3_0.RO_ESB_DIST': Invocation of init method failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.camel.component.properties.PropertiesComponent] for bean with name 'properties' defined in URL [bundleentry://400.fwk726843606/META-INF/spring/ro_esb_dist.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.camel.component.properties.PropertiesComponent not found from bundle [ipf_esb_001v00.RO_ESB_DIST]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1514) [135:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [135:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [135:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) [135:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) [135:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) [135:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191) [135:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:283) [135:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191) [135:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:638) [135:org.apache.servicemix.bundles.spring-beans:3.2.18.RELEASE_1]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:942) [136:org.apache.servicemix.bundles.spring-context:3.2.18.RELEASE_1]
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69) [182:org.springframework.osgi.core:1.2.1]
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355) [182:org.springframework.osgi.core:1.2.1]
        at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) [182:org.springframework.osgi.core:1.2.1]
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320) [182:org.springframework.osgi.core:1.2.1]
        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132) [183:org.springframework.osgi.extender:1.2.1]
        at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.camel.component.properties.PropertiesComponent] for bean with name 'properties' defined in URL [bundleentry://400.fwk726843606/META-INF/spring/ro_esb_dist.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.camel.component.properties.PropertiesComponent not found from bundle [ipf_esb_001v00.RO_ESB_DIST]
        at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1275) ~[?:?]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:573) ~[?:?]
        at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1347) ~[?:?]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:358) ~[?:?]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:335) ~[?:?]
        at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1188) ~[?:?]
        at org.apache.camel.spring.CamelContextFactoryBean.getBeanForType(CamelContextFactoryBean.java:207) ~[?:?]
        at org.apache.camel.core.xml.AbstractCamelContextFactoryBean.afterPropertiesSet(AbstractCamelContextFactoryBean.java:159) ~[?:?]
        at org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:262) ~[?:?]
        at org.apache.camel.osgi.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:64) ~[?:?]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$6.run(AbstractAutowireCapableBeanFactory.java:1563) ~[?:?]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1561) ~[?:?]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1511) ~[?:?]
        ... 16 more
Caused by: java.lang.ClassNotFoundException: org.apache.camel.component.properties.PropertiesComponent not found from bundle [ipf_esb_001v00.RO_ESB_DIST]
        at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:103) ~[?:?]
        at org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156) ~[?:?]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?]
        at org.springframework.util.ClassUtils.forName(ClassUtils.java:268) ~[?:?]
        at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:419) ~[?:?]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1299) ~[?:?]
        at org.springframework.beans.factory.support.AbstractBeanFactory.access$000(AbstractBeanFactory.java:109) ~[?:?]
        at org.springframework.beans.factory.support.AbstractBeanFactory$4.run(AbstractBeanFactory.java:1265) ~[?:?]
        at org.springframework.beans.factory.support.AbstractBeanFactory$4.run(AbstractBeanFactory.java:1263) ~[?:?]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
        at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1263) ~[?:?]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:573) ~[?:?]
        at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1347) ~[?:?]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:358) ~[?:?]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:335) ~[?:?]
        at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1188) ~[?:?]
        at org.apache.camel.spring.CamelContextFactoryBean.getBeanForType(CamelContextFactoryBean.java:207) ~[?:?]
        at org.apache.camel.core.xml.AbstractCamelContextFactoryBean.afterPropertiesSet(AbstractCamelContextFactoryBean.java:159) ~[?:?]
        at org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:262) ~[?:?]
        at org.apache.camel.osgi.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:64) ~[?:?]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$6.run(AbstractAutowireCapableBeanFactory.java:1563) ~[?:?]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1561) ~[?:?]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1511) ~[?:?]
        ... 16 more
Problem root cause Require-Bundle: org.apache.camel.camel-core was excluded from the generated bundles manifest in this version.
Solution or Workaround

You need to add org.apache.camel.component.properties to import the section of generated manifest for Route (tesb-studio-se/main/plugins/org.talend.designer.camel.dependencies.core/plugin.xml) to resolve the current issue in a general way:

<importPackage
 name="org.apache.camel,
 org.apache.camel.component.properties,
 org.apache.camel.builder,
 org.apache.camel.impl,
 org.apache.camel.main,
 org.apache.camel.management,
 org.apache.camel.model,
 org.apache.camel.spi,
 org.apache.camel.spring,
 routines.system.api"
 />

The missing dependency can be added in this way:

Route Designs > deploy > RO_ESB_DIST > Dependencies > Import packages > Add > org.apache.camel.component.properties

JIRA ticket number  
Version history
Revision #:
3 of 3
Last update:
‎09-29-2018 12:19 AM
Updated by:
 
Labels (3)