I have a Spring Boot application (2.0.0 M5) that provides some REST API. I would like to implement this API using RouterFunction s.
While I run the application using the built-in Jetty, everything is working fine.
When I convert an application to a WAR file (following the documentation here ) and deploy it to Tomcat 8.5, I always get 404 when trying to call any of the endpoints.
I see in the log that endpoints are recognized:
[ost-startStop-1] swrrmaRequestMappingHandlerMapping : Mapped "{[/say-hello],methods=[GET]}" onto java.lang.String com.example.demo.DemoController.test() [ost-startStop-1] oswrfssRouterFunctionMapping: Mapped /api => { /v1 => { /status -> com.example.demo.DemoApplication$$Lambda$189/ 1904651750@5fdc83e } }
But when I call curl -v http://localhost:8080/demo/say-hello or curl -v http://localhost:8080/demo/api/v1/status I see the default Tomcat 404 page. The path is correct, I renamed .war to demo.war before deploying it.
Has anyone encountered a similar problem? You can find the code here .
source share