1

I'm working on a Java App Engine application using Java 7 in Eclipse Photon. I have an existed App engine Java web application received from one of our developers when I create a new App engine standard project and import this project and try to run it return this error:

Server App Engine Standard at localhost failed to start.

And Here's the stack trace:

Warning: Google App Engine Java 7 runtime is deprecated.
Warning: See https://cloud.google.com/appengine/docs/deprecations/java7
java.lang.RuntimeException: Unable to create a DevAppServer
    at com.google.appengine.tools.development.DevAppServerFactory.doCreateDevAppServer(DevAppServerFactory.java:401)
    at com.google.appengine.tools.development.DevAppServerFactory.access$000(DevAppServerFactory.java:31)
    at com.google.appengine.tools.development.DevAppServerFactory$1.run(DevAppServerFactory.java:318)
    at com.google.appengine.tools.development.DevAppServerFactory$1.run(DevAppServerFactory.java:315)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:314)
    at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:374)
    at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:45)
    at com.google.appengine.tools.development.DevAppServerMain.run(DevAppServerMain.java:247)
    at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:238)
Caused by: java.lang.ClassCastException: ClassLoader is jdk.internal.loader.ClassLoaders$AppClassLoader@4459eb14, not a URLClassLoader.
    at com.google.apphosting.utils.security.SecurityManagerInstaller.generatePolicyFile(SecurityManagerInstaller.java:139)
    at com.google.apphosting.utils.security.SecurityManagerInstaller.install(SecurityManagerInstaller.java:94)
    at com.google.appengine.tools.development.DevAppServerFactory.doCreateDevAppServer(DevAppServerFactory.java:377)
    ... 9 more
Abdul Rehman
  • 5,326
  • 9
  • 77
  • 150
  • https://github.com/GoogleCloudPlatform/google-cloud-eclipse/issues/2464..Try checking in the link i've shared... – Pradeep Aug 10 '18 at 05:40
  • Hi @Pradeep, in my case even Helloworld app is getting the same error. – Abdul Rehman Aug 10 '18 at 05:50
  • https://www.mkyong.com/google-app-engine/google-app-engine-hello-world-example-using-eclipse/ – Pradeep Aug 10 '18 at 07:43
  • @AbdulRehman Please confirm whether or not you were following [this](https://cloud.google.com/eclipse/docs/quickstart) quickstart. Check [this Stack Overflow post](https://stackoverflow.com/questions/50264254/appengine-maven-plugin1-3-1-run-failed-non-zero-exit) and if the issue still persist please provide your `pom.xml` but delete all sensitive info like you Google Cloud Project ID. – komarkovich Aug 10 '18 at 12:04

1 Answers1

1

So your stack trace indicates that you are launching with a Java 9 VM (or later), which isn't supported the App Engine development tools.

at java.base/java.security.AccessController.doPrivileged(Native Method)

Assuming you're using the Cloud Tools for Eclipse, first ensure your Google Cloud SDK is up-to-date. If you're using your own copy, run gcloud components update on the command-line. If you're letting Cloud Tools for Eclipse manage your SDK, then open Preferences > Google Cloud Tools and choose Update.

You'll then need to configure Eclipse to use a Java 8 JRE or JDK as the default JVM for Java 8 launches:

  1. Install a Java 8 VM if you don't have one already.
  2. Open Preferences > Java > Installed JREs. Choose Add or Search if your Java 8 VM is not found.
  3. Open Preferences > Java > Installed JREs > Execution Environments and select JavaSE-1.8, and ensure that your Java 8 VM is checked as the default VM.

(You can repeat the above if you're using a Java 1.7 VM, though note that App Engine support for Java 7 will be turned off in January 2019.)

You should then be able to launch.

Brian de Alwis
  • 2,814
  • 2
  • 18
  • 32