Recorded a simple simulation and ran the source file with SBT
SBT:
mainClass in (Compile, packageBin) := Some(“Main”)
libraryDependencies += “io.gatling.highcharts” % “gatling-charts-highcharts” % “2.0.3”
lazy val root = (project in file(".")).
settings(
name := “test”,
version := “1.0”,
scalaVersion := “2.10.4”
)
Source:
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
object Main {
def main(args: Array[String]) {
new RecordedSimulation
}
}
class RecordedSimulation extends Simulation {
val httpProtocol = http // NPE
}
Stacktrace
[error] (run-main-0) java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
at io.gatling.http.config.HttpProtocolBuilder$.(HttpProtocolBuilder.scala:38)
at io.gatling.http.config.HttpProtocolBuilder$.(HttpProtocolBuilder.scala)
at io.gatling.http.Predef$.http(Predef.scala:36)
at RecordedSimulation.(RecordedSimulation.scala:16)
at Main$.main(RecordedSimulation.scala:10)
at Main.main(RecordedSimulation.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
Caused by: java.lang.NullPointerException
at io.gatling.http.config.HttpProtocol$.(HttpProtocol.scala:48)
at io.gatling.http.config.HttpProtocol$.(HttpProtocol.scala)
at io.gatling.http.config.HttpProtocolBuilder$.(HttpProtocolBuilder.scala:38)
at io.gatling.http.config.HttpProtocolBuilder$.(HttpProtocolBuilder.scala)
at io.gatling.http.Predef$.http(Predef.scala:36)
at RecordedSimulation.(RecordedSimulation.scala:16)
at Main$.main(RecordedSimulation.scala:10)
at Main.main(RecordedSimulation.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)