gatling-sbtNoClassDefFoundError

Hello all,

I did a small project to use gatling with sbt using the sbt plugin

can be found here https://gitlab.com/jlebleu/gatlingxuc

Always have a NoClassDefFondEffor, and I can find what is my mistake.

If anyboday has an idea ?
Thanks

Here is the trace

[error] Uncaught exception when running computerdatabase.BasicSimulation: java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce$class
sbt.ForkMain$ForkError: scala/collection/GenTraversableOnce$class
at com.dongxiguo.fastring.Fastring.(Fastring.scala:25)
at io.gatling.core.util.StringHelper$$anon$1.(StringHelper.scala:53)
at io.gatling.core.util.StringHelper$.(StringHelper.scala:53)
at io.gatling.core.util.StringHelper$.(StringHelper.scala)
at io.gatling.core.config.GatlingConfiguration$.mapToGatlingConfig(GatlingConfiguration.scala:134)
at io.gatling.core.config.GatlingConfiguration$.setUp(GatlingConfiguration.scala:128)
at io.gatling.app.Gatling$.fromMap(Gatling.scala:54)
at io.gatling.app.Gatling$.runGatling(Gatling.scala:80)
at io.gatling.sbt.GatlingTask.liftedTree1$1(GatlingTask.scala:34)
at io.gatling.sbt.GatlingTask.execute(GatlingTask.scala:33)
at sbt.ForkMain$Run$2.call(ForkMain.java:294)
at sbt.ForkMain$Run$2.call(ForkMain.java:284)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: sbt.ForkMain$ForkError: scala.collection.GenTraversableOnce$class
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)
at com.dongxiguo.fastring.Fastring.(Fastring.scala:25)
at io.gatling.core.util.StringHelper$$anon$1.(StringHelper.scala:53)
at io.gatling.core.util.StringHelper$.(StringHelper.scala:53)
at io.gatling.core.util.StringHelper$.(StringHelper.scala)
at io.gatling.core.config.GatlingConfiguration$.mapToGatlingConfig(GatlingConfiguration.scala:134)
at io.gatling.core.config.GatlingConfiguration$.setUp(GatlingConfiguration.scala:128)
at io.gatling.app.Gatling$.fromMap(Gatling.scala:54)
at io.gatling.app.Gatling$.runGatling(Gatling.scala:80)
at io.gatling.sbt.GatlingTask.liftedTree1$1(GatlingTask.scala:34)
at io.gatling.sbt.GatlingTask.execute(GatlingTask.scala:33)
at sbt.ForkMain$Run$2.call(ForkMain.java:294)
at sbt.ForkMain$Run$2.call(ForkMain.java:284)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

Hi Jean-Yves,

That is your mistake : https://gitlab.com/jlebleu/gatlingxuc/blob/master/project/Dependencies.scala#L22
Gatling currently relies and is not cross-compiled (due to your our current use and integration of Zinc, SBT’s incremental compiler). Having both scala-library for 2.10 and 2.11 in the classpath is sure to cause issues like that.
Set your scalaVersion to “2.10.4” and it should work as expected.

Cheers,

Pierre

Hi Pierre,

Thank you very much !!!
Working now … as expected.
Rgds.
Jean-Yves