Open
Description
I have created a simple gradle micronaut project and I've added a trivial controller:
@Controller("/health")
public class HealthCheck {
@Get()
public HttpResponse<String> index() {
return HttpResponse.ok("success");
}
}
From VS Code I start debugging the project (F5 shortcut, using default launch.json file). VS Code started the debug mode but if I try to hit this controller from curl I get
{"message":"Page Not Found","_links":{"self":{"href":"/health","templated":false}}}
This does not happen if i start the project with gradle run. The curl command returns success
Environment
- Operating System: Ubuntu 20.04
- JDK version: openjdk version "15.0.2" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 15.0.2+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 15.0.2+7, mixed mode, sharing) - Visual Studio Code version: 1.52.1
- Java extension version: Java Extension Pack v0.12.1
- Java Debugger extension version: v0.30.0
Steps To Reproduce
- Create a micronaut project:
mn create-app test
- From VSCode, add a simple class, name it for instance
HealthCheck.java
with the following content:
package test;
import io.micronaut.http.HttpResponse;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Get;
@Controller("/health")
public class HealthCheck {
@Get()
public HttpResponse<String> index() {
return HttpResponse.ok("success");
}
}
- run
gradle run
and usecurl http://localhost:8080/health
to validate it returnssuccess
- stop the
gradle run
process and start debug from VSCode, in my case I only pressed pressedF5
- run again
curl http://localhost:8080/health
The latest curl command returns:
Current Result
{"message":"Page Not Found","_links":{"self":{"href":"/health","templated":false}}}
Expected Result
success
Additional Information
I suspect there is an issue with handling the annotation processor. If I run the same thing from IntelliJ Idea, it works just fine.