apache / apache/jmeter

user.classpath, search_paths, test plan class path all ignored if JMeter run programmatically

Open
#5,577 0 comments 0 reactions 0 assignees View on GitHub
P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

**ib** ([Bug 65580](https://bz.apache.org/bugzilla//show_bug.cgi?id=65580&redirect=false)):
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.

Severity: major
OS:

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue through StandardJMeterEngine with a JAR downloaded after startup, using the listed user.classpath, search_paths, and TestPlan.user_define_classpath settings. Trace how the programmatic engine handles those classpath inputs; done means the downloaded target class loads without ClassNotFoundException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.