简体   繁体   English

Java 12 JMeter 5 HTTP/2 请求 java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/client/ALPNClientConnectionFactory

[英]Java 12 JMeter 5 HTTP/2 request java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/client/ALPNClientConnectionFactory

I am using Java 12, JMeter 5.1.1 on Ubuntu 9.0.4 and bumps into the following exception when trying to send HTTP/2 request:我在 Ubuntu 9.0.4 上使用 Java 12、JMeter 5.1.1,并在尝试发送 HTTP/2 请求时遇到以下异常:

Response code: Non HTTP response code: java.util.concurrent.ExecutionException
Response message: Non HTTP response message: java.lang.IllegalStateException: No Client ALPNProcessors!

And this stack trace in the response body:响应正文中的此堆栈跟踪:

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:68)
    at com.blazemeter.jmeter.http2.sampler.HTTP2Request.setConnection(HTTP2Request.java:278)
    at com.blazemeter.jmeter.http2.sampler.HTTP2Request.sample(HTTP2Request.java:138)
    at com.blazemeter.jmeter.http2.sampler.HTTP2Request.sample(HTTP2Request.java:115)
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622)
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546)
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
    at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.IllegalStateException: No Client ALPNProcessors!
    at org.eclipse.jetty.alpn.client.ALPNClientConnectionFactory.<init>(ALPNClientConnectionFactory.java:54)
    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

JMeter 5.1.1 comes with jetty-alpn-client-9.4.9.v20180320.jar by default. JMeter 5.1.1 默认带有jetty-alpn-client-9.4.9.v20180320.jar

I then download the jetty alpn java client library from http://central.maven.org/maven2/org/eclipse/jetty/jetty-alpn-java-client/ and put that into jmeter installed lib/ folder and results in this exception:然后我从http://central.maven.org/maven2/org/eclipse/jetty/jetty-alpn-java-client/下载 jetty alpn java 客户端库并将其放入 jmeter 安装的 lib/ 文件夹并导致此异常:

java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/client/ALPNClientConnectionFactory
    at org.eclipse.jetty.util.FuturePromise.get(FuturePromise.java:138)
    at com.blazemeter.jmeter.http2.sampler.HTTP2Connection.connect(HTTP2Connection.java:68)
    at com.blazemeter.jmeter.http2.sampler.HTTP2Request.setConnection(HTTP2Request.java:278)
    at com.blazemeter.jmeter.http2.sampler.HTTP2Request.sample(HTTP2Request.java:138)
    at com.blazemeter.jmeter.http2.sampler.HTTP2Request.sample(HTTP2Request.java:115)
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622)
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546)
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
    at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/client/ALPNClientConnectionFactory
    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
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.alpn.client.ALPNClientConnectionFactory
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:436)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 8 more

I switched to Java 11 but get the same error.我切换到 Java 11 但得到同样的错误。 Any advice and insight is appreciated.任何建议和见解表示赞赏。

No Client ALPNProcessors! is a message from the Jetty libraries that handle ALPN.是来自处理 ALPN 的 Jetty 库的消息。

Because you are running in JDK 12 (and I don't think there is any big difference with JDK 11, so JDK 12 should be fine), you must have the jetty-alpn-java-client jar in the classpath, so that the Jetty libraries will find an implementation of the ALPNProcessor.Client class (via the ServiceLoader mechanism) that, as the error shows, cannot be found.因为您在 JDK 12 中运行(我认为与 JDK 11 没有太大区别,所以 JDK 12 应该没问题),所以您必须在类路径中有jetty-alpn-java-client jar,以便Jetty 库将找到ALPNProcessor.Client类的实现(通过ServiceLoader机制),如错误所示,无法找到。

You don't detail how you are setting up TLS, etc. and I would have expected JMeter to have the jetty-alpn-java-client jar in the classpath already, but evidently there is something wrong in your setup (or in JMeter's).您没有详细说明如何设置 TLS 等,我希望 JMeter 已经在类路径中包含jetty-alpn-java-client jar,但显然您的设置(或 JMeter 的)中存在问题.

