[gatling jenkins plugin] Build error

Hi,
I cloned the gatling jenkins plugin and I have the following build error :

[ERROR] COMPILATION ERROR :[INFO] -------------------------------------------------------------
[ERROR] error: Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider org.kohsuke.stapler.jsr269.ExportedBeanAnnotationProcessor could not be instantiated: java.lang.NoClassDefFoundError: com/google/common/collect/Multimap[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

My config :
java version “1.6.0_24”
OpenJDK Runtime Environment (IcedTea6 1.11.5) (6b24-1.11.5-0ubuntu1~10.04.2)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Apache Maven 2.2.1 (rdebian-1)

I tried a mvn clean package from CLI and Intellij.

As you said on Twitter, it might be worth trying to build with maven3.
The error is experience happens Jenkins code, not Gatling.

Cheers,

Stéphane

Yep, works better with Maven3.

I got a test failed :

Tests in error:
initializationError(InjectedTest): com.sun.jna.Native.open(Ljava/lang/String;)JTests
run: 1, Failures: 0, Errors: 1, Skipped: 0

So i skipped tests to have a binary :slight_smile:

Just installed on Jenkins 1.489 so now I’m gonna try it :smiley:

thx

The last error you get looks like a JDK bug.

It seems to be a JDK bug, because the Jenkins plugin builds fine (no test failed) with Oracle JDK (1.6.0_37).

I’m moving on :slight_smile:

new problem :

 Embedded error: More than 1 simulation to run, need to specify one

Even if I specify  -Dgatling.simulations=it.preprod.Mobile2Simulation 

or in the pom.xml :
<configuration>
<simulations>it.preprod.Mobile2Simulation</simulations>
<runName>run_xxx</runName>
</configuration>

Gatling can no longer multiple simulations sequentially, so this option has been renamed from simulations to simulation.

Not sure if this properly documented/announced though.

ok, I fixed it using instead of .

Now :

Is your simulation in src/main/resources/simulations/ ?

the exact path of my simulation is src/main/resources/simulations/it/preprod

I tested the Maven plugin, if you :

1/ Have the correct path for your simulations
2/ Set the fully qualified name (maybe a typo ?) in the tag

The Maven plugin should be able to run your simulation.

Did you try to run it with Maven or with Jenkins only ?

I first tried in jenkins then reproduced with maven locally.
So now I’m testing locally.

I tried the https://github.com/nhuray/gatling-maven-project (which uses gatling 1.2.5) locally and it works.
Now I’m trying to make this demo project work with last gatling 1.3.4 (always with local maven). It does not compile with gatling 1.3.4.

I add that with gatling 1.2.5 my job is successful.

What was your compilation error with Gatling 1.3.4 ?

The one I gave before :

[INFO] Exception in thread “main” java.lang.ClassNotFoundException: MySimulation
[INFO] at scala.tools.nsc.interpreter.AbstractFileClassLoader.findClass(AbstractFileClassLoader.scala:51)
[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
[INFO] at scala.tools.nsc.interpreter.AbstractFileClassLoader.scala$tools$nsc$util$ScalaClassLoader$$super$loadClass(AbstractFileClassLoader.scala:17)
[INFO] at scala.tools.nsc.util.ScalaClassLoader$class.loadClass(ScalaClassLoader.scala:50)
[INFO] at scala.tools.nsc.interpreter.AbstractFileClassLoader.loadClass(AbstractFileClassLoader.scala:17)
[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
[INFO] at com.excilys.ebi.gatling.app.FileSystemBackedSimulationClassLoader$$anonfun$3.apply(SimulationClassLoader.scala:73)
[INFO] at com.excilys.ebi.gatling.app.FileSystemBackedSimulationClassLoader$$anonfun$3.apply(SimulationClassLoader.scala:73)
[INFO] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
[INFO] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
[INFO] at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
[INFO] at scala.collection.immutable.List.foreach(List.scala:76)
[INFO] at scala.collection.TraversableLike$class.map(TraversableLike.scala:233)
[INFO] at scala.collection.immutable.List.map(List.scala:76)
[INFO] at com.excilys.ebi.gatling.app.FileSystemBackedSimulationClassLoader.simulationClasses(SimulationClassLoader.scala:73)
[INFO] at com.excilys.ebi.gatling.app.Gatling$$anonfun$10.apply(Gatling.scala:83)
[INFO] at com.excilys.ebi.gatling.app.Gatling$$anonfun$10.apply(Gatling.scala:78)
[INFO] at scala.Option.getOrElse(Option.scala:108)
[INFO] at com.excilys.ebi.gatling.app.Gatling.start(Gatling.scala:78)
[INFO] at com.excilys.ebi.gatling.app.Gatling$.fromMap(Gatling.scala:66)
[INFO] at com.excilys.ebi.gatling.app.Gatling$.main(Gatling.scala:61)
[INFO] at com.excilys.ebi.gatling.app.Gatling.main(Gatling.scala)

Can you email me your simulation and pom.xml ? It’s difficult to see exactly where the problem is without having a look at the simulation.

I think there is an issue with my whole project.

I copyed-pasted my simulation in the gatling-maven-project and successfully built it with gatling 1.3.4.
So I think I’m gonna reset (delete and recreate) my whole project.

Thank for your help :wink:

So I finally have a successful jenkins build.
I just have to handle the result publisher to be fully happy :slight_smile:

I thought I could use a same job with different profiles to launch different silmulations but maybe it’s not the best way to do it.

What’s your advice on this? One jenkins job => One simulation?
Any advice on parametrizing the jobs/simulations?

Currently, 1 Jenkins job = 1 simulation, due to some limitations of the Maven plugin, so you don’t have a choice here…
You’ll have to create a new job for each simulation you want to run, but you can make your simulations jobs depends on the main project, so that the simulations are run after the main project is built.
You can also chain your simulations jobs (one simulation job depends on the main project, the others depends on a another simulation job), like that :

Main project ← simulation job ← simulation job ← … ← simulation job

Doing that, a job will only be started if the previous one is marked stable. You also avoid running concurrently multiple simulations.

You can use Jenkins’ Parametrized Trigger plugin to do the chaining.

I found a way to reproduce my issue :

git clone https://github.com/nhuray/gatling-maven-project.git

update pom.xml to use 1.3.4
update the code of BasicExampleSimulation to compile (I removed the last if).

launch the mvn gatling:execute -Dgatling.simulations=basic.BasicExampleSimulation
=>
it works.

Now duplicate the BasicExampleSimulation, rename it as MySimulation for example.
launch the mvn gatling:execute -Dgatling.simulations=basic.MySimulation

=>

INFO] Exception in thread “main” java.lang.ClassNotFoundException: basic.MySimulation
[INFO] at scala.tools.nsc.interpreter.AbstractFileClassLoader.findClass(AbstractFileClassLoader.scala:51)
[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
[INFO] at scala.tools.nsc.interpreter.AbstractFileClassLoader.scala$tools$nsc$util$ScalaClassLoader$$super$loadClass(AbstractFileClassLoader.scala:17)
[INFO] at scala.tools.nsc.util.ScalaClassLoader$class.loadClass(ScalaClassLoader.scala:50)
[INFO] at scala.tools.nsc.interpreter.AbstractFileClassLoader.loadClass(AbstractFileClassLoader.scala:17)
[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
[INFO] at com.excilys.ebi.gatling.app.FileSystemBackedSimulationClassLoader$$anonfun$3.apply(SimulationClassLoader.scala:73)
[INFO] at com.excilys.ebi.gatling.app.FileSystemBackedSimulationClassLoader$$anonfun$3.apply(SimulationClassLoader.scala:73)
[INFO] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
[INFO] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
[INFO] at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
[INFO] at scala.collection.immutable.List.foreach(List.scala:76)
[INFO] at scala.collection.TraversableLike$class.map(TraversableLike.scala:233)
[INFO] at scala.collection.immutable.List.map(List.scala:76)
[INFO] at com.excilys.ebi.gatling.app.FileSystemBackedSimulationClassLoader.simulationClasses(SimulationClassLoader.scala:73)
[INFO] at com.excilys.ebi.gatling.app.Gatling$$anonfun$10.apply(Gatling.scala:83)
[INFO] at com.excilys.ebi.gatling.app.Gatling$$anonfun$10.apply(Gatling.scala:78)
[INFO] at scala.Option.getOrElse(Option.scala:108)
[INFO] at com.excilys.ebi.gatling.app.Gatling.start(Gatling.scala:78)
[INFO] at com.excilys.ebi.gatling.app.Gatling$.fromMap(Gatling.scala:66)
[INFO] at com.excilys.ebi.gatling.app.Gatling$.main(Gatling.scala:61)
[INFO] at com.excilys.ebi.gatling.app.Gatling.main(Gatling.scala)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------

I don’t get what the problem could be (but it’s really annoying).