Unable to open existing JMX config in JMeter (scriptwrapper error)

Written by - 0 comments

Published on - last updated on April 18th 2024 - Listed in Linux Security


On my Linux Desktop, currently running Linux Mint 21.2 based on Ubuntu 22.04, JMeter has been running for many years. Obviously I don't use this application every day, I use it from time to time to launch a stress-test - usually before a going live of a new website or application.

When I wanted to load an existing JMeter configuration file, suffixed with .jmx, from a few years ago, I ran into an error:

JMeter shows an error when trying to open an existing jmx config

Unfortunately org.apache.jmeter.save.ScriptWrapper is not really a helpful error and does not indicate why the JMX file could not be opened. 

Hints to missing extensions / plugins

A quick research led to multiple hints, for example a corrupt or broken JMX file. But I knew for a fact this JMX file could be opened without a problem before my Linux Mint upgrade (some time in 2023). Other hints went into a different direction, including this Stackoverflow response, pointing to missing JMeter extensions (or plugins). Let's see what is currently installed on this Ubuntu 22.04 based Linux Mint:

ck@mint ~ $ dpkg -l|grep jmeter
ii  jmeter        2.13-5          all   Load testing and performance measurement application (main application)
ii  jmeter-http   2.13-5          all   Load testing and performance measurement application (http module)

JMeter from the Ubuntu repos is installed in version 2.13 (which is quite old). The JMeter HTTP plugin is installed, too. Although there are a few more plugins available from the Ubuntu repos, none of it solved the error opening an existing JMX.

Also manually trying to install the JMeter plugins-manager plugin did not help.

Trying a newer JMeter version (5.6)

Other hints point to incompatible JMeter plugins and to switch to a newer JMeter version. So let's try this - because at that point I just wanted to get my JMeter run again with my old JMX file.

First download the new JMeter version from the official JMeter website. Use the Binaries download - in the examples below I used for the tgz file.

ck@mint /tmp $ wget https://dlcdn.apache.org//jmeter/binaries/apache-jmeter-5.6.3.tgz

Then unpack the tgz file. You can find the whole JMeter application inside the unpacked directory:

ck@mint /tmp $ tar -xzf apache-jmeter-5.6.3.tgz
ck@mint /tmp $ cd apache-jmeter-5.6.3/
ck@mint /tmp/apache-jmeter-5.6.3 $ ll
total 92
drwxr-xr-x  8 ckadm ckadm  4096 Jan  2 16:44 ./
drwxrwxrwt 26 root  root  20480 Apr 16 14:18 ../
drwxr-xr-x  5 ckadm ckadm  4096 Apr 16 14:18 bin/
drwxr-xr-x  5 ckadm ckadm  4096 Apr 16 14:18 docs/
drwxr-xr-x  2 ckadm ckadm  4096 Dec 31 10:31 extras/
drwxr-xr-x  4 ckadm ckadm 12288 Apr 16 14:18 lib/
-rw-r--r--  1 ckadm ckadm 17095 Dec 31 10:51 LICENSE
drwxr-xr-x 68 ckadm ckadm  4096 Dec  6 07:25 licenses/
-rw-r--r--  1 ckadm ckadm   167 Dec 31 10:51 NOTICE
drwxr-xr-x  6 ckadm ckadm  4096 Jan  2 16:44 printable_docs/
-rw-r--r--  1 ckadm ckadm 10756 Jun 29  2023 README.md

This also includes a bunch of plugins/extensions, already installed:

ck@mint /tmp/apache-jmeter-5.6.3/lib/ext $ ll
total 3920
drwxr-xr-x 2 ckadm ckadm    4096 Apr 16 14:18 ./
drwxr-xr-x 4 ckadm ckadm   12288 Apr 16 14:18 ../
-rw-r--r-- 1 ckadm ckadm   20442 Jan  2 16:43 ApacheJMeter_bolt.jar
-rw-r--r-- 1 ckadm ckadm  779820 Jan  2 16:43 ApacheJMeter_components.jar
-rw-r--r-- 1 ckadm ckadm 2036586 Jan  2 16:43 ApacheJMeter_core.jar
-rw-r--r-- 1 ckadm ckadm   15365 Jan  2 16:43 ApacheJMeter_ftp.jar
-rw-r--r-- 1 ckadm ckadm  126011 Jan  2 16:43 ApacheJMeter_functions.jar
-rw-r--r-- 1 ckadm ckadm  565558 Jan  2 16:44 ApacheJMeter_http.jar
-rw-r--r-- 1 ckadm ckadm   52717 Jan  2 16:43 ApacheJMeter_java.jar
-rw-r--r-- 1 ckadm ckadm   64718 Jan  2 16:43 ApacheJMeter_jdbc.jar
-rw-r--r-- 1 ckadm ckadm   97694 Jan  2 16:43 ApacheJMeter_jms.jar
-rw-r--r-- 1 ckadm ckadm   21674 Jan  2 16:43 ApacheJMeter_junit.jar
-rw-r--r-- 1 ckadm ckadm   49594 Jan  2 16:43 ApacheJMeter_ldap.jar
-rw-r--r-- 1 ckadm ckadm   59985 Jan  2 16:43 ApacheJMeter_mail.jar
-rw-r--r-- 1 ckadm ckadm   29900 Jan  2 16:43 ApacheJMeter_mongodb.jar
-rw-r--r-- 1 ckadm ckadm   14290 Jan  2 16:43 ApacheJMeter_native.jar
-rw-r--r-- 1 ckadm ckadm   30763 Jan  2 16:43 ApacheJMeter_tcp.jar
-rw-r--r-- 1 ckadm ckadm     106 Aug 11  2019 readme.txt

Now let's try the new version by starting the jmeter binary (within the bin directory):

ck@mint /tmp/apache-jmeter-5.6.3 $ cd bin/
ck@mint /tmp/apache-jmeter-5.6.3/bin $ ./jmeter
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
================================================================================
Don't use GUI mode for load testing !, only for Test creation and Test debugging.
For load testing, use CLI Mode (was NON GUI):
   jmeter -n -t [jmx file] -l [results file] -e -o [Path to web report folder]
& increase Java Heap to meet your test requirements:
   Modify current env variable HEAP="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m" in the jmeter batch file
Check : https://jmeter.apache.org/usermanual/best-practices.html
================================================================================

I opened the existing JMX config file and JMeter successfully opened the JMX file, without any error!

All my benchmark settings were correctly loaded from the JMX file. Yay!

Make JMeter 5.6 the new default jmeter

Obviously the new version includes some important fixes - and the GUI also looks nicer than the older 2.13 version. So now let's make this newer and manually downloaded JMeter the new default on my machine.

First I moved the whole unpacked apache-jmeter directory into /usr/local/ as a more central and persistent directory:

ck@mint /tmp $ sudo mv apache-jmeter-5.6.3 /usr/local/

Then I used update-alternatives to overwrite the existing jmeter (/usr/bin/jmeter) symlink and point it to the new destination in /usr/local/:

ck@mint ~ $ sudo update-alternatives --install /usr/bin/jmeter jmeter /usr/local/apache-jmeter-5.6.3/bin/jmeter 1
update-alternatives: using /usr/local/apache-jmeter-5.6.3/bin/jmeter to provide /usr/bin/jmeter (jmeter) in auto mode

Verify that /usr/bin/jmeter now points to the new and manually installed JMeter:

ck@mint ~ $ update-alternatives --list jmeter
/usr/local/apache-jmeter-5.6.3/bin/jmeter

ck@mint ~ $ ls -la /usr/bin/jmeter
lrwxrwxrwx 1 root root 24 Apr 16 14:23 /usr/bin/jmeter -> /etc/alternatives/jmeter

ck@mint ~ $ ls -la /etc/alternatives/jmeter
lrwxrwxrwx 1 root root 41 Apr 16 14:23 /etc/alternatives/jmeter -> /usr/local/apache-jmeter-5.6.3/bin/jmeter

That seems to be correct.

Now I can start JMeter from the Linux Minut menu and the new 5.6.x version is opened straight away.


Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.

RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   OpenSearch   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder