6

I recently tried to create a new gwt/gae project using the Google eclipse plugin. I've done this in the past successfully and I have several projects under development that are not having problems.

I'm getting a NullPointerException when I try to launch the Web Application. Here is the stack trace.

WARNING: EXCEPTION 
java.lang.ClassNotFoundException: com.google.api.server.spi.SystemServiceServlet
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:176)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    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 org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    at org.mortbay.jetty.Server.doStart(Server.java:224)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:196)
    at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:239)
    at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:146)
    at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:97)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
    at com.google.gwt.dev.DevMode.main(DevMode.java:311)
Sep 6, 2012 2:42:25 PM com.google.appengine.tools.development.ApiProxyLocalImpl log
SEVERE: javax.servlet.ServletContext log: unavailable
javax.servlet.UnavailableException: com.google.api.server.spi.SystemServiceServlet
    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 org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    at org.mortbay.jetty.Server.doStart(Server.java:224)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:196)
    at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:239)
    at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:146)
    at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:97)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
    at com.google.gwt.dev.DevMode.main(DevMode.java:311)

Sep 6, 2012 2:42:25 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed SystemServiceServlet: java.lang.NullPointerException
Sep 6, 2012 2:42:26 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: Failed startup of context com.google.appengine.tools.development.DevAppEngineWebAppContext@75e04ee8{/,/Users/bucky/Documents/workspace/Birthday/war}
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 org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    at org.mortbay.jetty.Server.doStart(Server.java:224)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:196)
    at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:239)
    at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:146)
    at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:97)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
    at com.google.gwt.dev.DevMode.main(DevMode.java:311)

I have no idea where to go debug this.

Bucky Pope
  • 135
  • 2
  • 11
  • I'm having the same problem using JDK 1.6 and Eclipse indigo - Somehow I managed to get the app code to work once, by deploying it to Google's App Engine. Eclipse would then compile it without any issues. I tried to replicate this again, in order to provide step by step, with no luck and the error came back. – TeckniX Sep 07 '12 at 18:51
  • http://stackoverflow.com/questions/12060233/http-503-error-gwt-jetty-server-service-unavailable – k4dima Oct 10 '12 at 11:22

4 Answers4

4

I did a fresh install of Eclipse Juno with the Google Plugin (GWT + GAE). I am now noticing that the plugin is constantly trying to modify my web.xml file.

It tries to add this servlet definition:

  <servlet>
    <servlet-name>SystemServiceServlet</servlet-name>
    <servlet-class>com.google.api.server.spi.SystemServiceServlet</servlet-class>
    <init-param>
      <param-name>services</param-name>
      <param-value/>
    </init-param>
  </servlet>

  <servlet-mapping>
    <servlet-name>SystemServiceServlet</servlet-name>
    <url-pattern>/_ah/spi/*</url-pattern>
  </servlet-mapping>

I haven't been able to figure out how to stop it from happening but it's really annoying because I need to be constantly reverting that file to avoid checking in those changes.

Try removing that servlet from your web.xml file. It doesn't seem to serve any purpose. It may have to do with Google Cloud

bpossolo
  • 849
  • 5
  • 6
  • Is the answer you're proposing here to remove the servlet from web.xml? This read a bit more like a question than an answer, putting your summary first might have made it a bit clearer. – Stu Cox Sep 23 '12 at 21:58
  • thanks I just had the same problem migrating to SDK 1.7.3 it does indeed modify the web.xml by adding that SystemServiceServlet which does break the server. Removing it works. – doright Oct 24 '12 at 13:01
  • 1
    It will continue to modify your web.xml every time you save a file in your project. In order to turn this off, open your project settings in Eclipse, then select Builders, then uncheck the box "Google App Engine Project Change Notifier" – bpossolo Oct 27 '12 at 21:44
2

This happened to me when I updated from within Eclipse from 1.6.4 to 1.7.3 and the update went wrong for some reason, leaving bits of both versions in the libraries; I would think this is what's happened to everyone else. Fix is to close all AppEngine projects and do the update again, then switch 1.7.3 to being default version. If there is still a problem, look in properties -> build path -> libraries as there may still be a 1.6.4 local support library which you just need to remove, then it all works with this servlet in place.

It would be nice to know what this servlet does, I couldn't find any documentation at all on Google, but it certainly doesn't cause any trouble if the plugin is properly configured.

1

for those who will have the same problem in the future I will post my solution also.

Apparently my problem was just the GWT libraries which were corrupted.

So what I did was

  • go on Project --> Properties --> Google --> Web Toolkit --> Click on 'Use specific SDK'
  • specify the same version as the default (just so Eclipse will recreate GWT libraries and links).

Everything worked fine after that.

Cheers

0

Although this may not be a proper solution, I managed to get it working in my environment:

  • Update eclipse to the latest version of indigo (3.7.2)
  • uninstall/install the Google App Engine tools
  • Create new project from following tutorial ( you can check 'Generate project sample code') and that will add all of the hello world for you

Run it and it should be good to go.

ps: for some reason my eclipse isn't showing any debug output, but the dev_appserver.sh isn't complaining anymore about errors.

TeckniX
  • 673
  • 1
  • 7
  • 14
  • As a side comment, I figured out why Eclipse wouldn't run mine.. it kept complaining about the com.appengine.tools.development.DevAppServerMain missing - Turns out, you can simply copy it to your war/WEB-INF/lib/ directory from com.google.appengine.eclipse.sdkbundle_1.7.1/appengine-java-sdk-1.7.1/lib/appengine-tools-api.jar - After that everything ran smooth. – TeckniX Sep 07 '12 at 21:26