Running Simulations from IDE

I was following this wiki to setup my Eclipse for running gatling simulation, however got the following exception when I ran Engine.scala as “Scala Application”

`
Exception in thread “main” java.lang.NoClassDefFoundError: 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 Engine$delayedInit$body.apply(Engine.scala:13)
at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:76)
at scala.App$$anonfun$main$1.apply(App.scala:76)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
at scala.App$class.main(App.scala:76)
at Engine$.main(Engine.scala:4)
at Engine.main(Engine.scala)
Caused by: java.lang.ClassNotFoundException: 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)
… 17 more

`

Am I missing something ? Note that my simulation scripts is in “src/test/scala”. It runs fine from command line when I use the following

`
mvn -Dgatling.simulationClass=MySimulationSimulation gatling:execute

`

Neil

My first guess : Either you are using an old Scala IDE which allows only one Scala version which is not the one’s Gatlings is using (Scala 2.10), or you’re using a newer Scala IDE, which defaults to Scala 2.11, which is not the one’s Gatling is using (not until Gatling 2.1).

Please check that your installation of Scala IDE is configured to use Scala 2.10.

Yes I do see the following error markers

Description Resource Path Location Type
akka-actor_2.10-2.3.6.jar is cross-compiled with an incompatible version of Scala (2.10). In case of errorneous report, this check can be disabled in the compiler preference page. blitz-lt Unknown Scala Classpath Problem
fastring_2.10-0.2.4.jar is cross-compiled with an incompatible version of Scala (2.10). In case of errorneous report, this check can be disabled in the compiler preference page. blitz-lt Unknown Scala Classpath Problem
scalalogging-slf4j_2.10-1.1.0.jar is cross-compiled with an incompatible version of Scala (2.10). In case of errorneous report, this check can be disabled in the compiler preference page. blitz-lt Unknown Scala Classpath Problem
jsonpath_2.10-0.6.1.jar is cross-compiled with an incompatible version of Scala (2.10). In case of errorneous report, this check can be disabled in the compiler preference page. blitz-lt Unknown Scala Classpath Problem
redisclient_2.10-2.13.jar is cross-compiled with an incompatible version of Scala (2.10). In case of errorneous report, this check can be disabled in the compiler preference page. blitz-lt Unknown Scala Classpath Problem
scopt_2.10-3.2.0.jar is cross-compiled with an incompatible version of Scala (2.10). In case of errorneous report, this check can be disabled in the compiler preference page. blitz-lt Unknown Scala Classpath Problem

Not sure what is the fix.

I got it fixed.

As Pierre said, I had to downgrade the scala version of the IDE. I removed the latest scala plugin from eclipse and installed the following

http://download.scala-ide.org/sdk/helium/e38/scala210/stable/site

Thanks
Neil