4

I used the client code Jetty provide to us. And some problem occurs. The code I wanna run is here https://github.com/eclipse/jetty.project/blob/master/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/Client.java

And actually I know I come across the same problem like this Jetty HTTP/2 client receive server push example I stopped at this guy's update 2 and I have built a new project under the http2-client folder. But the problem still remains.

INFO::main: Logging initialized @170ms
Exception in thread "main" java.util.concurrent.TimeoutException
at org.eclipse.jetty.util.FuturePromise.get(FuturePromise.java:130)
at org.eclipse.jetty.http2.client.Client.main(Client.java:56)

The jar I use is Jetty-9.3.3. I completely don't know what's wrong. The dev environment is eclipse luna.

Community
  • 1
  • 1
Kennith Jiang
  • 75
  • 1
  • 7
  • 1
    Make sure: A) that you have the ALPN boot jar in your bootclasspath; B) that the server you are contacting supports HTTP/2; C) if using TLS, that the server you are contacting sends a valid, verifiable certificate. Enable DEBUG logging level for the "org.eclipse.jetty" category, and you will have a lot of information about what's going on. Also, set ALPN.debug=true to understand if ALPN worked correctly. – sbordet Sep 04 '15 at 15:13
  • Thank you, sbordet. It seems you are a developer of Jetty. I am using Jetty to research the http/2 now. Thank you so much, Jetty give a big support on http/2. But I think the latest ALPN boot jar 8.1.4 seems not work, the released date is 20150727. When I tried the 8.1.3 ,everything works. Could you please have a look on this problem. Thank you – Kennith Jiang Sep 09 '15 at 04:21
  • You need to be more precise on what does not work, because it does work for us. Please join the [Jetty mailing list](https://www.eclipse.org/jetty/mailinglists.php) for a more detailed discussion that is not possible to have in SO comments. Thanks ! – sbordet Sep 09 '15 at 08:05
  • 1
    I am having the same issue, and I just started a discussion on the jetty-users mailing list. See http://dev.eclipse.org/mhonarc/lists/jetty-users/msg06302.html I will post an answer here if I am able to resolve the issue. – Mike Ivanov Sep 11 '15 at 04:22

1 Answers1

1

Make sure you are adding the ALPN jar to the boot classpath and that the jar is the right version for your version of Java. See this table: https://www.eclipse.org/jetty/documentation/current/alpn-chapter.html#alpn-versions

If you are using Java version "1.8.0_51" then the additional VM parameter should be:

-Xbootclasspath/p:/full/path/to/alpn-boot-8.1.4.v20150727.jar

I was getting the same timeout exception, and in my case it turned out that I was not adding the alpn-boot jar to the boot classpath correctly. Specifically, I was not using the full absolute path to the jar. The VM does not give any errors if the boot classpath is invalid. Giving the absolute path fixed the issue for me.

Mike Ivanov
  • 153
  • 6