I have written a simulation for load test. I’m trying to build it in maven.
However I get the following error:
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: java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)V
gatling-maven-plugin 3.0.0-M1 is a milestone for FrontLine users who already use next gen Gatling 3.
Don’t use it if you use Gatling OSS, stick to stable releases.
Sure. Thanks. I have changed the gatling-maven-plugin version to 2.2.4.
But now i come across a different error:
12:50:36.313 [main][WARN ][ZincCompiler.scala:141] i.g.c.ZincCompiler$ - Pruning sources from previous analysis, due to incompatible CompileSetup.
java.lang.ClassNotFoundException: io.gatling.app.Gatling
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:42)
at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33)
Please let me know if there are any leads to this kind of a compilation problem.
Just for the records (or for other users which run into this error): I had a similar problem every now and then, when running Gatling from IntelliJ. It turned out that I had a mixture of Scala versions in my classpath. In order to compile the Gatling classes I had added Scala 2.11 to IntelliJ. When upgrading to a newer Gatling version in Maven I had forgotten about this local IntelliJ configuration. The new Gatling version required Scala 2.12 and running from the IDE didn’t work any more.