Unexpected exception when using proxy

Using Gatling 2.1.7, running Fiddler2 as a proxy on localhost. The following minimal script fails:

`

class Test extends Simulation {

object Query {
val request= exec(http(“My Request”).get("/"))

}

val httpConf = http
.baseURL(“http://google.com”)
.proxy(Proxy(“localhost”, 8888))
.userAgentHeader(“Gradle TEST”)

val ptos = scenario(“PTOer”).exec(Query.request)

setUp(
ptos.inject(rampUsers(10) over (10 seconds))
).protocols(httpConf)
}

`

…with the following error:

`

12:50:04.352 [ERROR] i.g.c.a.UserEnd - Actor io.gatling.core.action.UserEnd@9ef378 crashed on message Some(Session(PTOer,8177268339714670142-9,Map(gatling.http.cache.redirects → io.gatling.core.util.
cache.Cache@a17bb3, gatling.http.cookies → CookieJar(Map(CookieKey(pref,google.com,/) → StoredCookie(PREF=ID=1111111111111111:FF=0:TM=1438858204:LM=1438858204:V=1:S=HK9NNRJmskC3_ose; domain=.google.
com; path=/; maxAge=63072000s,false,true,1438858204350), CookieKey(nid,google.com,/) → StoredCookie(NID=70=uA7mp5NnmwNvRmkeZnCY1VEe493GSYDg0q5YUzxF_E3ytDFXpuZxkErfu-IGFfHLIktQMW_RiPOicKuSxrPd11Y5D7Ir
QSwuXquFeN98oURxVV0Zfnd8OTy8VHvmL-dF; domain=.google.com; path=/; maxAge=15811200s; HTTPOnly,false,true,1438858204350))), gatling.http.referer → http://www.google.com/),1438858204195,1,OK,List(),))
java.lang.ClassCastException: com.ning.http.client.ConnectionPoolPartitioning$ProxyPartitionKey cannot be cast to java.lang.String
at io.gatling.http.config.HttpProtocol$$anon$1.select(HttpProtocol.scala:178) ~[gatling-http-2.1.7.jar:2.1.7]
at com.ning.http.client.providers.netty.channel.pool.DefaultChannelPool.flushPartitions(DefaultChannelPool.java:325) ~[async-http-client-1.9.30.jar:na]
at com.ning.http.client.providers.netty.channel.ChannelManager.flushPartitions(ChannelManager.java:486) ~[async-http-client-1.9.30.jar:na]
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.flushChannelPoolPartitions(NettyAsyncHttpProvider.java:99) ~[async-http-client-1.9.30.jar:na]
at io.gatling.http.config.HttpProtocol.userEnd(HttpProtocol.scala:174) ~[gatling-http-2.1.7.jar:2.1.7]
at io.gatling.core.config.Protocols$$anonfun$1$$anonfun$apply$1.apply(Protocols.scala:46) ~[gatling-core-2.1.7.jar:2.1.7]
at io.gatling.core.config.Protocols$$anonfun$1$$anonfun$apply$1.apply(Protocols.scala:46) ~[gatling-core-2.1.7.jar:2.1.7]
at scala.collection.Iterator$class.foreach(Iterator.scala:742) ~[scala-library-2.11.7.jar:na]
at scala.collection.AbstractIterator.foreach(Iterator.scala:1194) ~[scala-library-2.11.7.jar:na]
at scala.collection.MapLike$DefaultValuesIterable.foreach(MapLike.scala:206) ~[scala-library-2.11.7.jar:na]
at io.gatling.core.config.Protocols$$anonfun$1.apply(Protocols.scala:46) ~[gatling-core-2.1.7.jar:2.1.7]
at io.gatling.core.config.Protocols$$anonfun$1.apply(Protocols.scala:46) ~[gatling-core-2.1.7.jar:2.1.7]
at io.gatling.core.session.Session.terminate(Session.scala:216) ~[gatling-core-2.1.7.jar:2.1.7]
at io.gatling.core.action.UserEnd.execute(UserEnd.scala:45) ~[gatling-core-2.1.7.jar:2.1.7]
at io.gatling.core.action.Action$$anonfun$receive$1.applyOrElse(Actions.scala:29) ~[gatling-core-2.1.7.jar:2.1.7]
at akka.actor.Actor$class.aroundReceive(Actor.scala:467) ~[akka-actor_2.11-2.3.12.jar:na]
at io.gatling.core.akka.BaseActor.aroundReceive(BaseActor.scala:22) ~[gatling-core-2.1.7.jar:2.1.7]
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) ~[akka-actor_2.11-2.3.12.jar:na]
at akka.actor.ActorCell.invoke(ActorCell.scala:487) ~[akka-actor_2.11-2.3.12.jar:na]
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) ~[akka-actor_2.11-2.3.12.jar:na]
at akka.dispatch.Mailbox.run(Mailbox.scala:220) ~[akka-actor_2.11-2.3.12.jar:na]
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397) [akka-actor_2.11-2.3.12.jar:na]
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [scala-library-2.11.7.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [scala-library-2.11.7.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [scala-library-2.11.7.jar:na]
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [scala-library-2.11.7.jar:na]

`

