4
votes

I am unable to create a HTTP2 request using Jmeter 4.0. I have installed latest JDK, and HTTP/2 protocol sampler plugin.

I have also observed that: "penJDK8ClientALPNProcessor@e23ec5a not applicable for java 10.0.2" Tried using Java 9, but I get the same thing.

PS: I already tried adding the JVM_ARGS=...

Complete stack-trace is:

java.util.concurrent.ExecutionException: java.lang.IllegalStateException: No Client ALPNProcessors!
    at org.eclipse.jetty.util.FuturePromise.get(FuturePromise.java:138)
    at com.blazemeter.jmeter.http2.sampler.HTTP2Connection.connect(HTTP2Connection.java:65)
    at com.blazemeter.jmeter.http2.sampler.HTTP2Request.setConnection(HTTP2Request.java:247)
    at com.blazemeter.jmeter.http2.sampler.HTTP2Request.sample(HTTP2Request.java:121)
    at com.blazemeter.jmeter.http2.sampler.HTTP2Request.sample(HTTP2Request.java:107)
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:490)
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:416)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:250)
    at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: No Client ALPNProcessors!
    at org.eclipse.jetty.alpn.client.ALPNClientConnectionFactory.<init>(ALPNClientConnectionFactory.java:57)
    at org.eclipse.jetty.http2.client.HTTP2Client.lambda$doStart$1(HTTP2Client.java:155)
    at org.eclipse.jetty.http2.client.HTTP2Client$ClientSelectorManager.newConnection(HTTP2Client.java:438)
    at org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:222)
    at org.eclipse.jetty.io.ManagedSelector.access$1500(ManagedSelector.java:60)
    at org.eclipse.jetty.io.ManagedSelector$CreateEndPoint.run(ManagedSelector.java:825)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:754)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:672)
    ... 1 more
    Suppressed: java.lang.IllegalStateException: org.eclipse.jetty.alpn.java.client.OpenJDK8ClientALPNProcessor@e23ec5a not applicable for java 10.0.2
        at org.eclipse.jetty.alpn.java.client.OpenJDK8ClientALPNProcessor.init(OpenJDK8ClientALPNProcessor.java:41)
        at org.eclipse.jetty.alpn.client.ALPNClientConnectionFactory.<init>(ALPNClientConnectionFactory.java:77)
        ... 8 more
3

3 Answers

4
votes

The default installation of the HTTP/2 Sampler uses the dependencies ...

Install library: http2-client
Install library: jetty-alpn-openjdk8-client
Install library: jetty-alpn-client
Install library: http2-common
Install library: http2-hpack
Install library: jetty-io
Install library: jetty-http
Install library: jetty-util
Install plugin: bzm-http2 1.2

This list of dependencies are invalid for Java 9+.

In particular, the jetty-alpn-openjdk8-client dependency is invalid and not appropriate for Java 9+. For Java 9+, the jetty-alpn-java-client should be used instead.

History:

Back in the days of Java 8, there was a need to support HTTP/2, which requires the ALPN layers for TLS.

Java 8 had no official support for ALPN, so the Jetty project maintained a JVM -Xbootclasspath/p:<path-to-alpn-boot.jar> replacement of the core SSL layers in the JVM to allow ALPN to be used.

This was a custom API not provided by the JVM itself.

https://www.eclipse.org/jetty/documentation/current/alpn-chapter.html

Other projects outside of Jetty started using this API as well.

When the Java 9 networking discussions started, there was a demand to have ALPN support be baked into the JVM itself.

This effort at openjdk became the official API for ALPN.

This new official API is different then the Java 8 API.

In short, you have to use the appropriate API layer for the JVM you are using.

If you want support for this, please open a new topic on the jmeter-plugins forum (feel free to reference this stackoverflow answer)

0
votes

Looking into

penJDK8ClientALPNProcessor

my expectation is that you have to use Java 8 SE in order to get the plugin to work.

References:

0
votes

Using jetty 9.4.19.v20190610:

    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-alpn-java-client</artifactId>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-alpn-conscrypt-client</artifactId>
    </dependency>