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,耐着性子看。