I would double check how JMeter configures TLS;我会仔细检查 JMeter 如何配置 TLS; if it is using the standard JDK implementation, then it must have the jetty-alpn-java-client jar in the classpath.如果它使用标准的 JDK 实现,那么它必须在类路径中有jetty-alpn-java-client jar。

If JMeter is using other TLS implementations (eg Conscrypt), then the Jetty project provides similar libraries (eg jetty-alpn-conscrypt-client jar) that similarly should be in the classpath.如果 JMeter 使用其他 TLS 实现(例如 Conscrypt),那么 Jetty 项目提供类似的库(例如jetty-alpn-conscrypt-client jar),它们同样应该在类路径中。

JMeter 5 doesn't officially support Java 12 JMeter 5 不正式支持 Java 12

JMeter 5.0 officially requires Java 8 or 9, although later versions may be unofficially compatible. JMeter 5.0 正式要求 Java 8 或 9,尽管更高版本可能非正式兼容。 From our internal testing, JMeter will run on Java 11根据我们的内部测试,JMeter 将在 Java 11 上运行

Also in JMeter group announcement:同样在JMeter 组公告中:

JMeter 5.0 is tested on Java 8 to 10, Java 11 should also work. JMeter 5.0 在 Java 8 到 10 上进行了测试,Java 11 也应该可以工作。

Notice also Java 12 isn't Long-Term-Support release另请注意 Java 12 不是长期支持版本

Java SE 11 however is an LTS release, and therefore Oracle Customers will receive Oracle Premier Support and periodic update releases, even though Java SE 12 was released然而,Java SE 11 是 LTS 版本,因此即使 Java SE 12 已发布,Oracle 客户也将获得 Oracle 标准支持和定期更新版本

Solution: Download http://central.maven.org/maven2/org/eclipse/jetty/jetty-alpn-java-client/ and put in the installed jmeter lib/ folder.解决方法:下载http://central.maven.org/maven2/org/eclipse/jetty/jetty-alpn-java-client/ ,放到安装好的jmeter lib/文件夹中。 JMeter only comes installed with jetty-alpn-client which is not enough. JMeter 只安装了jetty-alpn-client这还不够。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 即使在安装 jetty-alpn-java-client 或 jetty-alpn-conscrypt-client jar 后,也没有客户端 ALPNProcessors JMeter HTTP2 错误 - No Client ALPNProcessors JMeter HTTP2 Error even after installing jetty-alpn-java-client or jetty-alpn-conscrypt-client jar Jmeter - Hive 给 java.lang.NoClassDefFoundError: org/apache/hadoop/security/SaslRpcServer - Jmeter - Hive giving java.lang.NoClassDefFoundError: org/apache/hadoop/security/SaslRpcServer java.lang.NoClassDefFoundError:无法初始化 class org.apache.jmeter.gui.util.MenuFactory - java.lang.NoClassDefFoundError: Could not initialize class org.apache.jmeter.gui.util.MenuFactory 带有 JMeter 的 HTTP/2 请求因“nullSession”而失败 (jetty-alpn) - HTTP/2 Request with JMeter fails with “nullSession” (jetty-alpn) JMeter JMS 发布者 IBM MQ Java.lang.NoClassDefFoundError - JMeter JMS Publisher IBM MQ Java.lang.NoClassDefFoundError JMeter - Webdriver错误:java.lang.NoClassDefFoundError:com / sun / jna / platform / win32 / Kernel32 - JMeter - Webdriver error : java.lang.NoClassDefFoundError: com/sun/jna/platform/win32/Kernel32 Java / JMeter HTTP请求失败,但curl起作用 - Java/jmeter http request fails but curl works Jmeter4、Java 10 No Client ALPNProcessors 导致 HTTP2 请求示例崩溃 - HTTP2 request sample crashes with Jmeter4, Java 10 No Client ALPNProcessors JMeter HTTP2 请求错误(Java 8、JMeter 5.1) - JMeter HTTP2 request error (Java 8, JMeter 5.1) JMeter抛出java.lang.NoSuchMethodError:org.apache.jmeter.samplers.SampleSaveConfiguration.setFormatter(Ljava / text / DateFormat;) - JMeter throws java.lang.NoSuchMethodError: org.apache.jmeter.samplers.SampleSaveConfiguration.setFormatter(Ljava/text/DateFormat;)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM