码迷,mamicode.com
首页 > 编程语言 > 详细

SpringBoot中出现的错误

时间:2017-10-09 13:11:20      阅读:270      评论:0      收藏:0      [点我收藏+]

标签:spec   intern   hint   required   时间   expected   font   handle   sep   

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中出现的错误

标签:spec   intern   hint   required   时间   expected   font   handle   sep   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!