2

I created a Gatling load test using the highcharts archetype. I decided against just downloading the latest Gatling ZIP file and creating a simulation within the extracted folder since I rely on a number of dependencies in public and private Maven repositories.

I want to

  1. bundle my simulation and all its dependencies into a single JAR,
  2. distribute the JAR to multiple load generators in EC2/GCE, and
  3. start the test on all remote load generators.

Maven's assembly plugin looks like an obvious candidate to solve #1. So I added the following to my pom.xml:

<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <configuration>
    <archive>
      <manifest>
        <mainClass>io.gatling.app.Gatling</mainClass>
      </manifest>
    </archive>
    <descriptorRefs>
      <descriptorRef>jar-with-dependencies</descriptorRef>
    </descriptorRefs>
  </configuration>
</plugin>

With this configuration, running a JAR file created with mvn clean package assembly:single results in the following NoSuchFileException:

$ java -jar target/myapp-0.1-SNAPSHOT-jar-with-dependencies.jar
Exception in thread "main" java.nio.file.NoSuchFileException: ./target/test-classes
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:407)
at java.nio.file.Files.newDirectoryStream(Files.java:457)
at io.gatling.core.util.PathHelper$RichPath$.deepListAux$1(PathHelper.scala:99)
at io.gatling.core.util.PathHelper$RichPath$.deepList$extension(PathHelper.scala:105)
at io.gatling.core.util.PathHelper$RichPath$.deepFiles$extension(PathHelper.scala)
at io.gatling.app.classloader.SimulationClassLoader.simulationClasses(SimulationClassLoader.scala:55)
at io.gatling.app.Gatling.loadSimulations(Gatling.scala:92)
at io.gatling.app.Gatling.start(Gatling.scala:70)
at io.gatling.app.Gatling$.fromArgs(Gatling.scala:59)
at io.gatling.app.Gatling$.main(Gatling.scala:44)
at io.gatling.app.Gatling.main(Gatling.scala)
  • Is this how I should bundle up my Maven based Gatling project?
  • Have I misconfigured Gatling's Maven plugin at the time the JAR file is created?

Update 1:

Creating the target/test-classes directory gets around the NoSuchFileException. However, gatling then doesn't find any of my simulations. None of the *.scala files were added to JAR generated by the assembly plugin.

Ingo
  • 1,552
  • 10
  • 31
  • I have a similar problem http://stackoverflow.com/q/27893423/842860. What I did was moving all the files into the main folder. But then I got some other issues. – stackoverflower Jan 30 '15 at 14:43

0 Answers0