Error creating bean with name 'sysUserController': Injection of resource dependencies failed; nested

控制台输出的错误:
四月 07, 2017 7:19:55 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring FrameworkServlet ‘spring’
四月 07, 2017 7:19:55 下午 org.springframework.web.servlet.DispatcherServlet initServletBean
信息: FrameworkServlet ‘spring’: initialization started
四月 07, 2017 7:19:55 下午 org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
信息: Refreshing WebApplicationContext for namespace ‘spring-servlet’: startup date [Fri Apr 07 19:19:55 CST 2017]; parent: Root WebApplicationContext
四月 07, 2017 7:19:55 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-mvc.xml]
四月 07, 2017 7:19:55 下午 org.springframework.web.servlet.DispatcherServlet initServletBean
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sysUserController’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.neusoft.test.service.ISysUserService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}**

四月 07, 2017 7:19:55 下午 org.apache.catalina.core.ApplicationContext log
严重: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sysUserController’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.neusoft.test.service.ISysUserService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
解决办法:
注意查看spring的公共配置文件,base-pakage的路径是否正确。

<description>Spring公共配置 description>

    
    <context:component-scan base-package="com.haha" use-default-filters="true">
        <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
    context:component-scan>

你可能感兴趣的:(mybatis,spring-mvc)