0

I am doing a sample application and trying to use webflux with reactive mongo. I am getting below error while starting the application in Intellij

required a bean of type 'com.sample.ReservationRepositroy' that could not be found.

I am having below entries in the gradle

implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb-reactive'
id 'org.springframework.boot' version '2.5.1'

Repository Code as below

interface ReservationRepositroy extends ReactiveMongoRepository<Reservation,String>{}

@Autowired
    private final ReservationRepositroy reservationRepositroy;

@Document
@Data
@AllArgsConstructor
@NoArgsConstructor
class Reservation {
    @Id
    private String id;
    private String name;
}

I tried adding @Repository in the repository class as well as @EnableReactiveMongoRepositories in SpringBoot application but same error. Also tried extending ReactiveCrudRepository. Anything I am missing?

vinilpj
  • 128
  • 2
  • 10

0 Answers0