解决Consider defining a bean of type ‘com.abc.gmallpublisher1.service.ProductStatsService‘ in your con

雷亚荣

关注

阅读 47

2022-02-19

BUG:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-02-19 13:24:32.423 ERROR 68476 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Field productStatsService in com.abc.gmallpublisher1.controller.SugarController required a bean of type 'com.abc.gmallpublisher1.service.ProductStatsService' that could not be found.

The injection point has the following annotations:
    - @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'com.abc.gmallpublisher1.service.ProductStatsService' in your configuration.

原因:在ProductStatsService里的实现类,没有写@Service注释

解决方法:加@Service注释 

精彩评论(0)

0 0 举报