org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminController' defined in file [C:\Users\Kody\IdeaProjects\tomcat7-x64\webapps\library\WEB-INF\classes\libraryapp\controller\AdminController.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [libraryapp.repository.services.AdminServices]: : No qualifying bean of type [libraryapp.repository.services.AdminServices] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [libraryapp.repository.services.AdminServices] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}

Stack Overflow | Cybersubtype | 5 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael . Or join the community to write better ones.
  1. 0

    Data injection with Spring and Hibernate (Based on Pet Clinic)

    Stack Overflow | 5 months ago | Cybersubtype
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminController' defined in file [C:\Users\Kody\IdeaProjects\tomcat7-x64\webapps\library\WEB-INF\classes\libraryapp\controller\AdminController.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [libraryapp.repository.services.AdminServices]: : No qualifying bean of type [libraryapp.repository.services.AdminServices] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [libraryapp.repository.services.AdminServices] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
  2. 0

    How to use spring data in spring mvc with annotation configuration

    Stack Overflow | 3 weeks ago | Peter
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userRepository': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.lang.Class>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
  3. 0

    Java JPA with Hibernate configuration issue

    Stack Overflow | 4 months ago | Florin Lei
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userService': Unsatisfied dependency expressed through field 'userRepository'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean found for dependency [com.inugoliath.accountancy.core.persistence.repository.UserRepository]: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0
    samebug tip
    If you want to keep using @EnableWebMvc annotation, you have to add the code on the first answer of this page: https://goo.gl/JoHTKU to your code
  6. 0
    samebug tip
    Springboot auto-configuration is disabled when you try to use WebMvcConfigurerAdapter and @EnableWebMvc. If WebConfig is not of the essence, remove it and use SpringBoot auto-configuration.
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.NoSuchBeanDefinitionException

    No qualifying bean of type [libraryapp.repository.services.AdminServices] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException()
  2. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373)[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    2. org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119)[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    3. org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    4. org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    5. org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    6. org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1143)[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    8. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1046)[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    9. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    10. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    11. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    12. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    13. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    14. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    15. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    15 frames
  3. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:835)[spring-context-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)[spring-context-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    2 frames
  4. Spring
    ContextLoaderListener.contextInitialized
    1. org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)[spring-web-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    2. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)[spring-web-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    3. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)[spring-web-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    3 frames
  5. Glassfish Core
    HostConfig.manageApp
    1. org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)[catalina.jar:7.0.72]
    2. org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)[catalina.jar:7.0.72]
    3. org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)[catalina.jar:7.0.72]
    4. org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)[catalina.jar:7.0.72]
    5. org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)[catalina.jar:7.0.72]
    6. org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)[catalina.jar:7.0.72]
    7. org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1863)[catalina.jar:7.0.72]
    7 frames
  6. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.7.0_79]
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[na:1.7.0_79]
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.7.0_79]
    4. java.lang.reflect.Method.invoke(Method.java:606)[na:1.7.0_79]
    4 frames
  7. Embedded GlassFish Web
    BaseModelMBean.invoke
    1. org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)[tomcat-coyote.jar:7.0.72]
    1 frame
  8. Java RT
    JmxMBeanServer.invoke
    1. com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)[na:1.7.0_79]
    2. com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)[na:1.7.0_79]
    2 frames
  9. Embedded GlassFish Web
    MBeanFactory.createStandardContext
    1. org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618)[catalina.jar:7.0.72]
    2. org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565)[catalina.jar:7.0.72]
    2 frames
  10. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.7.0_79]
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[na:1.7.0_79]
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.7.0_79]
    4. java.lang.reflect.Method.invoke(Method.java:606)[na:1.7.0_79]
    4 frames
  11. Embedded GlassFish Web
    BaseModelMBean.invoke
    1. org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)[tomcat-coyote.jar:7.0.72]
    1 frame
  12. Java RT
    Thread.run
    1. com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)[na:1.7.0_79]
    2. com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)[na:1.7.0_79]
    3. javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1487)[na:1.7.0_79]
    4. javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:97)[na:1.7.0_79]
    5. javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1328)[na:1.7.0_79]
    6. javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1420)[na:1.7.0_79]
    7. javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:848)[na:1.7.0_79]
    8. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.7.0_79]
    9. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[na:1.7.0_79]
    10. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.7.0_79]
    11. java.lang.reflect.Method.invoke(Method.java:606)[na:1.7.0_79]
    12. sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)[na:1.7.0_79]
    13. sun.rmi.transport.Transport$2.run(Transport.java:202)[na:1.7.0_79]
    14. sun.rmi.transport.Transport$2.run(Transport.java:199)[na:1.7.0_79]
    15. java.security.AccessController.doPrivileged(Native Method)[na:1.7.0_79]
    16. sun.rmi.transport.Transport.serviceCall(Transport.java:198)[na:1.7.0_79]
    17. sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:567)[na:1.7.0_79]
    18. sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)[na:1.7.0_79]
    19. sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.access$400(TCPTransport.java:619)[na:1.7.0_79]
    20. sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:684)[na:1.7.0_79]
    21. sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:681)[na:1.7.0_79]
    22. java.security.AccessController.doPrivileged(Native Method)[na:1.7.0_79]
    23. sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:681)[na:1.7.0_79]
    24. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[na:1.7.0_79]
    25. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[na:1.7.0_79]
    26. java.lang.Thread.run(Thread.java:745)[na:1.7.0_79]
    26 frames