Issues with App Engine migration from the legacy SDK (appcfg) to Cloud SDK

293 views
Skip to first unread message

Ramtin Alizadegan

unread,
Aug 28, 2020, 12:53:03 PM8/28/20
to Google App Engine
We are trying to migrate our Java Android app-engine project to the Cloud SDK based app-engine as Google requested and quite honestly, we find it very inconvenient and silly compared to deploying it from Android Studio...  Why is the Cloud SDK app-engine integration with Android Studio not provided by default as before?  Any way, when we try to deploy this app-engine project by running the command:

>gcloud app deploy .\appengine-web.xml --version 3 --no-promote

The application fails to start with this error in the cloud logs:

Uncaught exception from servlet MultiException[javax.servlet.UnavailableException: Class loading error for holder EndpointsServlet@e968f07==com.google.api.server.spi.EndpointsServlet,jsp=null,order=-1,inst=false, javax.servlet.UnavailableException: Class loading error for holder org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:863) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:349) at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1406) at com.google.apphosting.runtime.jetty9.AppEngineWebAppContext.startWebapp(AppEngineWebAppContext.java:175) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1368) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778) at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:522) at com.google.apphosting.runtime.jetty9.AppEngineWebAppContext.doStart(AppEngineWebAppContext.java:120) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:240) at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:178) at com.google.apphosting.runtime.jetty9.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:120) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchServletRequest(JavaRuntime.java:761) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchRequest(JavaRuntime.java:724) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:694) at com.google.apphosting.runtime.JavaRuntime$NullSandboxRequestRunnable.run(JavaRuntime.java:880) at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:270) at java.lang.Thread.run(Thread.java:748) Suppressed: javax.servlet.UnavailableException: Class loading error for holder org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:102) at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:363) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:891) ... 18 more Suppressed: javax.servlet.UnavailableException: Class loading error for holder org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:102) at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:363) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:891) ... 18 more Suppressed: javax.servlet.UnavailableException: Class loading error for holder org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:102) at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:363) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:891) ... 18 more Suppressed: javax.servlet.UnavailableException: Class loading error for holder org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:102) at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:363) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:891) ... 18 more Suppressed: javax.servlet.UnavailableException: Class loading error for holder EndpointsServlet@e968f07==com.google.api.server.spi.EndpointsServlet,jsp=null,order=-1,inst=false at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:102) at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:363) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:909) ... 18 more Suppressed: javax.servlet.UnavailableException: Class loading error for holder org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:102) at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:363) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:909) ... 18 more Suppressed: javax.servlet.UnavailableException: Class loading error for holder org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:102) at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:363) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:909) ... 18 more Suppressed: javax.servlet.UnavailableException: Class loading error for holder org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:102) at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:363) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:909) ... 18 more Suppressed: javax.servlet.UnavailableException: Class loading error for holder org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:102) at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:363) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:909) ... 18 more Caused by: javax.servlet.UnavailableException: Class loading error for holder EndpointsServlet@e968f07==com.google.api.server.spi.EndpointsServlet,jsp=null,order=-1,inst=false at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:102) at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:363) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:891) ... 18 more  

BTW, we noticed that the size of the service which was deployed via the gcloud command (5.4 MB) is much smaller than the version deployed via Android Studio (38 MB).  This Java app-engine project is using gradle and datanucleus.

We have already contacted Google App Engine support couple times, but no responses yet.  Guess they're super busy with all the issues that this botched migration has brought with itself...  What should we do now?


Manpreet Sidhu (Google Cloud Support)

unread,
Aug 28, 2020, 10:58:10 PM8/28/20
to Google App Engine

As listed on the “Migrating to the Cloud SDK-based Gradle plugin” document, Android Studio is not supported. In order to run and deploy your applications, you need to directly invoke Gradle.

Can you please shed light as to how you contacted the App Engine Support in the past (Google Groups, Support Plan, other community channels, ect...)? Can you also please share any documentation that you are following? The documents will allow us and the community to see how you are doing the migration and why it isn’t successfully deploying.

Ramtin Alizadegan

