Setting up development environment

Hi,

I’m beginning to use Gatling and I would like to use Gatling in Eclipse but I’m having difficulties to setting up my development environment.

I was able to download Scala IDE and install mvn2 plugin but the next step is causing problems.

“Once every software is installed, you can import Gatling project into Eclipse. Doing so is really easy:”
What project is this referring to?

“Gatling is made to run as a standalone program, thus most users will want to download a tarball containing all the binaries required to execute Gatling.”
Where can I download the tarball?

Then there is “Installing the Maven Archetype” at IDE integration"
How I’m actually installing the archetype?

Hi,

You’re actually reading the page for developing Gatling and installing Gatling sources.

In your case, what you want is to generate a project from the Gatling maven archetype:
https://github.com/excilys/gatling/wiki/Ide-integration

Once you’re done: New > Project > Maven Project > Next > search for gatling

Thanks for the quick answer.

I fond this blog post http://blog.roddet.com/2012/05/gatling-integration-maven-eclipse/ and I was able to generate a sample maven Gatling project… But my project structure is different. Recorder class is not under src/main but src/test and when I try to run it as a Scala application I get an error:

Exception in thread “main” java.lang.NoClassDefFoundError: scala/reflect/ClassManifest

Caused by: java.lang.ClassNotFoundException: scala.reflect.ClassManifest

maanantai, 16. joulukuuta 2013 15.34.33 UTC+2 Henri Lämsä kirjoitti:

Which version of Gatling do you use, and which version of Scala/Scala IDE?
As stated on all the wiki pages, instructions are for Gatling 1 and have to be adapted for Gatling 2.

Gatling 1: Scala 2.9
Gatling 2: Scala 2.10
=> make sure to pick the proper Scala IDE version to match your Gatling version

Thanks again for helping me out.

Yes, I guess that was the problem. I assumed I was using version 2.0+ of Gatling but now I see it is under development. I downloaded Eclipse Indigo and
update package for Scala from http://scala-ide.org/download/current.html. It was a package containing plugin and features folders and couple of jar files. I assumed I should copy them to my Eclipse root folder but I still can’t run Scala programs with the Eclipse. Something went wrong there but that is another problem I think I will be able to solve by myself but I will leave that for tomorrow. So thanks a lot for help :slight_smile:

maanantai, 16. joulukuuta 2013 16.00.42 UTC+2 Stéphane Landelle kirjoitti:

Hi Henri!
You could always go the Gradle route, I found it simplified things massively for me. This is what my build.gradle file looks like (developing against 2.0.0 snapshots)

apply plugin: ‘scala’

repositories {
mavenCentral()
maven {
url ‘https://oss.sonatype.org/content/repositories/snapshots
}
}

dependencies {
compile ‘org.scala-lang:scala-library:2.10.3’
compile ‘io.gatling.highcharts:gatling-charts-highcharts:2.0.0-SNAPSHOT’
}

task gatling(type: JavaExec, dependsOn: ‘compileScala’) {

project.ext.runtimeArgs = [’-sbf’, sourceSets.main.output.classesDir, ‘-rf’, ‘build/reports/gatling’,’-bf’,‘src/main/resources/request-bodies’]

if (project.hasProperty(“simulationClass”)) {
project.ext.runtimeArgs.add("-s")
project.ext.runtimeArgs.add(simulationClass)
} else {
throw new InvalidUserDataException("-PsimulationClass property unset")
}

args = project.ext.runtimeArgs.toList()
classpath sourceSets.main.runtimeClasspath
classpath sourceSets.main.output
classpath configurations.runtime

main = ‘io.gatling.app.Gatling’
}

If I were you I’d go with the intellij community edition. Works smoothly. Great scala plugin. Generate a skeleton project using the archetype plugin, and open pom.xml. That’s about it.

Is there any ‘howto’ or something similar how to setup my development environment (especially for 2.0.0-SNAPSHOT)? I’ve already gatling 2.0.0-M3a up&running but I’m unable to do it with the snapshot builds. So what should I do if I want to switch from M3a to 2.0.0-SNAPSHOT?

greetings
Niko

If you have a maven project (or gradle, or whatever) and want it to use snapshots, you have to add the Sonatype snapshot repository:
https://oss.sonatype.org/content/repositories/snapshots

