Hello all,
I'm trying to use Restlet 1.0.3 in a servlet environment. But I'm getting the
following NPE when the application is starting up:
2007-07-18 20:20:04.701::WARN: Nested in javax.servlet.ServletException:
java.lang.NullPointerException:
java.lang.NullPointerException
at
com.noelios.restlet.application.ApplicationContext.getLoggerName
(ApplicationContext.java:79)
at
com.noelios.restlet.application.ApplicationContext.<init>
(ApplicationContext.java:60)
at
com.noelios.restlet.ext.servlet.ServletContextAdapter.<init>
(ServletContextAdapter.java:55)
at
com.noelios.restlet.ext.servlet.ServerServlet.createApplication
(ServerServlet.java:164)
at
com.noelios.restlet.ext.servlet.ServerServlet.getApplication
(ServerServlet.java:270)
at
com.noelios.restlet.ext.servlet.ServerServlet.init(ServerServlet.java:375)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
I've tracked it down and it seems to stem from the attempt to create the
application trying to use a reference to the application yet to be created:
application = (Application) targetClass.getConstructor(
Context.class).newInstance(
new ServletContextAdapter(this, application,
context));
I'm not sure what the intent is here. I can probably work around the problem
for now by having an empty constructor on my Application class. Is there
anything I'll miss out by doing that?