I can see from the proxy logs that the request and response was successful.

Commenting out .proxy(Proxy(“localhost”, 8888*))* resolves the problem.

Does anyone have any idea how to fix it? Using a proxy is very convenient during development of the tests.

A bug indeed, thanks for reporting.

Note that I think it only happens when you share the connection pool amongst virtual users.

I am pretty unfamiliar with Gatling, but most examples I have seen use the same bootstrapping as my example.

I was not aware that I was doing connection pool sharing.

How would I run the simulation without sharing the connection pool? Is it simply to ramp max one user?

Thanks
Karl Ivar

Connection sharing isn’t the default.
I thought it would only happen then, but I could be wrong.

Same error here, without doing anything fancy with the connection pools; starting from sbt plugin though.
Was an issue raised about this bug yet?

https://github.com/gatling/gatling/commit/89a4e622675b012dc5937f6ae31d96c61605dffb

I am still seeing this error using Galting 2.1.7. Is there some other change I need to make?

Try 2.2.0-SNAPSHOT.

You mean 2.2.0-M3? I updated my pom and chagned the version 2.2.0-M3 on charts-highcharts, app and recorder libs. I am also using scala version 2.11.4.

The issus is that IJ is flagging errors in the gatling-app recorder. The errors are:

  1. core:2.2.0-M3 lib

Damn, I was not finished. Let me try again.

You mean 2.2.0-M3? I updated my pom and chagned the version 2.2.0-M3 on charts-highcharts, app and recorder libs. I am also using scala version 2.11.4.

The issus is that IJ is flagging errors in the gatling-app recorder. The errors are:

  1. core:2.2.0-M3 lib
  2. reddis:2.2.0-M3 lib

Can’t resolve the dependencies, do I have the correct versions of gatling?

Thanks!
-Gary

I wrote 2.2.0-SNAPSHOT so I meant 2.2.0-SNAPSHOT, not 2.2.0-M3. See download page.

OK, so I went back to 2.2.0-SNAPSHOT and ran into some issues. I was able to get them resolved but I have not been able to get the gatling-maven-plugin to work. I am getting this error:

