elefeint / examples

if you are here, I probably gave you a link to something
Apache License 2.0
2 stars 7 forks source link

debug sample #6

Closed ludoch closed 2 years ago

ludoch commented 2 years ago

The NPE is at https://github.com/GoogleCloudPlatform/appengine-java-standard/blob/ed04358f94bcb08c2d2b9da9f80025024f6fdc6e/api_dev/src/main/java/com/google/appengine/tools/development/SharedMain.java#L197

it seems to say that timezone is for some reason null... Maybe by setting in command line the user property https://github.com/GoogleCloudPlatform/appengine-java-standard/blob/ed04358f94bcb08c2d2b9da9f80025024f6fdc6e/api_dev/src/main/java/com/google/appengine/tools/development/SharedMain.java#L158

would help?

ludoch commented 2 years ago

For some reasons, String originalTimeZone = System.getProperty("user.timezone");

is empty ("") on Jdk11, but null in jdk17... Will do a CL.

elefeint commented 2 years ago

Setting user property does work! -- --jvm_flag="-Duser.timezone='GMT-5'".

Full command line:

 $GCP_CLI/bin/java_dev_appserver.sh --jvm_flag="--add-opens" --jvm_flag="java.base/java.net=ALL-UNNAMED" --jvm_flag="--add-opens" --jvm_flag="java.base/sun.net.www.protocol.http=ALL-UNNAMED" --jvm_flag="--add-opens" --jvm_flag="java.base/sun.net.www.protocol.https=ALL-UNNAMED" --jvm_flag="-Duser.timezone='GMT-5'" ./target/springboot-helloworld-j17-0.0.1-SNAPSHOT
elefeint commented 2 years ago

This unblocks me, thank you!