Johny
Johny

Reputation: 27

Consider defining a bean of type exampleService in your configuration

I can't run spring boot application while I am getting the next error "Consider defining a bean of type 'exampleService(exampleService is interface)' in your configuration". exampleService - is coming from openApiGeneration. Should I solve the problem direct from build.gradle? The code is written in kotlin

Upvotes: 0

Views: 220

Answers (2)

Zulfiqar Chaudhry
Zulfiqar Chaudhry

Reputation: 117

This problem means that there is no Bean (@Service or @Component) that implements the interface you have mentioned. Hence, Spring cannot find a bean to autowire. Consider adding an implementation of the interface with the @service antonation.

Upvotes: 0

overstacked
overstacked

Reputation: 24

In the build.gradle file, add the following lines:

compile "org.springframework.boot:spring-boot-starter-data-jpa"
compile "org.springframework.boot:spring-boot-starter-data-rest"
compile "org.springframework.boot:spring-boot-starter-hateoas"

Upvotes: 1

Related Questions