目录

Handler-dispatch-failed-nested-exception-is-java.lang.StackOverflowError

目录

Handler dispatch failed; nested exception is java.lang.StackOverflowError

欢迎大家关注我的公众号,添加我为好友!

https://i-blog.csdnimg.cn/blog_migrate/4d15fd69fdacbdca8d90a9a4ea3e9f11.png https://i-blog.csdnimg.cn/blog_migrate/8ceea0b4a128e9b219d1235f1dc186e8.png

springBoot项目遇到了“ Handler dispatch failed; nested exception is java.lang.StackOverflowError ”的错误。

总结一哈:

StackOverflowError通常情况下是死循环或者是循环依赖了。

Caused by: java.lang.StackOverflowError
	at com.hry.seckill.service.impl.GoodsServiceImpl.getGoodsVoList(GoodsServiceImpl.java:17)
	at com.hry.seckill.service.impl.GoodsServiceImpl.getGoodsVoList(GoodsServiceImpl.java:17)
	at com.hry.seckill.service.impl.GoodsServiceImpl.getGoodsVoList(GoodsServiceImpl.java:17)
	at com.hry.seckill.service.impl.GoodsServiceImpl.getGoodsVoList(GoodsServiceImpl.java:17)
	at com.hry.seckill.service.impl.GoodsServiceImpl.getGoodsVoList(GoodsServiceImpl.java:17)
	at com.hry.seckill.service.impl.GoodsServiceImpl.getGoodsVoList(GoodsServiceImpl.java:17)

然后检查定位到的位置,发现错误:

@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    private GoodsService goodsService;

我在Service中没有正确引用编写的Mapper而是引用了Service,所以报错,改正即可。

@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    private GoodsMapper goodsMapper;

最后重启项目即可。

欢迎大家关注我的公众号,添加我为好友!

https://i-blog.csdnimg.cn/blog_migrate/4d15fd69fdacbdca8d90a9a4ea3e9f11.png https://i-blog.csdnimg.cn/blog_migrate/8ceea0b4a128e9b219d1235f1dc186e8.png