opentracing-contrib / java-spring-cloud

Distributed tracing for Spring Boot, Cloud and other Spring projects
Apache License 2.0
390 stars 143 forks source link

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'XXXX' #267

Open Akshathhm opened 4 years ago

Akshathhm commented 4 years ago

Hi,

After adding the java-spring-cloud dependency in our gradle, we are getting "UnsatisfiedDependencyException".. Kindly help

ingframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'iaDataSource': Bean with name 'iaDataSource' has been injected into other beans [org.springframework.cloud.task.configuration.SimpleTaskAutoConfiguration] in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example. 2020-01-24T19:13:10.669+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:787) 2020-01-24T19:13:10.669+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:528) 2020-01-24T19:13:10.669+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) 2020-01-24T19:13:10.669+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) 2020-01-24T19:13:10.669+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) 2020-01-24T19:13:10.669+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1108) 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868) 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:128) 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60) 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:275) 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:243) 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99) 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124) 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] ... 50 more 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] 2020-01-24T19:13:10.670+0530 [DEBUG] [TestEventLogger] Caused by: 2020-01-24T19:13:10.671+0530 [DEBUG] [TestEventLogger] org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'iaDataSource': Bean with name 'iaDataSource' has been injected into other beans [org.springframework.cloud.task.configuration.SimpleTaskAutoConfiguration] in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example. 2020-01-24T19:13:10.671+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:624) 2020-01-24T19:13:10.671+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) 2020-01-24T19:13:10.671+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) 2020-01-24T19:13:10.671+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) 2020-01-24T19:13:10.671+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) 2020-01-24T19:13:10.671+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) 2020-01-24T19:13:10.671+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) 2020-01-24T19:13:10.671+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287) 2020-01-24T19:13:10.671+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) 2020-01-24T19:13:10.671+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:874) 2020-01-24T19:13:10.671+0530 [DEBUG] [TestEventLogger] at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:778) 2020-01-24T19:13:10.671+0530 [DEBUG] [TestEventLogger] ... 68 more 2020-01-24T19:13:10.672+0530 [DEBUG] [TestEventLogger]

Akshathhm commented 4 years ago

springBootVersion = '2.2.0.RELEASE' openTracingSpringCloudVersion = '0.3.12'

Akshathhm commented 4 years ago

HELP is required

Akshathhm commented 4 years ago

Is there any update on this issue? Its happening while executing BUILD(test case run)

pavolloffay commented 4 years ago

Cold you please try downgrading spring to 2.1.x and try to build it?

@geoand we depend on SB 2.1.x can there be changes in 2.2.2 which are causing this issue?

geoand commented 4 years ago

It's not uncommon for SB to break compatibility between minor releases so I wouldn't be surprised if something is not working.

A reproducer project would go along way in debugging this

Akshathhm commented 4 years ago

We tried with SB 2.1.7 - But its the same issue

Akshathhm commented 4 years ago

The problem seems to be with inclusion of "opentracing-spring-cloud-jdbc-starter" which is transitive dependency of the java-spring-cloud

Urunov commented 2 years ago

Update dependecy pringBootVersion = latest version openTracingSpringCloudVersion = '0.3.12'