I'm creating a simple application with 2 Rest Controllers with Kotlin. However, for every endpoint
the error is
{"message":"Not Found","_links":{"self":{"href":"
My inferences till now, for which I have searched for solutions and they didn't worked.
1.The generated folders are also empty. Might be an issue
- As I have tried both IDE and command line. So, ruling out any issue from Idea
- Tried to add a Java Controller in the project, but that also didn't run
- Tried to use Micronaut annotations along with Spring Web annotations, didn't worked.
Is there anything else that I can change to make it work? Ideally I would want to make it work with Kotlin and not Java.
Environment:
IDE - IntelliJ Idea 2020.2 Ultimate
Build - tried both Maven and Gradle, command line and IDE
EnableAnnotations: Done
Delegate Gradle Runner: Done
JDK: 11 ( but set as 8 in build file)
Update1 - Got few things working
Got the base code from Micronaut Launcher site
My Sample code
@RestController
@Validated
@RequestMapping("/hello")
open class UserController {
@Get("/echo")
fun echo():String{
return "hello"+ System.currentTimeMillis()
}
}
- AOP is not working and thus had to use
@Validated
andopen
. The build.gradle has allOpen plugin. @GetMapping
should work as per https://micronaut-projects.github.io/micronaut-spring/latest/guide/#springMvc- I had to use Micronaut's
@Get
to make it working
Please help in fixing these 2 issues.