I’m trying to use gatling-maven-plugin and play-json_2.12 together.
And there is following error on launching gatling:execute with maven:
error: error while loading Throwable, class file ‘C:\java\jre\lib\rt.jar(java/lang/Throwable.class)’ is broken
(class java.util.NoSuchElementException/key not found: Throwable$PrintStreamOrWriter.class)
error: error while loading String, class file ‘C:\java\jre\lib\rt.jar(java/lang/String.class)’ is broken
(class java.util.NoSuchElementException/key not found: String$CaseInsensitiveComparator.class)
two errors found
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:498)
at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50)
at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33)
Caused by: Error compiling sbt component ‘compiler-interface’
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:158)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:155)
at sbt.IO$.withTemporaryDirectory(IO.scala:358)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:155)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:152)
at sbt.IO$.withTemporaryDirectory(IO.scala:358)
at sbt.compiler.AnalyzingCompiler$.compileSources(AnalyzingCompiler.scala:152)
at sbt.compiler.IC$.compileInterfaceJar(IncrementalCompiler.scala:58)
at com.typesafe.zinc.Compiler$.compilerInterface(Compiler.scala:154)
at com.typesafe.zinc.Compiler$.create(Compiler.scala:55)
at io.gatling.compiler.ZincCompiler$delayedInit$body.apply(ZincCompiler.scala:147)
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:36)
at io.gatling.compiler.ZincCompiler.main(ZincCompiler.scala)
… 6 more
Here’s what my pom.xml looks like:
`
<?xml version="1.0" encoding="UTF-8"?>
4.0.0
I’ve tried previous version of Gatling together with play-json_2.11, but it gave errors as well.
However if I launch the same gatling scenario (which is using play-json) with following code, it runs without any problems:
`
import io.gatling.app.Gatling
import io.gatling.core.config.GatlingPropertiesBuilder
//Use this file to debug stuff with breakpoints
object DebugEntry {
def main(args: Array[String]) {
// This sets the class for the Simulation we want to run.
val simClass = classOf[TestScen].getName
val props = new GatlingPropertiesBuilder
props.simulationClass(simClass)
Gatling.fromMap(props.build)
}
}
`
Any idea, is it possible to make it work with maven?