org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.myapp.server.dao.common.MyDaoTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.myapp.server.dao.common.UserAccountDao com.myapp.server.dao.BaseDaoTests.userAccountDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.myapp.server.dao.common.UserAccountDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

Stack Overflow | tjholmes66 | 8 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    change Spring Config database for unit testing

    Stack Overflow | 8 months ago | tjholmes66
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.myapp.server.dao.common.MyDaoTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.myapp.server.dao.common.UserAccountDao com.myapp.server.dao.BaseDaoTests.userAccountDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.myapp.server.dao.common.UserAccountDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
  2. 0

    junit test case giving error

    Stack Overflow | 4 years ago | user2893700
    org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.enbee.admin.controller.AddInstiDeptLibController com.enbee.admin.controller.AddSchoolTest.controller; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.enbee.admin.controller.AddInstiDeptLibController] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
  3. 0

    Spring Batch - trunk 2303: Build result summary - Spring CI

    spring.io | 1 year ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.batch.core.scope.AsyncStepScopeIntegrationTests': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.batch.core.scope.Collaborator org.springframework.batch.core.scope.AsyncStepScopeIntegrationTests.simple; nested exception is java.lang.IllegalStateException: No Scope registered for scope 'step'
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Spring Batch - trunk 5942: Build result summary - Spring CI

    spring.io | 1 year ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.batch.sample.iosample.TwoJobInstancesDelimitedFunctionalTests': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.batch.item.file.FlatFileItemReader org.springframework.batch.sample.iosample.TwoJobInstancesDelimitedFunctionalTests.reader; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.springframework.batch.item.file.FlatFileItemReader] is defined: Unsatisfied dependency of type [class org.springframework.batch.item.file.FlatFileItemReader]: expected at least 1 matching bean
  6. 0

    How do I stop other JUnit tests stealing my Spring Root Controller?

    Stack Overflow | 1 year ago | hawkeye
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.MyHandlerInterceptorTest ': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping com.MyHandlerInterceptorTest.requestMappingHandlerMapping; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration: Initialization of bean failed; nested exception is org.springframework.context.ApplicationContextException: Cannot reinitialize with different application context: current one is [Root WebApplicationContext: startup date [XXX 2016]; root of context hierarchy], passed-in one is [org.springframework.context.support.GenericApplicationContext@4760457f: startup date [XXX 2016]; root of context hierarchy]

  1. marcbouvierdav 8 times, last 7 months ago
  2. Bugger 1 times, last 1 year ago
18 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.beans.factory.BeanCreationException

    Error creating bean with name 'com.myapp.server.dao.common.MyDaoTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.myapp.server.dao.common.UserAccountDao com.myapp.server.dao.BaseDaoTests.userAccountDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.myapp.server.dao.common.UserAccountDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues()
  2. Spring Beans
    AbstractAutowireCapableBeanFactory.autowireBeanProperties
    1. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
    2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:385)
    3 frames
  3. Spring TestContext
    SpringJUnit4ClassRunner.createTest
    1. org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118)
    2. org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
    3. org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:228)
    4. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:230)
    4 frames