ERROR[localhost-startStop-1] - Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.itheima.core.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
contextConfigLocation
classpath:applicationContext.xml
org.springframework.web.context.ContextCleanupListener
org.springframework.web.context.ContextLoaderListener
关于 application-context.xml 和 spring-mvc.xml 配置的理解
1、application-context.xml是全局的,应用于多个serverlet,配合listener一起使用,web.xml中配置如下:
org.springframework.web.context.ContextLoaderListener
contextConfigLocation
classpath:applicationContext.xml
2、spring-mvc.xml 是spring mvc的配置,web.xml中配置如下:
crm
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
classpath:springmvc-config.xml
1



