Arthur
Arthur

Reputation: 1176

Micronaut 1.3.5: Page not found

GET http://localhost:8080/system/version

GET http://localhost:8080/system/version/

import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Get;

@Controller("/system")
public class SystemController {
    @Get(uri = "/version/")
    public String version() {
        return SystemController.class.getPackage().getImplementationVersion();
    }
}

leads to

{
"message": "Page Not Found",
"_links": {
    "self": {
        "href": "/system/version/",
        "templated": false
    }
}
}

How to fix this?

Upvotes: 0

Views: 910

Answers (1)

Jeff Scott Brown
Jeff Scott Brown

Reputation: 27245

If a controller method like that returns null, that will result in a 404. I expect that SystemController.class.getPackage().getImplementationVersion() is evaluating to null.

Upvotes: 3

Related Questions