error: java.lang.NoClassDefFoundError: scala/reflect/internal/AnnotationInfos$ErroneousAnnotation$
at scala.tools.nsc.typechecker.Typers$class.newTyper(Typers.scala:100)
at scala.tools.nsc.Global$$anon$1.newTyper(Global.scala:463)
at scala.tools.nsc.typechecker.Namers$Namer.(Namers.scala:58)
at scala.tools.nsc.typechecker.Namers$NormalNamer.(Namers.scala:50)
at scala.tools.nsc.typechecker.Namers$class.newNamer(Namers.scala:51)
at scala.tools.nsc.Global$$anon$1.newNamer(Global.scala:463)
at scala.tools.nsc.typechecker.Analyzer$namerFactory$$anon$1.apply(Analyzer.scala:43)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:441)
at scala.tools.nsc.Global$GlobalPhase.withCurrentUnit(Global.scala:432)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:441)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:399)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:399)
at scala.collection.Iterator$class.foreach(Iterator.scala:743)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1195)
at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:399)
at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1500)
at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1487)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:1482)
at scala.tools.nsc.Global$Run.compile(Global.scala:1580)
at scala.tools.nsc.Driver.doCompile(Driver.scala:32)
at scala.tools.nsc.MainClass.doCompile(Main.scala:23)
at scala.tools.nsc.Driver.process(Driver.scala:51)
at scala.tools.nsc.Main.process(Main.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:483)
at sbt.compiler.RawCompiler.apply(RawCompiler.scala:26)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:146)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:142)
at sbt.IO$.withTemporaryDirectory(IO.scala:291)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:142)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:139)
at sbt.IO$.withTemporaryDirectory(IO.scala:291)
at sbt.compiler.AnalyzingCompiler$.compileSources(AnalyzingCompiler.scala:139)
at sbt.compiler.IC$.compileInterfaceJar(IncrementalCompiler.scala:58)
at com.typesafe.zinc.Compiler$.compilerInterface(Compiler.scala:148)
at com.typesafe.zinc.Compiler$.create(Compiler.scala:53)
at io.gatling.compiler.ZincCompiler$delayedInit$body.apply(ZincCompiler.scala:148)
at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
at scala.App$class.main(App.scala:71)
at io.gatling.compiler.ZincCompiler$.main(ZincCompiler.scala:36)
at io.gatling.compiler.ZincCompiler.main(ZincCompiler.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:483)
at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50)
at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33)
Caused by: java.lang.ClassNotFoundException: scala.reflect.internal.AnnotationInfos$ErroneousAnnotation$
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 54 more
java.lang.reflect.InvocationTargetException
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:483)
at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50)
at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33)
Caused by: java.lang.reflect.InvocationTargetException
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:483)
at sbt.compiler.RawCompiler.apply(RawCompiler.scala:26)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:146)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:142)
at sbt.IO$.withTemporaryDirectory(IO.scala:291)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:142)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:139)
at sbt.IO$.withTemporaryDirectory(IO.scala:291)
at sbt.compiler.AnalyzingCompiler$.compileSources(AnalyzingCompiler.scala:139)
at sbt.compiler.IC$.compileInterfaceJar(IncrementalCompiler.scala:58)
at com.typesafe.zinc.Compiler$.compilerInterface(Compiler.scala:148)
at com.typesafe.zinc.Compiler$.create(Compiler.scala:53)
at io.gatling.compiler.ZincCompiler$delayedInit$body.apply(ZincCompiler.scala:148)
at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
at scala.App$class.main(App.scala:71)
at io.gatling.compiler.ZincCompiler$.main(ZincCompiler.scala:36)
at io.gatling.compiler.ZincCompiler.main(ZincCompiler.scala)
… 6 more
Caused by: java.lang.NoClassDefFoundError: scala/reflect/internal/AnnotationInfos$ErroneousAnnotation$
at scala.tools.nsc.typechecker.Typers$class.newTyper(Typers.scala:100)
at scala.tools.nsc.Global$$anon$1.newTyper(Global.scala:463)
at scala.tools.nsc.typechecker.Namers$Namer.(Namers.scala:58)
at scala.tools.nsc.typechecker.Namers$NormalNamer.(Namers.scala:50)
at scala.tools.nsc.typechecker.Namers$class.newNamer(Namers.scala:51)
at scala.tools.nsc.Global$$anon$1.newNamer(Global.scala:463)
at scala.tools.nsc.typechecker.Analyzer$namerFactory$$anon$1.apply(Analyzer.scala:43)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:441)
at scala.tools.nsc.Global$GlobalPhase.withCurrentUnit(Global.scala:432)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:441)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:399)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:399)
at scala.collection.Iterator$class.foreach(Iterator.scala:743)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1195)
at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:399)
at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1500)
at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1487)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:1482)
at scala.tools.nsc.Global$Run.compile(Global.scala:1580)
at scala.tools.nsc.Driver.doCompile(Driver.scala:32)
at scala.tools.nsc.MainClass.doCompile(Main.scala:23)
at scala.tools.nsc.Driver.process(Driver.scala:51)
at scala.tools.nsc.Main.process(Main.scala)
… 31 more
Caused by: java.lang.ClassNotFoundException: scala.reflect.internal.AnnotationInfos$ErroneousAnnotation$
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 54 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.428 s
[INFO] Finished at: 2016-03-23T11:39:06-05:00
[INFO] Final Memory: 18M/437M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.gatling:gatling-maven-plugin:2.2.0-SNAPSHOT:execute (default) on project crpm-gatling: Gatling failed. Simulations compilation failed. Process exited with an error: 255 (Exit value: 255) → [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.gatling:gatling-maven-plugin:2.2.0-SNAPSHOT:execute (default) on project crpm-gatling: Gatling failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
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:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Gatling failed.
at io.gatling.mojo.GatlingMojo.execute(GatlingMojo.java:205)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
… 20 more
Caused by: io.gatling.mojo.CompilationException: Simulations compilation failed.
at io.gatling.mojo.GatlingMojo.executeCompiler(GatlingMojo.java:225)
at io.gatling.mojo.GatlingMojo.execute(GatlingMojo.java:195)
… 22 more
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 255 (Exit value: 255)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:402)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:164)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:151)
at io.gatling.mojo.Fork.run(Fork.java:87)
at io.gatling.mojo.GatlingMojo.executeCompiler(GatlingMojo.java:223)
… 23 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Fixed, see https://github.com/gatling/gatling-maven/commit/35e2b2bbc0b0d544c8147919bd104cf885d7a651

Thanks Stéphane. It is all working great!

-Gary

Hi Stéphane,
*I get the same issue, I tried to update my gatling version to “*2.2.0-SNAPSHOT”, and I get this errror: " [ERROR] Plugin io.gatling:gatling-maven-plugin:2.2.0-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact io.gatling:gatling-maven-plugin:jar:2.2.0-SNAPSHOT in ".
Which mirror URL should I use in my settings.xml

Thanks
Chandu