Build Error -- Caused by: java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce$class

Hi ,

I am getting below error while building GATLING.

Using below versions:

<scala.version>2.11.4</scala.version>
<gatling-maven-plugin.version>2.1.2</gatling-maven-plugin.version>
<gatling.version>2.1.4</gatling.version>
<scala-maven-plugin.version>3.1.6</scala-maven-plugin.version>

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50)
at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at sbt.compiler.RawCompiler.apply(RawCompiler.scala:26)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:147)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:142)
at sbt.IO$.withTemporaryDirectory(IO.scala:285)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:142)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:139)
at sbt.IO$.withTemporaryDirectory(IO.scala:285)
at sbt.compiler.AnalyzingCompiler$.compileSources(AnalyzingCompiler.scala:139)
at sbt.compiler.IC$.compileInterfaceJar(IncrementalCompiler.scala:33)
at com.typesafe.zinc.Compiler$.compilerInterface(Compiler.scala:148)
at com.typesafe.zinc.Compiler$.create(Compiler.scala:53)
at io.gatling.compiler.ZincCompiler$delayedInit$body.apply(ZincCompiler.scala:115)
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:71)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
at scala.App$class.main(App.scala:71)
at io.gatling.compiler.ZincCompiler$.main(ZincCompiler.scala:35)
at io.gatling.compiler.ZincCompiler.main(ZincCompiler.scala)
… 6 more
Caused by: java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce$class
at scala.reflect.io.AbstractFile.(AbstractFile.scala:91)
at scala.reflect.io.PlainFile.(PlainFile.scala:34)
at scala.reflect.io.AbstractFile$.getDirectory(AbstractFile.scala:47)
at scala.reflect.io.AbstractFile$.getDirectory(AbstractFile.scala:36)
at scala.tools.nsc.settings.MutableSettings$OutputDirs.setSingleOutput(MutableSettings.scala:269)
at scala.tools.nsc.settings.MutableSettings$OutputSetting.value_$eq(MutableSettings.scala:515)
at scala.tools.nsc.settings.MutableSettings$OutputSetting.(MutableSettings.scala:512)
at scala.tools.nsc.settings.MutableSettings.OutputSetting(MutableSettings.scala:221)
at scala.tools.nsc.settings.ScalaSettings$class.$init$(ScalaSettings.scala:64)
at scala.tools.nsc.settings.MutableSettings.(MutableSettings.scala:19)
at scala.tools.nsc.Settings.(Settings.scala:12)
at scala.tools.nsc.Driver.process(Driver.scala:39)
at scala.tools.nsc.Main.process(Main.scala)
… 31 more
Caused by: java.lang.ClassNotFoundException: scala.collection.GenTraversableOnce$class
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 44 more

  • Have you tried upgrading to 2.1.5?

  • How do you run Gatling? bundle? maven plugin? maven archetype? Jenkins? sbt?

  • What’s your OS? Windows? Linux?