I'm trying to do something brain-dead simple: run a one-off gatling script in the current directory from the command-line. In that directory, I have a gatling.conf file, like so:
gatling {
core {
directory {
results = "./results" # Name of the folder where all reports folder are located
data = "." # Folder where user's data (e.g. files used by Feeders) is located
bodies = "." # Folder where bodies are located
simulations = "." # Folder where the bundle's simulations are located
binaries = "./target" # If set, name of the folder where compiles classes are located
}
}
}
import io.gatling.core.Predef._
import io.gatling.http.Predef._
class RegisterUsers extends Simulation {
val FORM_POST_URL = "form-post-url"
val httpConf = http.baseURL( "<path-to-application>" )
val process =
scenario( "Register Individual" )
.feed( tsv( "unregistered-individuals.txt" ) )
.exec( http( "Registration Page" )
.get( "/web/public/registration" )
.check( css( "form#form-info", "action" ).saveAs( FORM_POST_URL ) ) )
.exec( session => {
print( session(FORM_POST_URL).as[String] )
session
})
setUp( process.inject( atOnceUsers(1) ).protocols( httpConf ))
}
/data/software/gatling/bin/gatling.sh \
--simulation RegisterUsers
The output I get is:
GATLING_HOME is set to /data/software/gatling
Exception in thread "main" java.lang.NoClassDefFoundError: test-classes/RegisterUsers (wrong name: RegisterUsers)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at io.gatling.app.classloader.FileSystemBackedClassLoader.findClass(FileSystemBackedClassLoader.scala:71)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at io.gatling.app.classloader.SimulationClassLoader$$anonfun$simulationClasses$1.applyOrElse(SimulationClassLoader.scala:47)
at io.gatling.app.classloader.SimulationClassLoader$$anonfun$simulationClasses$1.applyOrElse(SimulationClassLoader.scala:47)
at scala.collection.immutable.List.collect(List.scala:295)
at io.gatling.app.classloader.SimulationClassLoader.simulationClasses(SimulationClassLoader.scala:47)
at io.gatling.app.Selection$Selector.loadSimulations(Selection.scala:61)
at io.gatling.app.Selection$Selector.selection(Selection.scala:39)
at io.gatling.app.Selection$.apply(Selection.scala:33)
at io.gatling.app.Gatling.runIfNecessary(Gatling.scala:73)
at io.gatling.app.Gatling.start(Gatling.scala:63)
at io.gatling.app.Gatling$.start(Gatling.scala:51)
at io.gatling.app.Gatling$.fromArgs(Gatling.scala:43)
at io.gatling.app.Gatling$.main(Gatling.scala:37)
at io.gatling.app.Gatling.main(Gatling.scala)
It appears to compile, because the target directory looks like this:
target
target/test-classes
target/test-classes/RegisterUsers.class
target/test-classes/RegisterUsers$$anonfun$1.class
target/zincCache
Any thoughts why Gatling can't load and execute my class?
--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.