Using setenv.bat stops the plugin manager from loading

249 views
Skip to first unread message

Streetwind

unread,
Oct 22, 2020, 3:40:16 AM10/22/20
to jmeter-plugins
Hello all,

I am very new to JMeter, and I'm trying to teach myself the basics. The use case I have requires a plugin, though, and so I have installed the plugin manager.

When opening the plugin manager, it cannot connect to the repository. So I need to pass the proxy settings as JVM_ARGS, as the documentation says. I am trying to do this in the JMeter recommended way, by creating the file setenv.bat in the /bin/ folder and providing the JVM arguments inside that file.

Problem is, whenever setenv.bat is present, the plugin manager disappears from the Options menu. As soon as I rename the file into something else, the plugin manager retuns (but is unable to connect, since no proxy settings are specified).

Why exactly is this happening, and how can I get it to work?

Dmitri Tikhanski

unread,
Oct 22, 2020, 9:12:59 AM10/22/20
to jmeter-plugins
We're unable to help without seeing your setenv.bat file contents and jmeter.log file


In general Plugins Manager respects JMeter proxy settings so you can add the relevant -H, -P, etc. arguments to jmeter.bat file or provide them via system.properties file 

Streetwind

unread,
Oct 26, 2020, 3:31:07 AM10/26/20
to jmeter-plugins
Hi,

My setenv.bat contains just one single line of text:

set JVM_ARGS="-Dhttps.proxyHost=[redacted] -Dhttps.proxyPort=80 -Dhttp.proxyUser=[redacted] -Dhttp.proxyPass=[redacted]"

That's it.

jmeter.log has the following contents:

