java – Spring Boot Kotlin API returns 404 response for all endpoints

java – Spring Boot Kotlin API returns 404 response for all endpoints

I guess your CricketerController is not in a subpackage relative to your main class. So you basically have two options:

  1. Place your main class directly under the package com.example
  2. Add the annotation at the bottom of this answer to your main class.

Using any of these two methods makes the controller class visible for Spring at startup and therefore should create your mappings.

@ComponentScan(basePackages = { com.example.controller} )

java – Spring Boot Kotlin API returns 404 response for all endpoints

Leave a Reply

Your email address will not be published. Required fields are marked *