jmeter导入.jmx文件报CannotResolveClassException: org.apache.jmeter.protocol.ssh.sampler.SSHSampler

本文介绍了解决在JMeter中因未配置SSHCommand而导致的导入jmx文件失败的问题。通过放置特定的jar文件到正确的目录下可以解决此问题。

在导入jmx文件时,由于本地装的jmeter没有配置SSH Command,而导入的jmx的文件中使用,因此报错:Cause:
CannotResolveClassException: org.apache.jmeter.protocol.ssh.sampler.SSHSampler
在这里插入图片描述
将jmeter-ssh-sampler-0.1.0.jar放在jmeter的安装目录的lib/ext下,jsch-0.1.54.jar放在jmeter的安装目录的lib下即可,再导入正常。

jmeter测上传文件的接口,请求是 POST https://metapta.migu.cn/bit-id/3d-digital/avatar-api/v1/knowledge/file/upload POST data: --5OS0qoUAix1Lz4aCWFK6XKv19tsBqCPuCmH_ Content-Disposition: form-data; name="knowledgeId" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1498935310975762549 --5OS0qoUAix1Lz4aCWFK6XKv19tsBqCPuCmH_ Content-Disposition: form-data; name="srcFile"; filename="?????????? ???????? ?????????????.docx" Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document Content-Transfer-Encoding: binary <actual file content, not shown here> --5OS0qoUAix1Lz4aCWFK6XKv19tsBqCPuCmH_-- Cookie Data: Admin-Mobile=13430966064; Admin-Token=" Bearer eyJhbGciOiJIUzI1NiJ9.eyJ0eXBlIjoid2ViIiwiYWNjb3VudCI6IjEzNDMwOTY2MDY0Iiwic3ViIjoiMTk3OTUyMTA3NzU4MjY3NTk2OSIsImlzcyI6ImF2YXRhci11c2VyLXNlcnZlciIsImlhdCI6MTc2MDkzOTA2NywiZXhwIjoxNzYxNTQzODY3LCJuYmYiOjE3NjA5MzkwNjd9.CKRDwqWVTxhALcIkZDWiO1xpSkuez230AHLU2YPxu-A"响应是 java.io.FileNotFoundException: C:\Users\EDY\Desktop\shuzhirenxiangmu\wodezhishiku\jituanxinxi\jituanxinxi\���������� �ұ���Ӧ�� �й��ƶ�֣�س�ŵ��.docx (系统找不到指定的路径。) at java.base/java.io.FileInputStream.open0(Native Method) at java.base/java.io.FileInputStream.open(FileInputStream.java:216) at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157) at org.apache.http.entity.mime.content.FileBody.writeTo(FileBody.java:116) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$ViewableFileBody.writeTo(HTTPHC4Impl.java:1513) at org.apache.http.entity.mime.AbstractMultipartForm.doWriteTo(AbstractMultipartForm.java:134) at org.apache.http.entity.mime.AbstractMultipartForm.writeTo(AbstractMultipartForm.java:157) at org.apache.http.entity.mime.MultipartFormEntity.writeTo(MultipartFormEntity.java:113) at org.apache.http.impl.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:156) at org.apache.http.impl.conn.CPoolProxy.sendRequestEntity(CPoolProxy.java:152) at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:238) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$2.doSendRequest(HTTPHC4Impl.java:458) at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:935) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:646) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1296) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1285) at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638) at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) at java.base/java.lang.Thread.run(Thread.java:833)
最新发布
10-28
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

永远不要矫情

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值