title: GAE Application Stopped Working Suddenly - Failed startup of context com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext
body: <p>A couple of days ago my app-engine android app stopped working after a normal deploy. There was no change to my local code (did a diff with previous version), and the only thing that changed was a Java update.</p>
  
  <p>The deploy operation completes successfully, but when the app launches, I get the following errors in the App Engine logs on the Developer Console:</p>
  
  <pre><code>EXCEPTION 
  java.lang.ClassNotFoundException: Serve
  at com.google.appengine.runtime.Request.process-bdec5268b83f2316(Request.java)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:360)
  at org.mortbay.util.Loader.loadClass(Loader.java:91)
  at org.mortbay.util.Loader.loadClass(Loader.java:71)
  at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
  at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
  at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
  at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
  at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
  at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
  at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
  at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:438)
  at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:445)
  at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
  at     com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:309)
  at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:301)
  at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:442)
  </code></pre>
  
  <p>And this</p>
  
  <pre><code>javax.servlet.ServletContext log: unavailable
  javax.servlet.UnavailableException: Serve
  at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:79)
  at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
  at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
  at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
  at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
  at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
  at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
  at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:199)
  at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:174)
  at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134)
  at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:446)
  at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:438)
  at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:445)
  at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
  at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:309)
  at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:301)
  at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:442)
  at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
  at java.lang.Thread.run(Thread.java:724)
  </code></pre>
  
  <p>The root cause seems to be this:</p>
  
  <pre><code>    Failed startup of context com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext@e0d280{/,/base/data/home/apps/s~diesel-media-647/1.378309428699474015}
  org.mortbay.util.MultiException[java.lang.NullPointerException, java.lang.NullPointerException]
      at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:656)
      at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
      at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
      at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
      at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
      at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:199)
      at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:174)
      at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134)
      at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:446)
      at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:438)
      at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:445)
      at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
      at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:309)
      at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:301)
      at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:442)
      at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
      at java.lang.Thread.run(Thread.java:724)
  java.lang.NullPointerException
      at java.lang.Class.isAssignableFrom(Native Method)
      at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
      at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
      at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
      at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
      at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
      at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
      at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:199)
      at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:174)
      at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134)
      at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:446)
      at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:438)
      at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:445)
      at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
      at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:309)
      at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:301)
      at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:442)
      at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
      at java.lang.Thread.run(Thread.java:724)
  java.lang.NullPointerException
      at java.lang.Class.isAssignableFrom(Native Method)
      at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
      at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
      at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
      at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
      at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
      at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
      at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:199)
      at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:174)
      at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134)
      at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:446)
      at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:438)
      at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:445)
      at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
      at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:309)
      at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:301)
      at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:442)
      at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
      at java.lang.Thread.run(Thread.java:724)
  </code></pre>
  
  <p>Here are the solutions that I tried based on similar posts:</p>
  
  <ol>
  <li><p>I have updated my GAE SDK to the latest (1.9.9) as per this post
  <a href="https://stackoverflow.com/questions/5819673/weird-500-error-on-gae">Weird 500 Error on GAE</a></p></li>
  <li><p>I have used appcfg to do a roll-back and clean of my deployment. The clean operating was completed successfully, but when I redeployed the same errors occured.</p></li>
  <li><p>I have reverted back to Java 1.6 (currently at 1.7) - didn't work.</p></li>
  <li><p>I have double checked my web.xml file to make sure that the servlet paths are correct. I tried fully qualifying the class names with my package - didn't work</p></li>
  <li><p>I have tried adding the load-on-startup tag in my web.xml file as per this post
  <a href="https://stackoverflow.com/questions/14057576/exception-java-lang-classnotfoundexception-servlet-but-the-servlet-is-present">EXCEPTION java.lang.ClassNotFoundException: servlet - But the Servlet is present; And web.xml is absolutely correct</a></p></li>
  </ol>
  
  <p>I've been battling with this for a couple of days now, and I'm at my wit's end. Any help is appreciated.
  For reference, I'm using GAE SDK 1.9.9, upgraded from 1.9.3 when I encountered this problem.
  I'm using Java 1.7 (tried 1.6).</p>