jmeter依赖jar包找不到类路径

复制代码
这两天我在纠结这个问题,为啥我maven打包放在jmeter路径下后,jmeter的bean Shell 就是找不到这个类。
纠结很久解开了。我记录下,留给后来的朋友。  

Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase; import com.aliba . . . '' : Typed variable declaration : Class: GatewayEncryptReq not found in namespace

后来看了本次打包的路径是这样子的。

很明显这块有一个BOOT-INF/classes 路径,阻碍了jmeter正确识别到类。

如果想知道自己jar包里面长啥样的可以看这个:

jar tf test-demo.jar

下一步就是去掉这个BOOT-INF/classes ,让jmeter的beanshell正确识别到jar包里面的类。

java 复制代码
<plugin>
       <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
        <skip>true</skip>
         </configuration>
</plugin>

一定要加configuration

再次打包就会变成不带BOOT-INF/classes的

将jar包再次引入jmeter,成功识别到类。

噢耶~~

相关推荐
西索斯coding几秒前
doubao-seed-2.1-turbo 调用一直 401 怎么办?pro 版同样的 Key 却正常——5 分钟排查定位指南
java·服务器·数据库·ai
旧梦95277 分钟前
Java SortedMap 接口详解:从入门到实战
java·开发语言
莫陌尛.11 分钟前
Java_this构造方法
java·开发语言
2601_9622972530 分钟前
C# vs Java vs Python:YOLO工业部署性能对比实战
java·python·c·工业视觉·性能对比
计算机毕设定制辅导-无忧学长32 分钟前
《基于SpringBoot的马术俱乐部管理系统》
java·spring boot·后端
Dreams°12339 分钟前
【Java后端+Vue前后端分离:内网正常、公网访问异常|5个高频经典踩坑完整复盘】
java·开发语言·vue.js
学长毕业设计1 小时前
基于SpringBoot的民间艺术传承管理系统(源码+文档+讲解视频)
java·spring boot·后端
小蒜学长1 小时前
基于Springboot+Vue的环保行动志愿者招募系统设计与实现(代码+数据库+LW)
java·数据库·vue.js·spring boot·后端
frjc1 小时前
如何在 IDEA 中打开并运行已有Java项目
java·ide·intellij-idea
java_nnnn2 小时前
文件操作和IO
java