设计改变世界-CSDN
设计改变世界
【Axure RP】【powerdesigner】 【.net】 【c#】 【sql】 【javascript】 【php】 【asp】 【flex】 【java】 【android】http://blog.csdn.net/guochunyang

Description:

Field testService in com.xxx.xxx.api.controller.TestController required a bean of type 'com.xxx.xxx.service.TestService' that could not be found.


Action:

Consider defining a bean of type 'com.xxx.xxx.service.TestService' in your configuration.

 

1.maven多模块启动类:

@SpringBootApplication
@SpringBootApplication(scanBasePackages = {"com.xxx.xxx.service","com.xxx.xxx.api.controller"})
@SpringBootApplication(scanBasePackages = {"com.xxx.xxx.**"})

2.TestService类加注解@Service

 

另外,暴力方法:

@Autowired
TestService testService;
改为
TestService testService = new TestService();
但是,这样就不归spring管理了
posted on 2018-04-03 18:08  果然如此  阅读(3755)  评论(0编辑  收藏  举报

【一号店】