SpringBoot常见报错及解决方法

问题一

Field redisUtil in com.sui.demo.controller.redisController required a bean of type 'com.sui.demo.util.RedisUtil' that could not be found

原因:

未扫描到RediUtil包,无法用spring ioc容器自动创建对象

解决方法一:

去掉@Autowired注解,手动创建对象 private JedisPool jedisPool= new JedisPool();

解决方法二:

启动类手动添加扫描该包

 

posted @ 2019-05-21 12:32  Lynne~  阅读(680)  评论(0编辑  收藏  举报