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

前端 未结 13 1545
伪装坚强ぢ
伪装坚强ぢ 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:50

    You are trying to inject a bean in itself. That's obviously not going to work.

    TopicServiceImplementation implements TopicService. That class attempts to autowire (by field!) a `TopicService. So you're essentially asking the context to inject itself.

    It looks like you've edited the content of the error message: Field topicService in seconds47.restAPI.topics is not a class. Please be careful if you need to hide sensitive information as it makes it much harder for others to help you.

    Back on the actual issue, it looks like injecting TopicService in itself is a glitch on your side.

提交回复
热议问题