https://bz.apache.org/bugzilla/show_bug.cgi?id=64680

            Bug ID: 64680
           Summary: Jmeter failed to start with the Prometheus JMX agent
                    when run not from $JMETER_HOME/bin
           Product: JMeter
           Version: 5.1.1
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Main
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: JMETER_5.3.1

Trying configure Prometheus JMX agent for Jmeter but faced following issue -
when I start Jmeter outside of $JMETER_HOME/bin folder - it fails with an
error:

java.lang.Throwable: Could not access null/lib
        at org.apache.jmeter.NewDriver.<clinit>(NewDriver.java:105)
java.lang.Throwable: Could not access null/lib/ext
        at org.apache.jmeter.NewDriver.<clinit>(NewDriver.java:105)
java.lang.Throwable: Could not access null/lib/junit
        at org.apache.jmeter.NewDriver.<clinit>(NewDriver.java:105)
java.lang.ClassNotFoundException: org.apache.jmeter.JMeter
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at org.apache.jmeter.NewDriver.main(NewDriver.java:250)
JMeter home directory was detected as: null

null- is because I run from / , and JMeter is set to parent dir

Launch command:

java -Dcom.sun.management.jmxremote.port=12021
-Dcom.sun.management.jmxremote.rmi.port=12021
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false -Dgroovy.use.classvalue=true
-javaagent:/apps/injector/apache-jmeter/bin/jmx_prometheus_javaagent-0.13.0.jar=8778:/apps/injector/apache-jmeter/bin/prometheus_config.yaml
-jar /apps/injector/apache-jmeter/bin/ApacheJMeter.jar -n -t
/apps/injector/apache-jmeter/extras/Test.jmx

Same command works fine in case I run it from $JMETER_HOME/bin folder.

Running a Jmeter with -javaagent option defined - set JMeter home directory as
a parent dir for the dir I trying to run from.

JMETER_HOME env var is defined and both JMETER_HOME and JMETER_HOME/bin added
to PATH. And I can run Jmeter with the above command from any path when
removing -javaagent option from the original command.

Tried also -d/--homedir Jmeter options - but this didn't help.

How can I make Jmeter to be compatible with Prometheus agent and to be run from
any path?

p.s. tried on both Linux/Win.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to