问答详情
源自:5-1 SpringBoot 资源文件属性配置

Description: Field resource in com.imooc.controller.HelloContoller required a bean of type 'com.imocc.pojo.Resource' that could not be found. Action: Consider defining a bean of type 'com.imocc.pojo.Resource' in your configuration.

Description:


Field resource in com.imooc.controller.HelloContoller required a bean of type 'com.imocc.pojo.Resource' that could not be found.



Action:


Consider defining a bean of type 'com.imocc.pojo.Resource' in your configuration.


提问者:weixin_慕工程5061361 2019-06-25 15:57

个回答

  • _好久不见_2
    2019-08-06 23:26:57

    在你的主程序前面加上:
    @ComponentScan(basePackages= {"com.*"})
    意思是扫描com.*包下所有类 若解决,请采纳谢谢。

  • CWForward4109215
    2019-07-30 17:44:28

    启动类放到最外边 https://img4.mukewang.com/5d4011740001129403040175.jpg

  • weixin_慕工程5061361
    2019-06-25 15:58:17

    完全是视频里的代码结果跑不起来,服了