[
https://issues.apache.org/jira/browse/CAMEL-11440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16064642#comment-16064642
]
Andrea Tarocchi commented on CAMEL-11440:
-----------------------------------------
Hi Claus,
running the reproducer bumping camel version to 2.19.1 seems to solve the issue;
but if I add a {{<restConfiguration>}} component (which was part of my original
issue, but I stripped down the reproducer to the bear minimum), it seems there
is another problem:
{code:java}
12:24:55.542 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Invoking
afterPropertiesSet() on bean with name 'camelMain'
12:24:55.551 [main] ERROR o.s.boot.SpringApplication - Error handling failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'camelMain': Invocation of init method failed; nested exception is
java.lang.IllegalStateException:
org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1bd655b8
has not been refreshed yet
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at
org.springframework.context.event.AbstractApplicationEventMulticaster.retrieveApplicationListeners(AbstractApplicationEventMulticaster.java:228)
at
org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:185)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:382)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:336)
at
org.springframework.boot.context.event.EventPublishingRunListener.finished(EventPublishingRunListener.java:100)
at
org.springframework.boot.SpringApplicationRunListeners.callFinishedListener(SpringApplicationRunListeners.java:79)
at
org.springframework.boot.SpringApplicationRunListeners.finished(SpringApplicationRunListeners.java:72)
at
org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:789)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
at com.mycompany.Application.main(Application.java:35)
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:498)
at
org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:506)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException:
org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1bd655b8
has not been refreshed yet
at
org.springframework.context.support.AbstractApplicationContext.assertBeanFactoryActive(AbstractApplicationContext.java:1063)
at
org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1177)
at
org.apache.camel.spring.CamelContextFactoryBean.getBeanForType(CamelContextFactoryBean.java:234)
at
org.apache.camel.core.xml.AbstractCamelContextFactoryBean.afterPropertiesSet(AbstractCamelContextFactoryBean.java:166)
at
org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:289)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579)
... 25 common frames omitted
12:24:55.586 [main] DEBUG o.s.b.diagnostics.FailureAnalyzers - FailureAnalyzer
org.springframework.boot.autoconfigure.diagnostics.analyzer.NoSuchBeanDefinitionFailureAnalyzer@4e1e0f66
failed
java.lang.NoSuchMethodError:
org.springframework.beans.factory.NoSuchBeanDefinitionException.getResolvableType()Lorg/springframework/core/ResolvableType;
at
org.springframework.boot.autoconfigure.diagnostics.analyzer.NoSuchBeanDefinitionFailureAnalyzer$BeanMethods.isMatch(NoSuchBeanDefinitionFailureAnalyzer.java:220)
at
org.springframework.boot.autoconfigure.diagnostics.analyzer.NoSuchBeanDefinitionFailureAnalyzer$BeanMethods.findBeanMethods(NoSuchBeanDefinitionFailureAnalyzer.java:202)
at
org.springframework.boot.autoconfigure.diagnostics.analyzer.NoSuchBeanDefinitionFailureAnalyzer$BeanMethods.<init>(NoSuchBeanDefinitionFailureAnalyzer.java:190)
at
org.springframework.boot.autoconfigure.diagnostics.analyzer.NoSuchBeanDefinitionFailureAnalyzer.collectReportedConditionOutcomes(NoSuchBeanDefinitionFailureAnalyzer.java:132)
at
org.springframework.boot.autoconfigure.diagnostics.analyzer.NoSuchBeanDefinitionFailureAnalyzer.getAutoConfigurationResults(NoSuchBeanDefinitionFailureAnalyzer.java:120)
at
org.springframework.boot.autoconfigure.diagnostics.analyzer.NoSuchBeanDefinitionFailureAnalyzer.analyze(NoSuchBeanDefinitionFailureAnalyzer.java:79)
at
org.springframework.boot.autoconfigure.diagnostics.analyzer.NoSuchBeanDefinitionFailureAnalyzer.analyze(NoSuchBeanDefinitionFailureAnalyzer.java:53)
at
org.springframework.boot.diagnostics.analyzer.AbstractInjectionFailureAnalyzer.analyze(AbstractInjectionFailureAnalyzer.java:41)
at
org.springframework.boot.diagnostics.AbstractFailureAnalyzer.analyze(AbstractFailureAnalyzer.java:36)
at
org.springframework.boot.diagnostics.FailureAnalyzers.analyze(FailureAnalyzers.java:119)
at
org.springframework.boot.diagnostics.FailureAnalyzers.analyzeAndReport(FailureAnalyzers.java:112)
at
org.springframework.boot.SpringApplication.reportFailure(SpringApplication.java:806)
at
org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:792)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
at com.mycompany.Application.main(Application.java:35)
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:498)
at
org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:506)
at java.lang.Thread.run(Thread.java:748)
12:24:55.590 [main] ERROR o.s.boot.SpringApplication - Application startup
failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'template': Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'camelMain': Invocation of init method failed; nested exception is
org.apache.camel.RuntimeCamelException:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'properties' defined in class path resource
[org/apache/camel/spring/boot/CamelAutoConfiguration.class]: Unsatisfied
dependency expressed through method 'properties' parameter 0; nested exception
is org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean found for dependency [org.apache.camel.CamelContext]: expected
at least 1 bean which qualifies as autowire candidate. Dependency annotations:
{}
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:732)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
at
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737)
at
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
at com.mycompany.Application.main(Application.java:35)
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:498)
at
org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:506)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'camelMain': Invocation of init method failed; nested
exception is org.apache.camel.RuntimeCamelException:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'properties' defined in class path resource
[org/apache/camel/spring/boot/CamelAutoConfiguration.class]: Unsatisfied
dependency expressed through method 'properties' parameter 0; nested exception
is org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean found for dependency [org.apache.camel.CamelContext]: expected
at least 1 bean which qualifies as autowire candidate. Dependency annotations:
{}
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1082)
at
org.apache.camel.spring.CamelBeanPostProcessor$1.getOrLookupCamelContext(CamelBeanPostProcessor.java:71)
at
org.apache.camel.impl.DefaultCamelBeanPostProcessor.postProcessBeforeInitialization(DefaultCamelBeanPostProcessor.java:87)
at
org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:153)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1575)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
... 21 common frames omitted
Caused by: org.apache.camel.RuntimeCamelException:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'properties' defined in class path resource
[org/apache/camel/spring/boot/CamelAutoConfiguration.class]: Unsatisfied
dependency expressed through method 'properties' parameter 0; nested exception
is org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean found for dependency [org.apache.camel.CamelContext]: expected
at least 1 bean which qualifies as autowire candidate. Dependency annotations:
{}
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1774)
at
org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookupByName(PropertyPlaceholderDelegateRegistry.java:52)
at
org.apache.camel.util.CamelContextHelper.lookupPropertiesComponent(CamelContextHelper.java:651)
at
org.apache.camel.impl.DefaultCamelContext.resolvePropertyPlaceholders(DefaultCamelContext.java:2406)
at
org.apache.camel.util.CamelContextHelper.parseBoolean(CamelContextHelper.java:430)
at
org.apache.camel.core.xml.AbstractCamelContextFactoryBean.initCamelContext(AbstractCamelContextFactoryBean.java:819)
at
org.apache.camel.core.xml.AbstractCamelContextFactoryBean.afterPropertiesSet(AbstractCamelContextFactoryBean.java:336)
at
org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:289)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579)
... 34 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'properties' defined in class path resource
[org/apache/camel/spring/boot/CamelAutoConfiguration.class]: Unsatisfied
dependency expressed through method 'properties' parameter 0; nested exception
is org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean found for dependency [org.apache.camel.CamelContext]: expected
at least 1 bean which qualifies as autowire candidate. Dependency annotations:
{}
at
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
at
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:467)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1023)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1076)
at
org.apache.camel.spring.spi.ApplicationContextRegistry.lookupByName(ApplicationContextRegistry.java:71)
at
org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookupByName(PropertyPlaceholderDelegateRegistry.java:50)
... 42 common frames omitted
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean found for dependency [org.apache.camel.CamelContext]: expected
at least 1 bean which qualifies as autowire candidate. Dependency annotations:
{}
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1463)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1094)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1056)
at
org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
at
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
... 54 common frames omitted
[WARNING]
java.lang.reflect.InvocationTargetException
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:498)
at
org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:506)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'template': Initialization of bean failed; nested
exception is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'camelMain': Invocation of init method failed; nested
exception is org.apache.camel.RuntimeCamelException:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'properties' defined in class path resource
[org/apache/camel/spring/boot/CamelAutoConfiguration.class]: Unsatisfied
dependency expressed through method 'properties' parameter 0; nested exception
is org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean found for dependency [org.apache.camel.CamelContext]: expected
at least 1 bean which qualifies as autowire candidate. Dependency annotations:
{}
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:732)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
at
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737)
at
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
at com.mycompany.Application.main(Application.java:35)
... 6 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'camelMain': Invocation of init method failed; nested
exception is org.apache.camel.RuntimeCamelException:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'properties' defined in class path resource
[org/apache/camel/spring/boot/CamelAutoConfiguration.class]: Unsatisfied
dependency expressed through method 'properties' parameter 0; nested exception
is org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean found for dependency [org.apache.camel.CamelContext]: expected
at least 1 bean which qualifies as autowire candidate. Dependency annotations:
{}
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1082)
at
org.apache.camel.spring.CamelBeanPostProcessor$1.getOrLookupCamelContext(CamelBeanPostProcessor.java:71)
at
org.apache.camel.impl.DefaultCamelBeanPostProcessor.postProcessBeforeInitialization(DefaultCamelBeanPostProcessor.java:87)
at
org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:153)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1575)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
... 21 more
Caused by: org.apache.camel.RuntimeCamelException:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'properties' defined in class path resource
[org/apache/camel/spring/boot/CamelAutoConfiguration.class]: Unsatisfied
dependency expressed through method 'properties' parameter 0; nested exception
is org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean found for dependency [org.apache.camel.CamelContext]: expected
at least 1 bean which qualifies as autowire candidate. Dependency annotations:
{}
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1774)
at
org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookupByName(PropertyPlaceholderDelegateRegistry.java:52)
at
org.apache.camel.util.CamelContextHelper.lookupPropertiesComponent(CamelContextHelper.java:651)
at
org.apache.camel.impl.DefaultCamelContext.resolvePropertyPlaceholders(DefaultCamelContext.java:2406)
at
org.apache.camel.util.CamelContextHelper.parseBoolean(CamelContextHelper.java:430)
at
org.apache.camel.core.xml.AbstractCamelContextFactoryBean.initCamelContext(AbstractCamelContextFactoryBean.java:819)
at
org.apache.camel.core.xml.AbstractCamelContextFactoryBean.afterPropertiesSet(AbstractCamelContextFactoryBean.java:336)
at
org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:289)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579)
... 34 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'properties' defined in class path resource
[org/apache/camel/spring/boot/CamelAutoConfiguration.class]: Unsatisfied
dependency expressed through method 'properties' parameter 0; nested exception
is org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean found for dependency [org.apache.camel.CamelContext]: expected
at least 1 bean which qualifies as autowire candidate. Dependency annotations:
{}
at
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
at
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:467)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1023)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1076)
at
org.apache.camel.spring.spi.ApplicationContextRegistry.lookupByName(ApplicationContextRegistry.java:71)
at
org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookupByName(PropertyPlaceholderDelegateRegistry.java:50)
... 42 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean found for dependency [org.apache.camel.CamelContext]: expected
at least 1 bean which qualifies as autowire candidate. Dependency annotations:
{}
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1463)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1094)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1056)
at
org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
at
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
... 54 more
{code}
I've added a second version of the reproducer.
> Some attributes in spring camel xml can't be replaced by property placeholder
> when used in spring boot
> ------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-11440
> URL: https://issues.apache.org/jira/browse/CAMEL-11440
> Project: Camel
> Issue Type: Bug
> Components: camel-spring, camel-spring-boot
> Affects Versions: 2.18.1
> Reporter: Andrea Tarocchi
> Assignee: Claus Ibsen
> Fix For: 2.19.1
>
> Attachments: reproducer2.zip, reproducer.zip
>
>
> Everything initialized in
> {{*org.apache.camel.core.xml.AbstractCamelContextFactoryBean.initCamelContext()*}}
> using a spring camel xml with spring boot, can not contain a property
> otherwise this is the exception thrown:
> {code}
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'camelMain': Invocation of init method failed; nested exception is
> java.lang.IllegalStateException:
> org.springframework.context.annotation.AnnotationConfigApplicationContext@1b99b9f8
> has not been refreshed yet
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
> at
> org.springframework.context.event.AbstractApplicationEventMulticaster.retrieveApplicationListeners(AbstractApplicationEventMulticaster.java:228)
> at
> org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:185)
> at
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
> at
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:382)
> at
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:336)
> at
> org.springframework.boot.context.event.EventPublishingRunListener.finished(EventPublishingRunListener.java:93)
> at
> org.springframework.boot.SpringApplicationRunListeners.callFinishedListener(SpringApplicationRunListeners.java:79)
> at
> org.springframework.boot.SpringApplicationRunListeners.finished(SpringApplicationRunListeners.java:72)
> at
> org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:813)
> at
> org.springframework.boot.SpringApplication.run(SpringApplication.java:326)
> at
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
> at
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
> at com.mycompany.Application.main(Application.java:34)
> 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:498)
> at
> org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:506)
> at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.IllegalStateException:
> org.springframework.context.annotation.AnnotationConfigApplicationContext@1b99b9f8
> has not been refreshed yet
> at
> org.springframework.context.support.AbstractApplicationContext.assertBeanFactoryActive(AbstractApplicationContext.java:1063)
> at
> org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1177)
> at
> org.apache.camel.spring.CamelContextFactoryBean.getBeanForType(CamelContextFactoryBean.java:220)
> at
> org.apache.camel.core.xml.AbstractCamelContextFactoryBean.afterPropertiesSet(AbstractCamelContextFactoryBean.java:159)
> at
> org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:275)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579)
> ... 25 common frames omitted
> 14:12:57.942 [main] DEBUG o.s.b.d.LoggingFailureAnalysisReporter -
> Application failed to start due to an exception
> org.springframework.beans.factory.NoSuchBeanDefinitionException: No
> qualifying bean of type 'org.apache.camel.CamelContext' available: expected
> at least 1 bean which qualifies as autowire candidate. Dependency
> annotations: {}
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1466)
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1097)
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059)
> at
> org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
> at
> org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
> at
> org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:467)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1022)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
> at
> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1076)
> at
> org.apache.camel.spring.spi.ApplicationContextRegistry.lookupByName(ApplicationContextRegistry.java:71)
> at
> org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookupByName(PropertyPlaceholderDelegateRegistry.java:50)
> at
> org.apache.camel.util.CamelContextHelper.lookupPropertiesComponent(CamelContextHelper.java:575)
> at
> org.apache.camel.impl.DefaultCamelContext.resolvePropertyPlaceholders(DefaultCamelContext.java:2343)
> at
> org.apache.camel.util.CamelContextHelper.parseBoolean(CamelContextHelper.java:354)
> at
> org.apache.camel.core.xml.AbstractCamelContextFactoryBean.initCamelContext(AbstractCamelContextFactoryBean.java:769)
> at
> org.apache.camel.core.xml.AbstractCamelContextFactoryBean.afterPropertiesSet(AbstractCamelContextFactoryBean.java:322)
> at
> org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:275)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
> at
> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1082)
> at
> org.apache.camel.spring.CamelBeanPostProcessor$1.getOrLookupCamelContext(CamelBeanPostProcessor.java:66)
> at
> org.apache.camel.impl.DefaultCamelBeanPostProcessor.postProcessBeforeInitialization(DefaultCamelBeanPostProcessor.java:87)
> at
> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:131)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1575)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:735)
> at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
> at
> org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)
> at
> org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)
> at
> org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
> at
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
> at
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
> at com.mycompany.Application.main(Application.java:34)
> 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:498)
> at
> org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:506)
> at java.lang.Thread.run(Thread.java:748)
> 14:12:57.943 [main] ERROR o.s.b.d.LoggingFailureAnalysisReporter -
> ***************************
> APPLICATION FAILED TO START
> ***************************
> Description:
> Parameter 0 of method properties in
> org.apache.camel.spring.boot.CamelAutoConfiguration required a bean of type
> 'org.apache.camel.CamelContext' that could not be found.
> - Bean method 'camelContext' in 'CamelAutoConfiguration' not loaded
> because @ConditionalOnMissingBean (types: org.apache.camel.CamelContext;
> SearchStrategy: all) found bean 'camelMain'
> Action:
> Consider revisiting the conditions above or defining a bean of type
> 'org.apache.camel.CamelContext' in your configuration.
> [WARNING]
> java.lang.reflect.InvocationTargetException
> 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:498)
> at
> org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:506)
> at java.lang.Thread.run(Thread.java:748)
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'template': Initialization of bean failed; nested
> exception is org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'camelMain': Invocation of init method failed; nested
> exception is org.apache.camel.RuntimeCamelException:
> org.springframework.beans.factory.UnsatisfiedDependencyException: Error
> creating bean with name 'properties' defined in class path resource
> [org/apache/camel/spring/boot/CamelAutoConfiguration.class]: Unsatisfied
> dependency expressed through method 'properties' parameter 0; nested
> exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
> No qualifying bean of type 'org.apache.camel.CamelContext' available:
> expected at least 1 bean which qualifies as autowire candidate. Dependency
> annotations: {}
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:735)
> at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
> at
> org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)
> at
> org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)
> at
> org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
> at
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
> at
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
> at com.mycompany.Application.main(Application.java:34)
> ... 6 more
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'camelMain': Invocation of init method failed; nested
> exception is org.apache.camel.RuntimeCamelException:
> org.springframework.beans.factory.UnsatisfiedDependencyException: Error
> creating bean with name 'properties' defined in class path resource
> [org/apache/camel/spring/boot/CamelAutoConfiguration.class]: Unsatisfied
> dependency expressed through method 'properties' parameter 0; nested
> exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
> No qualifying bean of type 'org.apache.camel.CamelContext' available:
> expected at least 1 bean which qualifies as autowire candidate. Dependency
> annotations: {}
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
> at
> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1082)
> at
> org.apache.camel.spring.CamelBeanPostProcessor$1.getOrLookupCamelContext(CamelBeanPostProcessor.java:66)
> at
> org.apache.camel.impl.DefaultCamelBeanPostProcessor.postProcessBeforeInitialization(DefaultCamelBeanPostProcessor.java:87)
> at
> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:131)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1575)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
> ... 20 more
> Caused by: org.apache.camel.RuntimeCamelException:
> org.springframework.beans.factory.UnsatisfiedDependencyException: Error
> creating bean with name 'properties' defined in class path resource
> [org/apache/camel/spring/boot/CamelAutoConfiguration.class]: Unsatisfied
> dependency expressed through method 'properties' parameter 0; nested
> exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
> No qualifying bean of type 'org.apache.camel.CamelContext' available:
> expected at least 1 bean which qualifies as autowire candidate. Dependency
> annotations: {}
> at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1763)
> at
> org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookupByName(PropertyPlaceholderDelegateRegistry.java:52)
> at
> org.apache.camel.util.CamelContextHelper.lookupPropertiesComponent(CamelContextHelper.java:575)
> at
> org.apache.camel.impl.DefaultCamelContext.resolvePropertyPlaceholders(DefaultCamelContext.java:2343)
> at
> org.apache.camel.util.CamelContextHelper.parseBoolean(CamelContextHelper.java:354)
> at
> org.apache.camel.core.xml.AbstractCamelContextFactoryBean.initCamelContext(AbstractCamelContextFactoryBean.java:769)
> at
> org.apache.camel.core.xml.AbstractCamelContextFactoryBean.afterPropertiesSet(AbstractCamelContextFactoryBean.java:322)
> at
> org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:275)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579)
> ... 33 more
> Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException:
> Error creating bean with name 'properties' defined in class path resource
> [org/apache/camel/spring/boot/CamelAutoConfiguration.class]: Unsatisfied
> dependency expressed through method 'properties' parameter 0; nested
> exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
> No qualifying bean of type 'org.apache.camel.CamelContext' available:
> expected at least 1 bean which qualifies as autowire candidate. Dependency
> annotations: {}
> at
> org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
> at
> org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:467)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1022)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
> at
> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1076)
> at
> org.apache.camel.spring.spi.ApplicationContextRegistry.lookupByName(ApplicationContextRegistry.java:71)
> at
> org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookupByName(PropertyPlaceholderDelegateRegistry.java:50)
> ... 41 more
> Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
> No qualifying bean of type 'org.apache.camel.CamelContext' available:
> expected at least 1 bean which qualifies as autowire candidate. Dependency
> annotations: {}
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1466)
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1097)
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059)
> at
> org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
> at
> org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
> ... 53 more
> {code}
> basically spring while instantiating CamelContext for whatever is in
> initCamelContext() and need a property resolution will try to find a bean
> named "properties" and not finding it will try to instantiate it from
> *{{org.apache.camel.spring.boot.CamelAutoConfiguration.properties(CamelContext
> camelContext, PropertiesParser parser)}}* failing with the mentioned
> exception.
> If an explicit property placeholder is defined like:
> {code:xml}
> <propertyPlaceholder id="properties" location="application.properties"/>
> {code}
> then all works fine.
> There is a simple reproducer attached.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)