java.lang.ClassNotFoundException: null

Hi
In a same envrionnement

I run a script with gatling 3.7.6 not error encountered

gatling.sh -s mysimulationname -rf mypathtoresults 

and Run it with gatling 3.8.2 and get the error below

gatling.sh -rm local -s mysimulationname -rf mypathtoresults 
Error: Could not find or load main class 
Caused by: java.lang.ClassNotFoundException: null

Any idea ?

Hi!

Can you provide basic information:

  • OS (windows, macOs, linux) and which flavor (version, distribution)
  • shell interpretor (bash, zsh, ksh, etc.)
  • java version and JAVA_HOME environment variable

Ensure that mysimulationname corresponds to the FQN (Fully Qualified Named) of you simulation.

Cheers!

Hi SĂ©bastien

OS : openjdk11:jre-11.0.11_9-alpine
Shell interpretor : bash
JAVA HOME : /opt/java/openjdk

mysimulationname i think is FQN , running from gatling 3.7.6 it works
Just switching version i got the error

Regards

MMmh… this is not an OS… I assume it’s your docker base image. Sadly, I cannot find this image.
I found a similar name: adoptopenjdk/openjdk11:jre-11.0.11_9-alpine does not contains bash and is a jre (need a jdk)

Cheers!

Yes that is the one with some custom ( adding bash … )

But is there a issue being a jre and not jdk ? knowing that it wokrs with gatling 3.7.6

I tested with the bundle that comes with a java project. So yes, the JDK is needed (as it tries to launch javac)

Cheers!

1 Like

You need a JDK to have javac as soon as you’re using Java code. Scala doesn’t need it.

1 Like

Hi
Sorry to respond so late

i tried with version of openjdk 17

This is what i get:

$JAVA_HOME : /opt/openjdk-17/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$JAVA_VERSION : /opt/openjdk-17
java --version :
openjdk 17-ea 2021-09-14
OpenJDK Runtime Environment (build 17-ea+14)
OpenJDK 64-Bit Server VM (build 17-ea+14, mixed mode, sharing)

Trying to run gatling.sh i get : gatling.sh: command not found

Hope you get enough info to help

Regards

Could you please try Gatling 3.8.3?

Also, your Java install is pretty bad.
-ea version stands for “Early Access”, see build - What the EA stands for in Java Version ? - Stack Overflow, so you’re using an unstable and buggy preview version.
You should really install a stable version: Java Download | Java 8, Java 11, Java 13 - Linux, Windows & macOS

Hi ,
Yes , i forgot to mentonned , it is with gatling 3.8.3

Can you please do a ls of /opt/openjdk-17/bin?

Are you sure you try to run gatling.sh from correct directory?

ls /opt/openjdk-17/bin :
jar
jarsigner
java
javac
javadoc
javap
jcmd
jconsole
jdb
jdeprscan
jdeps
jfr
jhsdb
jimage
jinfo
jlink
jmap
jmod
jpackage
jps
jrunscript
jshell
jstack
jstat
jstatd
keytool
rmid
rmiregistry
serialver

Yes i am and gatling.sh is there :blush:

You use Docker Container or what ?
I’m little confused because we don’t have full information “where and how” you try to run Gatling.
Without that we cannot try to reproduce this behavior what you shown.

Hi
Yes i am using a docker image , create from a docker file similar to this one (gatling/Dockerfile at master · ladamalina/gatling · GitHub)

Just changing the version of gatling ( 3.7.6,3.8.2,.3.8.3)
So having 3 identical images
< 3.8.2 are running perfectly , > 3.8.2 not able to run it

Regards

There’s nothing we can do with this Docker image, it’s a third party.
We can only help and investigate problems with pure Gatling official components.
If you can reproduce your issue with the Gatling bundle on a Linux box and provide a procedure, we’ll be able to help.
Otherwise, please directly reach out to this Docker image’s author.

Also, it would have saved a lot of time to everyone trying to help you if you had explained you were using a third party Docker image in the first place. That’s why we require a reproducer as explained here.

Hi
Sorry i forgot to mentionned indeed

but just to complete the info , when i run gatling without " -rm local " Gatling is showing me the possibilite to select :
[0]
[1] Run the Simulation locally
[2] Run the Simulation on Gatling Enterprise Cloud
[3] Package the Simulation for Gatling Enterprise

but running with “-rm local” i get the first error has explained

Error: Could not find or load main class 
Caused by: java.lang.ClassNotFoundException: null

Sorry for inconvenience

Can you reproduce with a freshly downloaded bundle on your local machine?