This is a companion discussion topic for the original entry at https://happycoding.io/tutorials/google-cloud/migrating-to-java-11
This is really helpful. I have a legacy Java 8 app. I looked at migrating it couple years ago, but put it off as my datastore was not yet migrated to Firestore in Datastore mode. It has been migrated automatically by Google now. The other challenge was that I couldn’t get the logging to work properly.
Can you comment on how you implemented logging for your app?
To be honest, for my own personal projects I don’t do much logging.
I know that print statements and other logging info goes to the logging tab in the Cloud console, so my usual approach is a good old fashioned
System.out.println() and then to look there.
@Kevin I resolved the logging issue, but I’m facing several other challenges with this migration.
I use Google Cloud Endpoints Framework with my Java 8 runtime app, but it’s not supported for Java 11 runtime. I have not found any information about a replacement.
I have a
GuiceServletContextListenerto initialize my app. The approach is explained here: Configuring Warmup Requests to Improve Performance (unfortunately, I’m not allowed to share links on this forum). The listener is included in my web.xml. I have GuiceFilter also in the web.xml. So, is the web.xml still used? I don’t see my listener getting invoked. All my endpoints and servlet mappings are done using
com.google.inject.servlet.ServletModulewhich are injected using
It seems like I have to abandon this upgrade, and completely ditch GAE.
Do you have any suggestions for me?
Honestly I don’t blame you. I was really frustrated when I migrated all my stuff.
None of my examples use
web.xml to configure the Jetty web server, but my understanding is that this should still be possible. You might also be able to set up your listeners in your main method that runs the server.