即使安装了jetty-alpn-java-client或jetty-alpn-conscrypt-client jar之后,没有客户端ALPNProcessors JMeter HTTP2错误

时间:2019-08-26 03:45:09

标签: jmeter http2

我遇到了Java 8,JMeter 5.1.1版本中与此帖子中提到的相同错误:Java 12 JMeter 5 HTTP/2 request java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/client/ALPNClientConnectionFactory

我从here下载了jetty-alpn-java-client并安装在lib目录中并重新启动jmeter,我仍然看到相同的问题。 没有涉及TLS配置,但我仍然下载了jetty-alpn-conscrypt-client并从此link安装,仍然看到相同的问题。

我没有编写任何代码,我从JMeter插件管理器安装了HTTP2 Sampler。请让我知道我在想什么。

错误代码:

  

java.util.concurrent.ExecutionException:java.lang.IllegalStateException:没有客户端ALPNProcessors!       在org.eclipse.jetty.util.FuturePromise.get(FuturePromise.java:138)       在com.blazemeter.jmeter.http2.sampler.HTTP2Connection.connect(HTTP2Connection.java:68)       在com.blazemeter.jmeter.http2.sampler.HTTP2Request.setConnection(HTTP2Request.java:278)       在com.blazemeter.jmeter.http2.sampler.HTTP2Request.sample(HTTP2Request.java:138)       在com.blazemeter.jmeter.http2.sampler.HTTP2Request.sample(HTTP2Request.java:115)       在org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622)       在org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546)       在org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486)       在org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)       在java.lang.Thread.run(Thread.java:748)   原因:java.lang.IllegalStateException:没有客户端ALPNProcessors!       在org.eclipse.jetty.alpn.client.ALPNClientConnectionFactory。(ALPNClientConnectionFactory.java:57)       在org.eclipse.jetty.http2.client.HTTP2Client.lambda $ doStart $ 1(HTTP2Client.java:155)       在org.eclipse.jetty.http2.client.HTTP2Client $ ClientSelectorManager.newConnection(HTTP2Client.java:438)       在org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:222)       在org.eclipse.jetty.io.ManagedSelector.access处$ 1500(ManagedSelector.java:60)       在org.eclipse.jetty.io.ManagedSelector $ CreateEndPoint.run(ManagedSelector.java:825)       在org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:754)       在org.eclipse.jetty.util.thread.QueuedThreadPool $ 2.run(QueuedThreadPool.java:672)       ...还有1个       禁止:java.lang.UnsupportedClassVersionError:org / eclipse / jetty / alpn / java / client / JDK9ClientALPNProcessor由Java Runtime的最新版本(类文件版本53.0)编译,该版本的Java Runtime仅识别类文件版本高达52.0           在java.lang.ClassLoader.defineClass1(本机方法)           在java.lang.ClassLoader.defineClass(ClassLoader.java:763)           在java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)           在java.net.URLClassLoader.defineClass(URLClassLoader.java:468)           在java.net.URLClassLoader.access $ 100(URLClassLoader.java:74)           在java.net.URLClassLoader $ 1.run(URLClassLoader.java:369)           在java.net.URLClassLoader $ 1.run(URLClassLoader.java:363)           在java.security.AccessController.doPrivileged(本机方法)           在java.net.URLClassLoader.findClass(URLClassLoader.java:362)           在java.lang.ClassLoader.loadClass(ClassLoader.java:424)           在java.lang.ClassLoader.loadClass(ClassLoader.java:357)           在java.lang.Class.forName0(本地方法)           在java.lang.Class.forName(Class.java:348)           在java.util.ServiceLoader $ LazyIterator.nextService(ServiceLoader.java:370)           在java.util.ServiceLoader $ LazyIterator.next(ServiceLoader.java:404)           在java.util.ServiceLoader $ 1.next(ServiceLoader.java:480)           在org.eclipse.jetty.alpn.client.ALPNClientConnectionFactory。(ALPNClientConnectionFactory.java:65)           ...另外8个       禁止:java.lang.NoClassDefFoundError:org / eclipse / jetty / alpn / ALPN           在org.eclipse.jetty.alpn.java.client.OpenJDK8ClientALPNProcessor.init(OpenJDK8ClientALPNProcessor.java:42)           在org.eclipse.jetty.alpn.client.ALPNClientConnectionFactory。(ALPNClientConnectionFactory.java:77)           ...另外8个       引起原因:java.lang.ClassNotFoundException:org.eclipse.jetty.alpn.ALPN           在java.net.URLClassLoader.findClass(URLClassLoader.java:382)           在java.lang.ClassLoader.loadClass(ClassLoader.java:424)           在java.lang.ClassLoader.loadClass(ClassLoader.java:357)           ...还有10个

1 个答案:

答案 0 :(得分:1)

您使用了错误的alpn-boot库,您正在尝试使用需要Java 9并且使用Java 8的9.4.9.v20180320

此页底部有一个表格:https://www.eclipse.org/jetty/documentation/9.4.x/alpn-chapter.html

,您可以在其中将alpn-boot库的相关版本与Java 8版本进行匹配。

此外,您不应将.jar放入JMeter的“ lib”文件夹,而应设置相关的-Xbootclasspath/p:/path/to/alpn-boot.jar JVM属性。

更多信息: