Thanks Robert, I added this bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=409436

Problem is caused by programmatically added servlets not be removed from
the context on a stop, so they already exist on the restart, causing the
registration process to return null (correctly according to the servlet
spec api).

Looking into it.

Jan


On 30 May 2013 01:19, Robert Novotny <[email protected]> wrote:

> Hi,
> I have created a simple tutorial project that uses Spring 3.2 web
> application without web.xml, using WebApplicationInitializer mechanism
> instead.
>
> However, whenever I setup manual reloading within Maven plugin:
>             <configuration>
>                 <reload>manual</reload>
>             </configuration>
>
> and press Enter within the console, the application context gets reloaded,
> but the WebApplicationInitializer throws a NullPointerException (see below)
>
> I am attaching a simple project, which indicated that the reason may lie
> in the WebApplicationInitializer or the servletcontext not being properly
> cleaned up in the undeployment phase. The actual line is:
>
>     ServletRegistration.Dynamic dispatcher = 
> servletContext.addServlet("**dispatcher",
> new DispatcherServlet(ctx));
>
> while addServlet() method returns null whenever the servlet is already
> mapped. However, the freshly deployed application should not have this
> servlet already mapped and it should not return null.
>
> This issue affects the 8.1.x branch as well, the last version of Jetty
> Maven plug-in that works without NPEs is the 8.1.9.v20130131.
>
> The exception is:
>
> java.lang.NullPointerException
>         at jettybug.**WebApplicationInitializer.**onStartup(**
> WebApplicationInitializer.**java:22)
>         at org.springframework.web.**SpringServletContainerInitiali**
> zer.onStartup(**SpringServletContainerInitiali**zer.java:180)
>         at org.eclipse.jetty.plus.**annotation.**ContainerInitializer.**
> callStartup(**ContainerInitializer.java:105)
>         at org.eclipse.jetty.annotations.**ServletContainerInitializerLis*
> *tener.doStart(**ServletContainerInitializerLis**tener.java:107)
>         at org.eclipse.jetty.util.**component.AbstractLifeCycle.**
> start(AbstractLifeCycle.java:**69)
>         at org.eclipse.jetty.util.**component.ContainerLifeCycle.**
> start(ContainerLifeCycle.java:**108)
>         at org.eclipse.jetty.util.**component.ContainerLifeCycle.**
> doStart(ContainerLifeCycle.**java:82)
>
> Robert
>
>
>
> _______________________________________________
> jetty-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
>


-- 
Jan Bartel <[email protected]>
www.webtide.com – Developer advice, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to