Community
Participate
Working Groups
Deploying an OSGI application packaged as a legacy WAR using equinox servlet bridge, above NPE occurs by requesting following http://myServer:7001/myApp It works perfectly with http://myServer:7001/myApp/ (notice the last '/') Debugging the code, I noticed following in org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(HttpServletRequest, HttpServletResponse) String alias = HttpServletRequestAdaptor.getDispatchPathInfo(req); if (alias == null) alias = "/"; //$NON-NLS-1$ So there should probably be similar code here: org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(HttpServletRequest, HttpServletResponse, String, String) String dispatchPathInfo = HttpServletRequestAdaptor.getDispatchPathInfo(req); if (dispatchPathInfo == null) dispatchPathInfo = "/"; //$NON-NLS-1$ The exception is: java.lang.NullPointerException at org.eclipse.equinox.http.servlet.internal.FilterRegistration.matches(FilterRegistration.java:96) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:114) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.eclipse.equinox.servletbridge.BridgeServlet.service(BridgeServlet.java:120)
Created attachment 202023 [details] proposed patch allowing to fix the issue
Good catch. We always want to match on "/". Your patch is fine but we might want the logic in filter registration or else change some variable names or both.
Fixed in HEAD. I've played around with this but in the end I think your patch is the simplest fix. Thanks Arnaud.
(In reply to comment #3) > Fixed in HEAD. Of coarse Simon mean master in git ;-) and used the following commit: http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=d7f324c4f04586b3e1a32284a9dc0923fd8c5103 I also update the version of the bundle with the following commit: http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=b097c3ae07571f990b7f8ee4d179d418c828b174