首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么我的but脚本在windows机器上工作,但在linux中返回org.apache.http.client.ClientProtocolException呢?

为什么我的but脚本在windows机器上工作,但在linux中返回org.apache.http.client.ClientProtocolException呢?
EN

Stack Overflow用户
提问于 2021-09-07 13:31:42
回答 1查看 55关注 0票数 0

这是一个高频错误,一个特定的呼叫在org.apache.http.client.ClientProtocolException.中返回超过70%的错误。但是,当我在Windows机器上执行它时,相同的脚本没有给我带来任何问题。

但是,一旦我将客户机实现设置为Java的http请求的高级设置设置为Java,该调用就会以正确的响应响应,并且在linux中再也不会发生上述异常。

,这可能是什么原因?

我使用的是Linux5.4.1执行环境。

EN

回答 1

Stack Overflow用户

发布于 2021-09-07 15:37:04

对于成功的请求和失败的请求,很难在没有看到跟踪(即来自tcpdump工具)的情况下声明任何内容,最好是从Windows和Linux机器。

如果您不能接受网络转储(即您没有足够的权限),可以通过在log4j2.xml文件中添加下一行来尝试增加JMeter日志记录HttpComponents的详细性

代码语言:javascript
复制
<Logger name="org.apache.http" level="debug" />

这样,您就可以在jmeter.log文件中查看请求和响应详细信息。

如果以下局限性 of Java实现对您的测试没有影响:

代码语言:javascript
复制
There is no control over how connections are re-used. When a connection is released by JMeter, it may or may not be re-used by the same thread.
The API is best suited to single-threaded usage - various settings are defined via system properties, and therefore apply to all connections.
No support of Kerberos authentication
It does not support client based certificate testing with Keystore Config.
Better control of Retry mechanism
It does not support virtual hosts.
It supports only the following methods: GET, POST, HEAD, OPTIONS, PUT, DELETE and TRACE
Better control on DNS Caching with DNS Cache Manager

就这么办吧。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69089165

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档