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 ‘cn.zjq.service.UserServiceImpl’ available: expected at least 1 bean which qualifies as autowire candidate.
问题:
spring-mvc.xml的dispatchservlet的配置文件写错了,此处应该写总的配置文件。
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</init-param>