sonatype-snapshots Sonatype snapshots [https://oss.sonatype.org/content/repositories/snapshots](https://oss.sonatype.org/content/repositories/snapshots) false true

Niko, I highly recommend you use Gradle as your build tool, I posted an example in the list using the snapshots repo not too long ago.

Changed it to sonatype but now I’ll get

mvn clean install
[INFO] Scanning for projects…
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building gatling 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for io.gatling.net.sf.saxon:Saxon-HE:jar:9.5.1-2 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.630s
[INFO] Finished at: Wed Dec 18 11:24:12 CET 2013
[INFO] Final Memory: 6M/240M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project gatling: Could not resolve dependencies for project com.openexchange.test.performance:gatling:jar:1.0.0-SNAPSHOT: Failure to find io.gatling.net.sf.saxon:Saxon-HE:jar:9.5.1-2 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced → [Help 1]

@Janni, my first choice is maven but I’ll also have a look at gradle. Na’se kala :slight_smile:

Niko, no probs :wink:
It’s not looking at the right repo for the artifact dependency. I would attempt to run mvn with the -U option to force it to force it to update snapshots.

Exactly: there’s an old snapshot in your local repo that was fetched in the last 24h from Cloudbees I guess. You have to run with -U to force the update.

Changed the repo in the pom.xml and tada the next exception :frowning:

[ERROR] [12/18/2013 14:00:39.405] [GatlingSystem-akka.actor.default-dispatcher-9] [akka://GatlingSystem/user/$a] io.gatling.metrics.GraphiteDataWriter
java.lang.ClassNotFoundException: io.gatling.metrics.GraphiteDataWriter
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at io.gatling.core.result.writer.DataWriter$$anonfun$1.apply(DataWriter.scala:45)
at io.gatling.core.result.writer.DataWriter$$anonfun$1.apply(DataWriter.scala:44)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.mutable.ArraySeq.foreach(ArraySeq.scala:73)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at io.gatling.core.result.writer.DataWriter$.init(DataWriter.scala:44)
at io.gatling.core.controller.Controller$$anonfun$1.applyOrElse(Controller.scala:86)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498)
at akka.actor.ActorCell.invoke(ActorCell.scala:456)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237)
at akka.dispatch.Mailbox.run(Mailbox.scala:219)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

Maven projects are completely new to me…

Sorry found the reason… comment out once again:

data {
#writers = “console, file, graphite”
#reader = file

and everything works fine. Thank you very much and sorry for the noise :slight_smile:

Hi!

Thanks for the suggestion but Gradle doesn’t ring any bells to me and right now I don’t have that much time to familiarize myself with it. But I got Eclipse working now with Scala plugin. I just screwed up my previous installation. All good now. I can run Recorder also :slight_smile:

tiistai, 17. joulukuuta 2013 11.51.02 UTC+2 Ioannis Mavroukakis kirjoitti:

I got Eclipse working now and I’m already used to work with Eclipse so I will stick with it for now. Thanks for the help.

keskiviikko, 18. joulukuuta 2013 0.56.18 UTC+2 Stefan Magnus Landrø kirjoitti:

Hey Guys,

I have pulled this project GitHub - RallySoftware/gatling-with-gradle and have installed scala-IDE for eclipse and gradle plugins for Eclipse Luna version.
I have updated all Gatling dependencies also but still my eclipse not able to recognize “Simulation” etc Gatling specific DSL and build is failing with error

  • What went wrong:
    Cannot infer Groovy class path because no Groovy Jar was found on class path: configuration ‘:compile’

Please have a look at attached build.gradle and logs file for more info.

dependencies {
compile (‘commons-collections:commons-collections:3.2’)
compile (‘org.scala-lang:scala-library:2.11.8’)
compile (‘org.scala-lang:scala-compiler:2.11.8’)
compile (‘io.gatling:gatling-core:2.2.0’)
compile (‘io.gatling:gatling-app:2.2.0’)
compile (‘io.gatling.highcharts:gatling-charts-highcharts:2.2.0’)
}

Please help me.

Thanks,
Swapnil.

build.gradle (1.46 KB)

logs.txt (11.9 KB)

  • You’d better not highjack an old thread
  • The repository you mention has been updated for more than 2 years and it targets Gatling 1
  • Beware that we don’t officially support Gradle. Yet, there’s a community plugin in the third parties section in our documentation.