opentracing-contrib / opentracing-contrib/java-spring-cloud

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

Open
#267 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
399
Forks
143
Avg merge
1d 3h
Merged PRs (30d)
22

Description

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]

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure after adding the java-spring-cloud Gradle dependency and inspect the application context around iaDataSource and org.springframework.cloud.task.configuration.SimpleTaskAutoConfiguration. Compare the dependency and Spring versions with the BeanCurrentlyInCreationException trace; done means identifying a reproducible compatibility or configuration fix and verifying that the context loads without the circular-reference error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.