Community
Participate
Working Groups
User reported, see forum post http://www.eclipse.org/forums/index.php/m/998785/#msg_998785 At the very least we should handle this possibility but need to recreate the issue to fix properly. java.lang.NullPointerException org.eclipse.virgo.snaps.core.internal.webapp.SnapServletContext.getResource(SnapServletContext.java:198) org.eclipse.virgo.snaps.core.internal.webapp.StaticResourceServlet.doGet(StaticResourceServlet.java:58) javax.servlet.http.HttpServlet.service(HttpServlet.java:735) javax.servlet.http.HttpServlet.service(HttpServlet.java:848) org.eclipse.virgo.snaps.core.internal.webapp.container.ImmutableFilterChain.doFilter(ImmutableFilterChain.java:47) org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher$1.doWithClassLoader(StandardVirtualContainerRequestDispatcher.java:104) org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher$1.doWithClassLoader(StandardVirtualContainerRequestDispatcher.java:1) org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher.doWithThreadContextClassLoader(StandardVirtualContainerRequestDispatcher.java:121) org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher.service(StandardVirtualContainerRequestDispatcher.java:101) org.eclipse.virgo.snaps.core.internal.webapp.WebAppSnap.handleRequest(WebAppSnap.java:152) org.eclipse.virgo.snaps.core.RequestRouter.service(RequestRouter.java:51) org.eclipse.virgo.snaps.core.SnapHostFilter.doFilter(SnapHostFilter.java:62)
Created attachment 267134 [details] Patch for the described changes I tried to have a look at the problem, but I could not reproduce it, since the setup from http://www.eclipse.org/forums/index.php/m/998785/#msg_998785 is not available anymore (seems that the attachment was moved/deleted). Regarding the reported NPE: In SnapServletContext:getResource, there is already a check whether the path is null, but this check is done after the path parameter was used, making the null-check useless (and causing the NPE). By moving the null-check to the very beginning of the method, the NPE is avoided and a MalformedURLException is thrown instead. Even though this does not fix the problem (which I could not reproduce), it helps by providing a more specific exception. What do you think?