Hi, i have a very similar usecase where i need to implement something very similar what Nicola has written while ago.
in my app, i have the very similar configuration and i also needed to use camel-http-starter. (of course there are bits and pieces but later on i narrowed down the error that the issue is due to camel-http-starter) so simply in my final attempt, what i did to demo the problem was to include the camel-http-starter to the original project where Nicola has shared in this link. https://github.com/nicolaferraro/camel-leader-election so here is my clone with that small pom change to show the issue. https://github.com/onderson/camel-leader-election/commit/7d4afae97641c5ff703522e69f5ee152deb2f82f so while Nicola's example is perfectly fine, my example fails to start failing and complaining about KubernetesClusterServiceAutoConfiguration error as below. so is there any idea what might be causing this? 18:27:27.438 [restartedMain] ERROR o.s.boot.SpringApplication - | | Application startup failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cacheAutoConfigurationValidatorPostProcessor' defined in class path resource [org/apache/camel/component/http/springboot/HttpComponentSSLAutoConfiguration.class]: Unsatisfied dependency expressed through method 'cacheAutoConfigurationValidatorPostProcessor' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'camelContext' defined in class path resource [org/apache/camel/spring/boot/CamelAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.CamelContext]: Factory method 'camelContext' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kubernetes-cluster-service' defined in class path resource [org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.cluster.CamelClusterService]: Factory method 'kubernetesClusterService' threw exception; nested exception is java.lang.IllegalArgumentException: target must be specified 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:1178) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance( AbstractAutowireCapableBeanFactory.java:1072) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean( AbstractAutowireCapableBeanFactory.java:511) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean( AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject( AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton( DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean( AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean( AbstractBeanFactory.java:202) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors( PostProcessorRegistrationDelegate.java:176) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors( AbstractApplicationContext.java:687) at org.springframework.context.support.AbstractApplicationContext.refresh( AbstractApplicationContext.java:525) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh( EmbeddedWebApplicationContext.java:122) at org.springframework.boot.SpringApplication.refresh( SpringApplication.java:693) at org.springframework.boot.SpringApplication.refreshContext( SpringApplication.java:360) at org.springframework.boot.SpringApplication.run(SpringApplication.java:303 ) at org.springframework.boot.SpringApplication.run( SpringApplication.java:1118) at org.springframework.boot.SpringApplication.run( SpringApplication.java:1107) at uk.co.arcadiagroup.integration.spo.apll.drop.SpoApllDropApplication.main( SpoApllDropApplication.java:29) 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.devtools.restart.RestartLauncher.run( RestartLauncher.java:49) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'camelContext' defined in class path resource [org/apache/camel/spring/boot/CamelAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.CamelContext]: Factory method 'camelContext' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kubernetes-cluster-service' defined in class path resource [org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.cluster.CamelClusterService]: Factory method 'kubernetesClusterService' threw exception; nested exception is java.lang.IllegalArgumentException: target must be specified at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod( ConstructorResolver.java:599) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod( AbstractAutowireCapableBeanFactory.java:1178) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance( AbstractAutowireCapableBeanFactory.java:1072) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean( AbstractAutowireCapableBeanFactory.java:511) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean( AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject( AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton( DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean( AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean( AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate( DependencyDescriptor.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency( DefaultListableBeanFactory.java:1136) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency( DefaultListableBeanFactory.java:1064) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument( ConstructorResolver.java:835) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray( ConstructorResolver.java:741) ... 24 common frames omitted Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.CamelContext]: Factory method 'camelContext' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kubernetes-cluster-service' defined in class path resource [org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.cluster.CamelClusterService]: Factory method 'kubernetesClusterService' threw exception; nested exception is java.lang.IllegalArgumentException: target must be specified at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate( SimpleInstantiationStrategy.java:189) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod( ConstructorResolver.java:588) ... 37 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kubernetes-cluster-service' defined in class path resource [org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.cluster.CamelClusterService]: Factory method 'kubernetesClusterService' threw exception; nested exception is java.lang.IllegalArgumentException: target must be specified at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod( ConstructorResolver.java:599) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod( AbstractAutowireCapableBeanFactory.java:1178) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance( AbstractAutowireCapableBeanFactory.java:1072) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean( AbstractAutowireCapableBeanFactory.java:511) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean( AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject( AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton( DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean( AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean( AbstractBeanFactory.java:202) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType( DefaultListableBeanFactory.java:519) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType( DefaultListableBeanFactory.java:508) at org.springframework.context.support.AbstractApplicationContext.getBeansOfType( AbstractApplicationContext.java:1188) at org.apache.camel.spring.boot.CamelAutoConfiguration.afterPropertiesSet( CamelAutoConfiguration.java:468) at org.apache.camel.spring.boot.CamelAutoConfiguration.doConfigureCamelContext( CamelAutoConfiguration.java:235) at org.apache.camel.spring.boot.CamelAutoConfiguration.camelContext( CamelAutoConfiguration.java:110) at org.apache.camel.spring.boot.CamelAutoConfiguration$$EnhancerBySpringCGLIB$$1d7bacbe.CGLIB$camelContext$1(<generated>) at org.apache.camel.spring.boot.CamelAutoConfiguration$$EnhancerBySpringCGLIB$$1d7bacbe$$FastClassBySpringCGLIB$$4bc32b82.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper( MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept( ConfigurationClassEnhancer.java:358) at org.apache.camel.spring.boot.CamelAutoConfiguration$$EnhancerBySpringCGLIB$$1d7bacbe.camelContext(<generated>) 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.beans.factory.support.SimpleInstantiationStrategy.instantiate( SimpleInstantiationStrategy.java:162) ... 38 common frames omitted Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.cluster.CamelClusterService]: Factory method 'kubernetesClusterService' threw exception; nested exception is java.lang.IllegalArgumentException: target must be specified at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate( SimpleInstantiationStrategy.java:189) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod( ConstructorResolver.java:588) ... 62 common frames omitted Caused by: java.lang.IllegalArgumentException: target must be specified at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:323) at org.apache.camel.util.IntrospectionSupport.getProperties( IntrospectionSupport.java:254) at org.apache.camel.util.IntrospectionSupport.getNonNullProperties( IntrospectionSupport.java:222) at org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceAutoConfiguration.kubernetesClusterService( KubernetesClusterServiceAutoConfiguration.java:48) at org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceAutoConfiguration$$EnhancerBySpringCGLIB$$cf38c630.CGLIB$kubernetesClusterService$0(<generated>) at org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceAutoConfiguration$$EnhancerBySpringCGLIB$$cf38c630$$FastClassBySpringCGLIB$$5ef4b2e5.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper( MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept( ConfigurationClassEnhancer.java:358) at org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceAutoConfiguration$$EnhancerBySpringCGLIB$$cf38c630.kubernetesClusterService(<generated>) 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.beans.factory.support.SimpleInstantiationStrategy.instantiate( SimpleInstantiationStrategy.java:162) ... 63 common frames omitted
