I get my code running correctly using maven on my local machine, example:
mvn gatling:execute -Dproperty1=value1
Once I build the fat-jar, I can’t get it running via this command:
java -DsimulationClass=simulations.ActualSimulationClass -Dproperty1=value1 -cp ske-test-gatling-0.0.1-SNAPSHOT-jar-with-dependencies.jar StartSimulation
and the StartSimulation class goes like this
import io.gatling.app.Gatling
import io.gatling.core.config.GatlingPropertiesBuilder
object Engine extends App {
val props = new GatlingPropertiesBuilder
props.dataDirectory(IDEPathHelper.dataDirectory.toString)
props.resultsDirectory(IDEPathHelper.resultsDirectory.toString)
props.bodiesDirectory(IDEPathHelper.bodiesDirectory.toString)
props.binariesDirectory(IDEPathHelper.mavenBinariesDirectory.toString)
Gatling.fromMap(props.build)
}
Here’s the full stack trace:
developer@sit1b046-3:~/workspace/mp-nav-inntekt-gatling/target$ Exception in thread “main” java.lang.NoClassDefFoundError: scala/Function0
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)
at java.lang.Class.getMethod0(Class.java:2856)
at java.lang.Class.getMethod(Class.java:1668)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: scala.Function0
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
… 6 more
could anybody help please?
Versions:
scala.version: 2.11.6
gatling.version: 2.1.7
gatling-maven-plugin.version: 2.1.7
scala-maven-plugin.version: 3.2.0
Amir