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

Java 专栏收录该内容
99 篇文章 1 订阅

Spring 个坑爹地,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,


下面的错误:

2014-08-10 15:19:02.751 [main] ERROR o.s.web.servlet.DispatcherServlet - Context initialization failed
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)}
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1122) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) ~[spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) ~[spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:599) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:518) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:459) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) [spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
	at javax.servlet.GenericServlet.init(GenericServlet.java:212) [servlet-api.jar:2.5.MR2]
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206) [catalina.jar:6.0.35]
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026) [catalina.jar:6.0.35]
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421) [catalina.jar:6.0.35]
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734) [catalina.jar:6.0.35]
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) [catalina.jar:6.0.35]
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) [catalina.jar:6.0.35]
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) [catalina.jar:6.0.35]
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675) [catalina.jar:6.0.35]
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601) [catalina.jar:6.0.35]
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502) [catalina.jar:6.0.35]
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317) [catalina.jar:6.0.35]
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324) [catalina.jar:6.0.35]
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) [catalina.jar:6.0.35]
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065) [catalina.jar:6.0.35]
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) [catalina.jar:6.0.35]
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) [catalina.jar:6.0.35]
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) [catalina.jar:6.0.35]
	at org.apache.catalina.core.StandardService.start(StandardService.java:525) [catalina.jar:6.0.35]
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) [catalina.jar:6.0.35]
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595) [catalina.jar:6.0.35]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_13]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_13]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_13]
	at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_13]
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) [bootstrap.jar:6.0.35]
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) [bootstrap.jar:6.0.35]

请检查:

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


2,service是否有@service标识;


3,耐着性子看。

  • 4
    点赞
  • 5
    评论
  • 0
    收藏
  • 打赏
    打赏
  • 扫一扫,分享海报

评论 5 您还未登录,请先 登录 后发表或查看评论
©️2022 CSDN 皮肤主题:程序猿惹谁了 设计师:我叫白小胖 返回首页

打赏作者

xb12369

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值