前言:昨天在做一个小项目时先对 SSM 进行整合,一通配置之后进行测试,发现启动 Tomcat 就出错了,错误信息如下:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'employeeController':
Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException:
Could not autowire field: private com.mybatis.ssm.service.EmployeeService com.mybatis.ssm.controller.
EmployeeController.employeeService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type [com.mybatis.ssm.service.EmployeeService] 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)}
Caused by: org.springframework.beans.factory.BeanCreationException:
Could not autowire field:
private com.my