Hi,
I’m getting java.lang.NoClassDefFoundError
exceptions when trying to run simulations from a JAR file using the Gatling runner:
gatling.bat -bf D:\work\testing\load\target\ -s load.simulation.ServiceTemplateSimulation
The simulation class itself is found, but there are errors resolving classes used inside the simulation:
java.lang.NoClassDefFoundError: load/config/SimulationConfig (wrong name: classes/load/config/SimulationConfig)
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at io.gatling.app.classloader.FileSystemBackedClassLoader.findClass(FileSystemBackedClassLoader.scala:76)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at io.gatling.app.classloader.SimulationClassLoader.$anonfun$simulationClasses$2(SimulationClassLoader.scala:48)
at scala.collection.immutable.List.map(List.scala:246)
at scala.collection.immutable.List.map(List.scala:79)
at io.gatling.app.classloader.SimulationClassLoader.simulationClasses(SimulationClassLoader.scala:48)
at io.gatling.app.Selection$Selector.$anonfun$selection$1(Selection.scala:47)
at scala.Option.getOrElse(Option.scala:201)
at io.gatling.app.Selection$Selector.selection(Selection.scala:42)
at io.gatling.app.Selection$.apply(Selection.scala:35)
at io.gatling.app.Runner.run(Runner.scala:53)
at io.gatling.app.Gatling$.start(Gatling.scala:92)
at io.gatling.app.Gatling$.fromArgs(Gatling.scala:54)
at io.gatling.app.Gatling$.main(Gatling.scala:42)
at io.gatling.app.Gatling.main(Gatling.scala)
SimulationConfig
is actually a Kotlin object
, so I suspect this might be related to some missing Kotlin runtime libraries? Are there any particular things to be aware of when packaging the simulations with Maven?
As far as I can tell this is not a duplicate of Example Kotlin test from gatling.io tutorial failing to be found at runtime – in my case I package the code myself using Maven with the “regular” Kotlin Maven plugin.
Thanks a lot,
m.