Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Cannot get org.eclipse.jetty.server.Request instance

Hi,

On Tue, Sep 10, 2019 at 2:05 PM John Jiang <john.sha.jiang@xxxxxxxxx> wrote:
> I would have tried that with curl, like the below,
> $ curl -v --http2 http://localhost:9020/push
> *   Trying ::1:9020...
> * TCP_NODELAY set
> * Connected to localhost (::1) port 9020 (#0)
> > GET /push HTTP/1.1
> > Host: localhost:9020
> > User-Agent: curl/7.65.3
> > Accept: */*
> > Connection: Upgrade, HTTP2-Settings
> > Upgrade: h2c
> > HTTP2-Settings: AAMAAABkAARAAAAAAAIAAAAA
> >
> * Mark bundle as not supporting multiuse
> < HTTP/1.1 101 Switching Protocols
> * Received 101
> * Using HTTP2, server supports multi-use
> * Connection state changed (HTTP/2 confirmed)
> * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
> * Connection state changed (MAX_CONCURRENT_STREAMS == 1024)!
> < HTTP/2 500
> < cache-control: must-revalidate,no-cache,no-store
> < content-type: text/html;charset=iso-8859-1
> <
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
> <title>Error 500 Server Error</title>
> </head>
> <body><h2>HTTP ERROR 500</h2>
> <p>Problem accessing /push. Reason:
> <pre>    Server Error</pre></p><h3>Caused by:</h3><pre>java.lang.NullPointerException
> at httptest.ServerPushServlet.doGet(Unknown Source)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:844)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
> ...
>
> I think they talked HTTP/2.
> And I suppose this issue may not related to HTTP/2. If used HTTP/1.1, that Request still was null.

The SETTINGS frame sent during the upgrade is:

HTTP2-Settings: AAMAAABkAARAAAAAAAIAAAAA

when decoded, it yields this map:

{
max_concurrent_streams: 100,
initial_window_size: 32768,
enable_push: 0
}

So cURL does not support pushes, so it disables them in the upgrade
SETTINGS frame.

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


Back to the top