Error creating bean with name 'adminUserController': Injection of autowired dependencies failed;

时间:2022-11-19 17:26:38

spring 个坑爹地,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

下面的错误:

  1. 2014-08-10 15:19:02.751 [main] ERROR o.s.web.servlet.DispatcherServlet - Context initialization failed
  2. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adminUserController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.com.jsoft.service.IAdminUserService cn.com.jsoft.controller.AdminUserController.service; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.com.jsoft.service.IAdminUserService] 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. at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  4. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1122) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  5. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  6. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  7. at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  8. at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  9. at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  10. at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  11. at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  12. at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) ~[spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  13. at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) ~[spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  14. at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  15. at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:599) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  16. at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  17. at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:518) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  18. at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:459) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  19. at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) [spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
  20. at javax.servlet.GenericServlet.init(GenericServlet.java:212) [servlet-api.jar:2.5.MR2]
  21. at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206) [catalina.jar:6.0.35]
  22. at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026) [catalina.jar:6.0.35]
  23. at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421) [catalina.jar:6.0.35]
  24. at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734) [catalina.jar:6.0.35]
  25. at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) [catalina.jar:6.0.35]
  26. at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) [catalina.jar:6.0.35]
  27. at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) [catalina.jar:6.0.35]
  28. at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675) [catalina.jar:6.0.35]
  29. at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601) [catalina.jar:6.0.35]
  30. at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502) [catalina.jar:6.0.35]
  31. at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317) [catalina.jar:6.0.35]
  32. at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324) [catalina.jar:6.0.35]
  33. at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) [catalina.jar:6.0.35]
  34. at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065) [catalina.jar:6.0.35]
  35. at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) [catalina.jar:6.0.35]
  36. at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) [catalina.jar:6.0.35]
  37. at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) [catalina.jar:6.0.35]
  38. at org.apache.catalina.core.StandardService.start(StandardService.java:525) [catalina.jar:6.0.35]
  39. at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) [catalina.jar:6.0.35]
  40. at org.apache.catalina.startup.Catalina.start(Catalina.java:595) [catalina.jar:6.0.35]
  41. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_13]
  42. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_13]
  43. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_13]
  44. at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_13]
  45. at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) [bootstrap.jar:6.0.35]
  46. at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) [bootstrap.jar:6.0.35]

请检查:

1,service是否存在,比如你复制的时候掉了;

2,service是否有@service标识;

3,耐着性子看。