unread,
Aug 29, 2020, 12:32:46 PM8/29/20
to Google App Engine
Hi Manpreet,

Thank you for your response.  We already know that GCP does not support Android Studio.  But why?  If GCP wants to compete with AWS, Azure, Oracle, etc. it needs to move in the direction of providing more cenvenience, not move away from convenience...

Any way, we contacted Google Cloud Platform Support at <cloud-proactive-comms+...@google.com> but we didn't receive any responses.

Our Java Android app-engine project uses gradle and datanucleus.  (It doesn't use Maven build tool as there's no pom.xml file in our entire project.)  We have already created the cron.yaml and index.yaml files and they work correctly from within Android Studio.

yananc

unread,
Aug 31, 2020, 2:33:54 PM8/31/20
to Google App Engine

Hello, 

Thank you for your response. I would suggest you to follow the link to file a Feature Request on the support for Android Studio so our Engineering team can further investigate. However, there is no ETA or if the feature will be implemented.

For the deployment issue, based on the provided information, it would be helpful to review the ‘appengine-web.xml’ to make sure all the configuration is correct, especially the configuration about how Jetty is started.

Ludovic Champenois

unread,
Aug 31, 2020, 10:52:02 PM8/31/20
to google-a...@googlegroups.com

It seems it complain about a missing com.google.api.server.spi.EndpointsServlet servlet defined in the web.xml... Maybe you did not add the dependency?

Can you see if https://cloud.google.com/endpoints/docs/frameworks/java/migrating is helping you, especially the Gradle section?

Cheers,

Ludo

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/9e49b1e1-d35a-4f21-9cb1-30ef97213f27n%40googlegroups.com.

Ramtin Alizadegan

unread,
Sep 1, 2020, 9:41:18 PM9/1/20
to Google App Engine
yananc, this feature used to exist in Android Studio with the integration with App Engine SDK.  However, it's been REMOVED by the new migration to Cloud SDK!  I'd imagine a proper migration would have guaranteed a seamless transition first.  This app-engine project used to be deployed just fine from Android Studio.

Our ‘appengine-web.xml’ doesn't really have much in it.  How do we add the Jetty configurations to it?  This is what our 'web.xml' looks like:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.5"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<servlet>
<!-- V2: Start of v2 section -->
<servlet-name>EndpointsServlet</servlet-name>
<servlet-class>com.google.api.server.spi.EndpointsServlet</servlet-class>
<!-- V2: End of v2 section -->
<init-param>
<param-name>services</param-name>
<param-value>......list of services....
</param-value>
</init-param>
<init-param>
<param-name>restricted</param-name>
<param-value>false</param-value>
</init-param>
</servlet>
<servlet-mapping>
<!-- V2: Start of v2 section -->
<servlet-name>EndpointsServlet</servlet-name>
<url-pattern>/_ah/api/*</url-pattern>
<!-- V2: End of v2 section -->
</servlet-mapping>
....
</web-app>

It looks like our gradle is not correctly processed.  Any help would be appreciated especially since Google Support seems unresponsive after this botched migration.

Ramtin Alizadegan

unread,
Sep 6, 2020, 5:30:41 PM9/6/20
to Google App Engine
Anyone cares to respond?  We're seriously considering switching to a competitor of Google App Engine due to this poorly executed forced migration and poor customer support.  That's thousands of dollars of lost revenue per year for Google App Engine.  This is your last chace to get your act together, apart from the very bad press for GCP!

Ludovic Champenois

unread,
Sep 8, 2020, 3:56:12 PM9/8/20
to Google App Engine

Hi, did you follow my advice from August 31rst?
If you could share your web.xml, appengine-web.xml and your gradle build files, I cam take a look, as it seems a missing dependency to have the correct jar to compile and deploy  with the missing class "com.google.api.server.spi.EndpointsServlet" declared in your web.xml I guess...

Happy to help with more info,
Ludo

Rishi Sharma

unread,
Sep 8, 2020, 4:39:42 PM9/8/20
to google-a...@googlegroups.com
Hi Ramtin,

Were you able to see Ludovic's comment?  I think it may be helpful to you.

-R

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages