App Engine Hello World

This is a barebones example webapp using Google Cloud.

View the code for this project here.


This is a companion discussion topic for the original entry at https://happycoding.io/examples/google-cloud/app-engine-hello-world

Thank your for this example, I could make it working very fast. However, I have troubles adding Objectify 6 and a sample entity to it. For some reason the server won’t start correctly (when deployed to GAE). Sometimes there are errors, sometimes there’s no error but the server doesn’t work right anyway (it always returns HTTP 503). I wonder what’s wrong. I’m not completely new to GAE, I have a few Java8 apps running already.

Nevermind, it was my fault. If I may suggest the following improvements to main():

// set up logging for easier debugging

System.setProperty(org.eclipse.jetty.util.log.class, org.eclipse.jetty.util.log.StrErrLog);
System.setProperty(org.eclipse.jetty.LEVEL, ALL);|

// make sure to use the right port

int port = Integer.parseInt(System.getenv().getOrDefault("PORT", "8080"));
Server server = new Server(port);
1 Like

So was the issue that your server was running on a different port than 8080?

Sorry for late reply.

I just forgot to call Objectify.init(). As for the port, I noticed the PORT evn var is often 8081.