首页 > 编程语言 > 详细

SpringBoot中出现的错误

时间:2017-10-09 12:29:19      阅读:311      评论:0      收藏:0      [点我收藏+]

1.Field boy in com.huhu.SpringDemo.HelloController required a bean of type ‘com.huhu.SpringBean.Boy‘ that could not be found.

解决办法:

1.将这个类放到与Spring boot的启动类需要放在需要扫描类的上层目录,这样才能扫描到同级或者子类需要注册的类。 

2.在你使用的Controller上面加上@ComponentScan(basePackages="com.xx"),basePackages注意范围,太大不行,太耗时间了,太小扫描不到

 

2.There was an unexpected error (type=Internal Server Error, status=500).Circular view path [hello]: would dispatch back to the current handler URL [/boot/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)

解决办法:给Controller加上@Controller和@ResponseBody

 

最近在学习,会持续更新。

SpringBoot中出现的错误

原文:http://www.cnblogs.com/huhu1203/p/7640495.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!