Consider defining a bean of type 'service' in your configuration [Spring boot]

前端 未结 13 1548
伪装坚强ぢ
伪装坚强ぢ 2020-12-10 01:35

I get error when I run the main class.

Error:

Action:
Consider defining a bean of type \'seconds47.service.TopicService\' in your c         


        
13条回答
  •  甜味超标
    2020-12-10 01:48

    Since TopicService is a Service class, you should annotate it with @Service, so that Spring autowires this bean for you. Like so:

    @Service
    public class TopicServiceImplementation implements TopicService {
        ...
    }
    

    This will solve your problem.

提交回复
热议问题