Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] NPE on PushCacheFilter

Hi,

On Thu, Jul 2, 2015 at 9:59 AM, Michele Rossi <michele.rossi@xxxxxxxxx> wrote:
> hi,
>
> I am experimenting with Jetty 9.3.0.v20150612 and HTTP2 to try to reduce the
> load time of my JavaScript web application.
>
> The application needs to load about 60 resources (.js etc) for a total of
> 3.8Mb and I was hoping that HTTP2 would help.
>
> I am serving my static files through DefaultServlet configured as shown in
> the default web.xml, the only difference being "useFileMappedBuffer=true"
>
> I added the PushCacheFilter to my web.xml as shown on
> https://eclipse.org/jetty/documentation/current/http2-configuring-push.html
>
> (As a side note, in order to make PushCacheFilter work, I add to add
> jetty-http-9.3.0.v20150612.jar, jetty-server, jetty-servlets,jetty-util to
> WEB-INF/lib and that might be worth adding to the documentation)
>
> With the PushCacheFilter enabled  I get the following stacktrace:
>
> java.lang.NullPointerException: null
>         at
> org.eclipse.jetty.servlets.PushCacheFilter.doFilter(PushCacheFilter.java:119)
> ~[jetty-servlets-9.3.0.v20150612.jar:9.3.0.v20150612]
>         at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)
> ~[jetty-servlet-9.3.0.v20150612.jar:9.3.0.v20150612]
>         at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
> [jetty-servlet-9.3.0.v20150612.jar:9.3.0.v20150612]
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> [jetty-server-9.3.0.v20150612.jar:9.3.0.v20150612]
>
>
> Having a look at the code, it looks like
> org.eclipse.jetty.server.Request.getBaseRequest(ServletRequest) returns
> null.
>
> This could be because the request is not an instance of any of the classes
> considered in the method (maybe because HTTP2 requests are wrapped
> differently?).
>
> Another side note: I have tested the load time with HTTP2 (no
> PushCacheFilter) and HTTPS and so far I am getting better results with HTTPS
> (Chrome 43.0.2357.130 m).
> However I have not been able to test on an isolated network and my tests
> show quite a bit of variance so for now I am not convinced of my results.
> I am just interested to find out if anybody else has obtained anything
> similar and whether the browsers could be responsible.
>
>
> I really hope I am not wasting your time with one of those stupid
> configuration errors.

I think it's a classloader issue due to the fact you have added
jetty-server-<version>.jar to WEB-INF/lib.
Try to remove it.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.


Back to the top