00:28:01 WARN Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userController’: Unsatisfied dependency expressed through field ‘userService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userServiceImpl’: Unsatisfied dependency expressed through field ‘userDao’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.example.emos.wx.db.dao.TbUserDao’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
00:28:01 INFO Stopping service [Tomcat]
00:28:01 INFO
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
00:28:01 ERROR
APPLICATION FAILED TO START
Description:
Field userDao in com.example.emos.wx.service.impl.UserServiceImpl required a bean of type ‘com.example.emos.wx.db.dao.TbUserDao’ that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type ‘com.example.emos.wx.db.dao.TbUserDao’ in your configuration.
Process finished with exit code 1
网上很多说是要注入@Mapper,