Home > Mobile >  Google Cloud Appengine returns '404 Error' when calling Spring Boot REST APIs
Google Cloud Appengine returns '404 Error' when calling Spring Boot REST APIs

Time:08-03

I have deployed a spring boot application to Google cloud appengine service. When I run the application locally using mvn appengine:run everything works fine and I'm able to send requests to REST APIs and get expected responses back. In fact when I deploy the application to appengine I can see the application logs which indicate that server is up and there aren't any exceptions or warnings during server initialization; But when I try to call any kind of endpoints, google send a HTML page containing below text:
Error: Not Found

I'm using:
JDK 1.8
Spring Boot 2.4.5
Maven
Cloud SDK version 395.0.0

CodePudding user response:

Did you check the port. By default, 8080 is the default port. If you want to change the port. Follow below link

https://cloud.google.com/appengine/docs/flexible/java/reference/app-yaml#network_settings

CodePudding user response:

As suspected, this is a problem with the Cloud SDK v395.0.0. You can deploy your application using an older version by setting the cloudSdkVersion configuration parameter of the appengine maven plugin in your pom.xml file. More information can be found in the AppEngine Maven Plugin reference document.

I tested this by deploying the Spring Boot helloWorld world sample app with various versions of the SDK and it broke once deployed with v395

This issue has been reported on Google's Issue Tracker

  • Related