0

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

  1. As I have tried both IDE and command line. So, ruling out any issue from Idea
  2. Tried to add a Java Controller in the project, but that also didn't run
  3. 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()
    }
}

Please help in fixing these 2 issues.

Traycho Ivanov
  • 2,887
  • 14
  • 24
rock_win
  • 755
  • 1
  • 5
  • 14
  • 2
    It is hard to say what is wrong without seeing your project but quite likely the annotation processors are not configured properly. I recommend creating a new project at https://micronaut.io/launch/ and comparing that `build.gradle` to yours. – Jeff Scott Brown Aug 15 '20 at 12:47
  • updated the question with new findings – rock_win Aug 15 '20 at 18:27
  • Try make it working without spring annotations first, if it pass then try add dependencies in `build.gradle` – Traycho Ivanov Aug 15 '20 at 19:51

0 Answers0