问题描述
- 今天写service层抛出如下错误:
Description:
Field shiroService in com.bbzd.mes.shiro.auth.AuthRealm required a bean of type 'com.bbzd.mes.shiro.service.ShiroService' 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.bbzd.mes.shiro.service.ShiroService' in your configuration.
原因
- service类忘记@Service注解
解决办法
- 在service类上加@Service注解
@Service
public class ShiroServiceImpl implements ShiroService {
}