Bug 65580

Summary: user.classpath, search_paths, test plan class path all ignored if JMeter run programmatically
Product: JMeter - Now in Github Reporter: ib
Component: MainAssignee: JMeter issues mailing list <issues>
Status: NEW ---    
Severity: major    
Priority: P2    
Version: 5.4.1   
Target Milestone: JMETER_5.5   
Hardware: Macintosh   
OS:    

Description ib 2021-09-18 00:49:31 UTC
G'day,

(Environment is actually Mac OS 11.1 - selector is a bit out of date)

Unable to add libraries to JMeter class path when running JMeter programmatically (using StandardJMeterEngine).

Tried:
- setting user.classpath property to the absolute path of the target JAR with JMeterUtils
- setting search_paths property to the absolute path of the target JAR with JMeterUtils
- setting user.class to the absolute path of the target JAR in the JMeter properties file
- setting search_paths to the absolute path of the target JAR in the JMeter properties file
- setting TestPlan.user_define_classpath element value to the absolute path of the target JAR in the test plan

All are ignored resulting in ClassNotFoundException.

If the target JAR is added to the class path of the program running JMeter programatically then the target class is loaded and there is no ClassNotFoundException (so nothing wrong with the JAR or the spelling of the target class being loaded). But I can't use this approach because that program downloads the target JAR and puts it into a directory. The program's classpath wildcard has already been evaluated by then so the target JAR can't be added to the program's class path after the program has started. I could, in principal, run the program twice but that introduces other difficulties.
Comment 1 The ASF infrastructure team 2022-09-24 20:38:22 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/5577