700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 【Field xx in xxx.xx.xx required a bean of type ‘xx.xx.xx‘ that could not be found】排查和解决办法

【Field xx in xxx.xx.xx required a bean of type ‘xx.xx.xx‘ that could not be found】排查和解决办法

时间:2021-01-22 11:46:52

相关推荐

【Field xx in xxx.xx.xx required a bean of type ‘xx.xx.xx‘ that could not be found】排查和解决办法

解决springboot启动报以下错误的解决办法

问题现象解决办法总结

Field testMapper in com.micro.test.TestServiceImpl required a bean of type ‘com.micro.test.dao.TestMapper’ that could not be found

问题现象

修改mapper和xml文件后,启动springboot项目,控制台打如下图报错信息:

解决办法

遇到这种报错的时,可以在启动类上加个try-catch,在catch中打印堆栈信息就可以找到具体错误在哪了,如下图

再次启动,控制台就会打印出详细的报错原因,通过这个报错信息就可以很快排查到问题了。

总结

类似的这种报错信息,一般都是因为mapper.xml文件中存在错误,但是mapper中的错误又不容易排查,大家的报错原因可能各不相同,通过这种方式可以快速定位问题,解决报错。

希望可以帮助到你!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。