spring-cloud / spring-cloud-kubernetes

Kubernetes integration with Spring Cloud Discovery Client, Configuration, etc...
Apache License 2.0
3.43k stars 1.03k forks source link

No qualifying bean of type 'io.kubernetes.client.informer.SharedInformerFactory' #1640

Closed rcbandit111 closed 2 months ago

rcbandit111 commented 2 months ago

I get error:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'kubernetesClientInformerDiscoveryClient' defined in class path resource [org/springframework/cloud/kubernetes/client/discovery/KubernetesInformerDiscoveryClientAutoConfiguration.class]: Unsatisfied dependency expressed through method 'kubernetesClientInformerDiscoveryClient' parameter 0: No qualifying bean of type 'io.kubernetes.client.informer.SharedInformerFactory' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:795) ~[spring-beans-6.1.5.jar!/:6.1.5]
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:542) ~[spring-beans-6.1.5.jar!/:6.1.5]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1335) ~[spring-beans-6.1.5.jar!/:6.1.
.........
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'io.kubernetes.client.informer.SharedInformerFactory' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1880) ~[spring-beans-6.1.5.jar!/:6.1.5]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1406) ~[spring-beans-6.1.5.jar!/:6.1.5]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353) ~[spring-beans-6.1.5.jar!/:6.1.5]
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:904) ~[spring-beans-6.1.5.jar!/:6.1.5]
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:782) ~[spring-beans-6.1.5.jar!/:6.1.5]
        ... 40 common frames omitted

@wind57 Can you advice some solution, please? The project is too big to make a smart example but I will try.

wind57 commented 2 months ago

As with any other issue that you have opened, I can't look at various stack traces and help. Without an example, that is reproducible, I can't do anything.

Until you provide such examples, I can do exactly zero in helping you. This has to work both ways: you work on providing ways for us to reproduce an issue, we try to fix it. Until that happens, I personally, cant do anything

spring-cloud-issues commented 2 months ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-cloud-issues commented 2 months ago

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.