Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT: jetty throws nullpointer exception on debugging

Tags:

debugging

gwt

i am currently working on gwt web app, which is nearly finished, but now i get the following warnings while debugging the project as web application:

Jan 10, 2012 5:13:55 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed greetServlet: java.lang.NullPointerException
Jan 10, 2012 5:13:55 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: Failed startup of context com.google.appengine.tools.development.DevAppEngineWebAppContext@29ef4453{/,/home/ich/Eclipse Workspace/Mein Wochenplaner/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:191)
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)
Jan 10, 2012 5:13:55 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The server is running at http://localhost:8888/
Jan 10, 2012 5:13:55 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The admin console is running at http://localhost:8888/_ah/admin

Eclipse still gives me an url, but when i open it, i get an http

503 error, service unavailable

because my start html could not be accessed.

like image 317
user1141 Avatar asked Jan 10 '12 17:01

user1141


2 Answers

I had a similar problem. Turns out that when I created a Web Application Project template with some sample code, a servlet entry was being added to web.xml without any corresponding servlet code.

Simply removed the redundant entries, rolled my own servlets, and it worked fine

like image 79
raven Avatar answered Sep 23 '22 18:09

raven


Make sure the value in your web.xml document points to the correct class. See the example below:

 ...
  <servlet>
    <servlet-name>greetServlet</servlet-name>
    <servlet-class>package.GreetServiceImpl</servlet-class>
  </servlet>
...

package.GreetServiceImpl should exist in your project.

Note: this might have been caused by renaming your classes.

like image 23
elizeu Avatar answered Sep 21 '22 18:09

elizeu