Bug 65580 - user.classpath, search_paths, test plan class path all ignored if JMeter run programmatically
Summary: user.classpath, search_paths, test plan class path all ignored if JMeter run ...
Status: NEW
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 5.4.1
Hardware: Macintosh
: P2 major (vote)
Target Milestone: JMETER_5.5
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-18 00:49 UTC by ib
Modified: 2021-09-18 00:49 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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