Null pointer exception for new google add using eclipse plugin

I recently tried to create a new gwt / gae project using the Google eclipse plugin. I have successfully done this in the past, and I have several projects that have no problems.

I get a NullPointerException when trying to start a 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 c om.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 don’t know where to debug this.

+6
source share
4 answers

I did a new installation of Eclipse Juno with the Google plugin (GWT + GAE). I now notice that the plugin is constantly trying to modify my web.xml file.

He is trying 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 was not able to figure out how to stop it, but it is really annoying because I need to constantly return this file in order to avoid checking for these changes.

Try removing this servlet from the web.xml file. This does not seem to serve any purpose. This may be due to the Google Cloud.

+4
source

This happened to me when I upgraded from Eclipse from 1.6.4 to 1.7.3, and for some reason the update went wrong, leaving bits of both versions in both libraries; I would have thought that this happened to everyone else. The fix is ​​to close all AppEngine projects and perform the upgrade again, and then switch 1.7.3 to the default version. If there is still a problem, look in the properties β†’ build path β†’ libraries, since there may be a local support library 1.6.4, which you just have to remove, then all this works with this servlet in place.

It would be nice to know what this servlet does, I could not find any documentation at all in Google, but this, of course, does not cause any problems if the plugin is configured correctly.

+2
source

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

Apparently my problem was that the GWT libraries were corrupted.

So what i did

  • go to Project -> Properties -> Google -> Web Toolkit -> Click "Use a specific SDK"
  • specify the same version as the default (just Eclipse recreates the GWT libraries and links).

After that, everything worked.

Greetings

+1
source

Although this may not be the right solution, I managed to get it to work in my environment:

  • Update eclipse to the latest version of indigo (3.7.2)
  • uninstall / install Google App Engine tools
  • Create a new project from the next tutorial (you can check out the "Generate project sample code") and this will add you the whole world of welcome.

Run it, and it should be good to go.

ps: for some reason, my eclipse doesn't show debug output, but dev_appserver.sh no longer complains about errors.

0
source

Source: https://habr.com/ru/post/924752/


All Articles