2020-10-22 09:29:40,853 INFO o.a.j.u.JMeterUtils: Setting Locale to en_EN
2020-10-22 09:29:40,884 INFO o.a.j.JMeter: Loading user properties from: user.properties
2020-10-22 09:29:40,884 INFO o.a.j.JMeter: Loading system properties from: system.properties
2020-10-22 09:29:40,884 INFO o.a.j.JMeter: Copyright (c) 1998-2020 The Apache Software Foundation
2020-10-22 09:29:40,884 INFO o.a.j.JMeter: Version 5.3
2020-10-22 09:29:40,884 INFO o.a.j.JMeter: java.version=1.8.0_261
2020-10-22 09:29:40,884 INFO o.a.j.JMeter: java.vm.name=Java HotSpot(TM) Client VM
2020-10-22 09:29:40,884 INFO o.a.j.JMeter: os.name=Windows 10
2020-10-22 09:29:40,884 INFO o.a.j.JMeter: os.arch=x86
2020-10-22 09:29:40,884 INFO o.a.j.JMeter: os.version=10.0
2020-10-22 09:29:40,884 INFO o.a.j.JMeter: file.encoding=Cp1252
2020-10-22 09:29:40,884 INFO o.a.j.JMeter: java.awt.headless=null
2020-10-22 09:29:40,884 INFO o.a.j.JMeter: Max memory     =1073741824
2020-10-22 09:29:40,884 INFO o.a.j.JMeter: Available Processors =4
2020-10-22 09:29:40,899 INFO o.a.j.JMeter: Default Locale=English (EN)
2020-10-22 09:29:40,899 INFO o.a.j.JMeter: JMeter  Locale=English (EN)
2020-10-22 09:29:40,899 INFO o.a.j.JMeter: JMeterHome=D:\Apache JMeter
2020-10-22 09:29:40,899 INFO o.a.j.JMeter: user.dir  =D:\Apache JMeter\bin
2020-10-22 09:29:40,899 INFO o.a.j.JMeter: PWD       =D:\Apache JMeter\bin
2020-10-22 09:29:40,899 INFO o.a.j.JMeter: IP: [redacted] Name: [redacted] FullName: [redacted]
2020-10-22 09:29:41,056 INFO o.a.j.JMeter: Setting LAF to: com.github.weisj.darklaf.DarkLaf:com.github.weisj.darklaf.theme.DarculaTheme
2020-10-22 09:29:41,446 INFO o.a.j.JMeter: Loaded icon properties from org/apache/jmeter/images/icon.properties
2020-10-22 09:29:44,258 INFO o.j.r.JARSourceHTTP: Using proxy [redacted] -Dhttps.proxyPort=80 -Dhttp.proxyUser=[redacted] -Dhttp.proxyPass=[redacted]
2020-10-22 09:29:44,274 ERROR o.j.r.PluginManagerMenuCreator: Failed to load Plugins Manager
java.lang.ExceptionInInitializerError: null
    at org.jmeterplugins.repository.PluginManagerMenuItem.<init>(PluginManagerMenuItem.java:30) ~[jmeter-plugins-manager-1.4.jar:?]
    at org.jmeterplugins.repository.PluginManagerMenuCreator.getMenuItemsAtLocation(PluginManagerMenuCreator.java:22) [jmeter-plugins-manager-1.4.jar:?]
    at org.apache.jmeter.gui.util.JMeterMenuBar.addPluginsMenuItems(JMeterMenuBar.java:591) [ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.gui.util.JMeterMenuBar.makeOptionsMenu(JMeterMenuBar.java:339) [ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.gui.util.JMeterMenuBar.createMenuBar(JMeterMenuBar.java:203) [ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.gui.util.JMeterMenuBar.<init>(JMeterMenuBar.java:118) [ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.gui.MainFrame.init(MainFrame.java:514) [ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.gui.MainFrame.<init>(MainFrame.java:231) [ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.JMeter.startGui(JMeter.java:400) [ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.JMeter.start(JMeter.java:547) [ApacheJMeter_core.jar:5.3]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_261]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_261]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_261]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_261]
    at org.apache.jmeter.NewDriver.main(NewDriver.java:252) [ApacheJMeter.jar:5.3]
Caused by: java.lang.IllegalArgumentException: Host name may not contain blanks
    at org.apache.http.util.Args.containsNoBlanks(Args.java:87) ~[httpcore-4.4.13.jar:4.4.13]
    at org.apache.http.HttpHost.<init>(HttpHost.java:80) ~[httpcore-4.4.13.jar:4.4.13]
    at org.apache.http.HttpHost.<init>(HttpHost.java:99) ~[httpcore-4.4.13.jar:4.4.13]
    at org.jmeterplugins.repository.JARSourceHTTP.getHTTPClient(JARSourceHTTP.java:117) ~[jmeter-plugins-manager-1.4.jar:?]
    at org.jmeterplugins.repository.JARSourceHTTP.<init>(JARSourceHTTP.java:85) ~[jmeter-plugins-manager-1.4.jar:?]
    at org.jmeterplugins.repository.PluginManager.<init>(PluginManager.java:56) ~[jmeter-plugins-manager-1.4.jar:?]
    at org.jmeterplugins.repository.PluginManager.<clinit>(PluginManager.java:44) ~[jmeter-plugins-manager-1.4.jar:?]
    ... 15 more

Now, I do see the line that says "Host name may not contain blanks", but I guarantee you that nothing I put in setenv.bat has excess whitespace. I doublechecked this several times. The only blanks present are those between the previous value and the following argument switch. There is no whitespace or additional empty lines following the single line of text the file contains either.

Streetwind

unread,
Nov 3, 2020, 3:20:49 AM11/3/20
to jmeter-plugins
I've figured it out in the meantime: the quotation marks I had in the line in setenv.bat had to be removed. This is despite the fact that the official documentation on the JMeter website explicitly shows an example with the quotation marks present.

In this case, the official documentation is apparently just wrong.

Felix Schumacher

unread,
Nov 28, 2020, 5:15:33 AM11/28/20
to jmeter-plugins
Thanks for the information, has been corrected in the documentation and will be live with the next release, which should be done soon.
Reply all
Reply to author
Forward
0 new messages