Multiple simulations from Engine.scala

Hi,
I am running the gatling test from a jar file with the Engine.scala class as follows:

import com.excilys.ebi.gatling.app.Gatling
import com.excilys.ebi.gatling.core.config.GatlingPropertiesBuilder

object Engine extends App {

def runTest(testname:String){
val props = new GatlingPropertiesBuilder
props.dataDirectory(PathHelper.dataDirectory.toString)
props.resultsDirectory(PathHelper.resultsDirectory.toString)
props.requestBodiesDirectory(PathHelper.requestBodiesDirectory.toString)
props.binariesDirectory(PathHelper.mavenBinariesDirectory.toString)
props.clazz(testname)
Gatling.fromMap(props.build)
}
}

I wanted to create a main class that run the tests every single hour by using the ScheduledExecutorService class. The main problem is that every time I try to run more than one time the method runTest such as follows:

public class Main {

public static void main(final String[] args) {
String simulationClass1;
String simulationClass2;

Engine.runTest(simulationClass1);
Engine.runTest(simulationClass2)
}
}

of the class Engine it returns me the following error:

Exception in t**hread “main” akka.pattern.AskTimeoutException: sending to terminated ref breaks promises

at akka.pattern.AskSupport$class.ask(AskSupport.scala:76)
at akka.pattern.package$.ask(package.scala:43)
at akka.pattern.AskSupport$AskableActorRef.$qmark(AskSupport.scala:153)
at akka.actor.ActorSystemImpl.actorOf(ActorSystem.scala:513)
at com.excilys.ebi.gatling.core.action.builder.UserActionBuilder.build(UserActionBuilder.scala:35)
at com.excilys.ebi.gatling.core.structure.AbstractStructureBuilder$$anonfun$buildChainedActions$1.apply(AbstractStructureBuilder.scala:32)
at com.excilys.ebi.gatling.core.structure.AbstractStructureBuilder$$anonfun$buildChainedActions$1.apply(AbstractStructureBuilder.scala:31)
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:111)
at scala.collection.immutable.List.foldLeft(List.scala:76)
at com.excilys.ebi.gatling.core.structure.AbstractStructureBuilder.buildChainedActions(AbstractStructureBuilder.scala:31)
at com.excilys.ebi.gatling.core.structure.ScenarioBuilder.build(ScenarioBuilder.scala:53)
at com.excilys.ebi.gatling.core.scenario.configuration.ConfiguredScenarioBuilder.build(ConfiguredScenarioBuilder.scala:95)
at com.excilys.ebi.gatling.core.scenario.configuration.Simulation$$anonfun$scenarios$1.apply(Simulation.scala:26)
at com.excilys.ebi.gatling.core.scenario.configuration.Simulation$$anonfun$scenarios$1.apply(Simulation.scala:26)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:60)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:233)
at scala.collection.mutable.ArrayBuffer.map(ArrayBuffer.scala:47)
at com.excilys.ebi.gatling.core.scenario.configuration.Simulation$class.scenarios(Simulation.scala:26)
at scenarioTests.component.codpiece.Codpiece_CreateAndGetJob.scenarios(Codpiece_CreateAndGetJob.scala:15)
at com.excilys.ebi.gatling.core.runner.Runner.run(Runner.scala:44)
at com.excilys.ebi.gatling.app.Gatling$$anonfun$15.apply(Gatling.scala:102)
at com.excilys.ebi.gatling.app.Gatling$$anonfun$15.apply(Gatling.scala:94)
at scala.Option.getOrElse(Option.scala:108)
at com.excilys.ebi.gatling.app.Gatling.start(Gatling.scala:94)
at com.excilys.ebi.gatling.app.Gatling$.fromMap(Gatling.scala:54)
at Engine.runTest(Engine.scala:13)
at Main.main(Main.java:37)

It seems that the problem is that gatling use to shutdown the akka system…

The jar is packed in mvn via a pom.xml file mixing java and scala classes.

Any suggestion?

Do you need more infos?

Gatling architecture is currently intended for running in a dedicated process, ie JVM.