For the sample "play-samples-play-scala-rest-api-example": Got error when runing 'sbt gatling:test'
bestcastor opened this issue · 1 comments
bestcastor commented
Trying to play with the sample app for Play 2.7 play-samples-play-scala-rest-api-example
Got the error as follow. It seems it tried to use the io.netty to do some ssl works, but it cannot find it.
Is it related that Play 2.6 switched to Akka HTTP now?
Can anyone let me know how to fix it? Gatling seems a good choice for loading test for web rest app.
[info] Loading global plugins from /Users/nyu/.sbt/1.0/plugins
[info] Loading settings for project model-service-build from plugins.sbt ...
[info] Loading project definition from /Users/nyu/Projects/model-service/project
[info] Loading settings for project root from build.sbt ...
[info] Loading settings for project docs from build.sbt ...
[info] Set current project to play-scala-rest-api-example (in build file:/Users/nyu/Projects/model-service/)
[info] Compiling 1 Scala source to /Users/nyu/Projects/model-service/target/scala-2.12/test-classes ...
[info] Done compiling.
[info] Compiling 1 Scala source to /Users/nyu/Projects/model-service/target/scala-2.12/gatling-classes ...
[info] Done compiling.
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=iso-8859-1
Warning: Unknown option -m
[error] i.g.a.Gatling$ - Run crashed
java.lang.NoSuchMethodError: io.netty.internal.tcnative.SSLContext.setUseTasks(JZ)V
at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:347)
at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:193)
at io.netty.handler.ssl.OpenSslContext.<init>(OpenSslContext.java:34)
at io.netty.handler.ssl.OpenSslClientContext.<init>(OpenSslClientContext.java:188)
at io.netty.handler.ssl.SslContext.newClientContextInternal(SslContext.java:777)
at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:452)
at io.gatling.http.util.SslContextsFactory.newSslContexts(SslContexts.scala:99)
at io.gatling.http.engine.DefaultHttpClientFactory.newClientConfig(HttpClientFactory.scala:58)
at io.gatling.http.engine.DefaultHttpClientFactory.newClient(HttpClientFactory.scala:77)
at io.gatling.http.engine.HttpEngine$.apply(HttpEngine.scala:47)
[error] Uncaught exception when running simulation.GatlingSpec: java.lang.NoSuchMethodError: io.netty.internal.tcnative.SSLContext.setUseTasks(JZ)V
[error] sbt.ForkMain$ForkError: java.lang.NoSuchMethodError: io.netty.internal.tcnative.SSLContext.setUseTasks(JZ)V
[error] at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:347)
[error] at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:193)
[error] at io.netty.handler.ssl.OpenSslContext.<init>(OpenSslContext.java:34)
[error] at io.netty.handler.ssl.OpenSslClientContext.<init>(OpenSslClientContext.java:188)
[error] at io.netty.handler.ssl.SslContext.newClientContextInternal(SslContext.java:777)
[error] at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:452)
[error] at io.gatling.http.util.SslContextsFactory.newSslContexts(SslContexts.scala:99)
[error] at io.gatling.http.engine.DefaultHttpClientFactory.newClientConfig(HttpClientFactory.scala:58)
[error] at io.gatling.http.engine.DefaultHttpClientFactory.newClient(HttpClientFactory.scala:77)
[error] at io.gatling.http.engine.HttpEngine$.apply(HttpEngine.scala:47)
[error] at io.gatling.http.protocol.HttpProtocol$$anon$1.newComponents(HttpProtocol.scala:54)
[error] at io.gatling.core.protocol.ProtocolComponentsRegistry.$anonfun$components$1(Protocol.scala:68)
[error] at scala.collection.mutable.HashMap.getOrElseUpdate(HashMap.scala:86)
[error] at io.gatling.core.protocol.ProtocolComponentsRegistry.componentsFactory$1(Protocol.scala:68)
[error] at io.gatling.core.protocol.ProtocolComponentsRegistry.comps$1(Protocol.scala:70)
[error] at io.gatling.core.protocol.ProtocolComponentsRegistry.$anonfun$components$4(Protocol.scala:72)
[error] at scala.collection.mutable.HashMap.getOrElseUpdate(HashMap.scala:86)
[error] at io.gatling.core.protocol.ProtocolComponentsRegistry.components(Protocol.scala:72)
[error] at io.gatling.http.action.HttpActionBuilder.lookUpHttpComponents(HttpActionBuilder.scala:26)
[error] at io.gatling.http.action.HttpRequestActionBuilder.build(HttpRequestActionBuilder.scala:33)
[error] at io.gatling.core.structure.StructureBuilder.$anonfun$build$1(StructureBuilder.scala:35)
[error] at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error] at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error] at scala.collection.immutable.List.foldLeft(List.scala:89)
[error] at io.gatling.core.structure.StructureBuilder.build(StructureBuilder.scala:34)
[error] at io.gatling.core.structure.StructureBuilder.build$(StructureBuilder.scala:33)
[error] at io.gatling.core.structure.ChainBuilder.build(ChainBuilder.scala:31)
[error] at io.gatling.core.action.builder.LoopBuilder.build(LoopBuilder.scala:61)
[error] at io.gatling.core.structure.StructureBuilder.$anonfun$build$1(StructureBuilder.scala:35)
[error] at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error] at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error] at scala.collection.immutable.List.foldLeft(List.scala:89)
[error] at io.gatling.core.structure.StructureBuilder.build(StructureBuilder.scala:34)
[error] at io.gatling.core.structure.StructureBuilder.build$(StructureBuilder.scala:33)
[error] at io.gatling.core.structure.ScenarioBuilder.build(ScenarioBuilder.scala:38)
[error] at io.gatling.core.structure.PopulationBuilder.build(ScenarioBuilder.scala:100)
[error] at io.gatling.core.scenario.SimulationParams.$anonfun$scenarios$1(Simulation.scala:194)
[error] at scala.collection.immutable.List.map(List.scala:286)
[error] at io.gatling.core.scenario.SimulationParams.scenarios(Simulation.scala:194)
[error] at io.gatling.app.Runner.run0(Runner.scala:92)
[error] at io.gatling.app.Runner.run(Runner.scala:61)
[error] at io.gatling.app.Gatling$.start(Gatling.scala:73)
[error] at io.gatling.app.Gatling$.fromArgs(Gatling.scala:46)
[error] at io.gatling.sbt.GatlingTask.liftedTree1$1(GatlingTask.scala:52)
[error] at io.gatling.sbt.GatlingTask.execute(GatlingTask.scala:51)
[error] at sbt.ForkMain$Run.lambda$runTest$1(ForkMain.java:304)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error] at java.lang.Thread.run(Thread.java:745)
[info] Simulation(s) execution ended.
[error] Error during tests:
[error] simulation.GatlingSpec
[error] (Gatling / test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 8 s, completed Jun 4, 2019 4:10:12 PM
mac-nayu:model-service nyu$
mac-nayu:model-service nyu$ sbt gatling:test
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=iso-8859-1
[info] Loading global plugins from /Users/nyu/.sbt/1.0/plugins
[info] Loading settings for project model-service-build from plugins.sbt ...
[info] Loading project definition from /Users/nyu/Projects/model-service/project
[info] Loading settings for project root from build.sbt ...
[info] Loading settings for project docs from build.sbt ...
[info] Set current project to play-scala-rest-api-example (in build file:/Users/nyu/Projects/model-service/)
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=iso-8859-1
Warning: Unknown option -m
[error] i.g.a.Gatling$ - Run crashed
java.lang.NoSuchMethodError: io.netty.internal.tcnative.SSLContext.setUseTasks(JZ)V
at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:347)
at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:193)
at io.netty.handler.ssl.OpenSslContext.<init>(OpenSslContext.java:34)
at io.netty.handler.ssl.OpenSslClientContext.<init>(OpenSslClientContext.java:188)
at io.netty.handler.ssl.SslContext.newClientContextInternal(SslContext.java:777)
at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:452)
at io.gatling.http.util.SslContextsFactory.newSslContexts(SslContexts.scala:99)
at io.gatling.http.engine.DefaultHttpClientFactory.newClientConfig(HttpClientFactory.scala:58)
at io.gatling.http.engine.DefaultHttpClientFactory.newClient(HttpClientFactory.scala:77)
at io.gatling.http.engine.HttpEngine$.apply(HttpEngine.scala:47)
[error] Uncaught exception when running simulation.GatlingSpec: java.lang.NoSuchMethodError: io.netty.internal.tcnative.SSLContext.setUseTasks(JZ)V
[error] sbt.ForkMain$ForkError: java.lang.NoSuchMethodError: io.netty.internal.tcnative.SSLContext.setUseTasks(JZ)V
[error] at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:347)
[error] at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:193)
[error] at io.netty.handler.ssl.OpenSslContext.<init>(OpenSslContext.java:34)
[error] at io.netty.handler.ssl.OpenSslClientContext.<init>(OpenSslClientContext.java:188)
[error] at io.netty.handler.ssl.SslContext.newClientContextInternal(SslContext.java:777)
[error] at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:452)
[error] at io.gatling.http.util.SslContextsFactory.newSslContexts(SslContexts.scala:99)
[error] at io.gatling.http.engine.DefaultHttpClientFactory.newClientConfig(HttpClientFactory.scala:58)
[error] at io.gatling.http.engine.DefaultHttpClientFactory.newClient(HttpClientFactory.scala:77)
[error] at io.gatling.http.engine.HttpEngine$.apply(HttpEngine.scala:47)
[error] at io.gatling.http.protocol.HttpProtocol$$anon$1.newComponents(HttpProtocol.scala:54)
[error] at io.gatling.core.protocol.ProtocolComponentsRegistry.$anonfun$components$1(Protocol.scala:68)
[error] at scala.collection.mutable.HashMap.getOrElseUpdate(HashMap.scala:86)
[error] at io.gatling.core.protocol.ProtocolComponentsRegistry.componentsFactory$1(Protocol.scala:68)
[error] at io.gatling.core.protocol.ProtocolComponentsRegistry.comps$1(Protocol.scala:70)
[error] at io.gatling.core.protocol.ProtocolComponentsRegistry.$anonfun$components$4(Protocol.scala:72)
[error] at scala.collection.mutable.HashMap.getOrElseUpdate(HashMap.scala:86)
[error] at io.gatling.core.protocol.ProtocolComponentsRegistry.components(Protocol.scala:72)
[error] at io.gatling.http.action.HttpActionBuilder.lookUpHttpComponents(HttpActionBuilder.scala:26)
[error] at io.gatling.http.action.HttpRequestActionBuilder.build(HttpRequestActionBuilder.scala:33)
[error] at io.gatling.core.structure.StructureBuilder.$anonfun$build$1(StructureBuilder.scala:35)
[error] at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error] at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error] at scala.collection.immutable.List.foldLeft(List.scala:89)
[error] at io.gatling.core.structure.StructureBuilder.build(StructureBuilder.scala:34)
[error] at io.gatling.core.structure.StructureBuilder.build$(StructureBuilder.scala:33)
[error] at io.gatling.core.structure.ChainBuilder.build(ChainBuilder.scala:31)
[error] at io.gatling.core.action.builder.LoopBuilder.build(LoopBuilder.scala:61)
[error] at io.gatling.core.structure.StructureBuilder.$anonfun$build$1(StructureBuilder.scala:35)
[error] at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error] at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error] at scala.collection.immutable.List.foldLeft(List.scala:89)
[error] at io.gatling.core.structure.StructureBuilder.build(StructureBuilder.scala:34)
[error] at io.gatling.core.structure.StructureBuilder.build$(StructureBuilder.scala:33)
[error] at io.gatling.core.structure.ScenarioBuilder.build(ScenarioBuilder.scala:38)
[error] at io.gatling.core.structure.PopulationBuilder.build(ScenarioBuilder.scala:100)
[error] at io.gatling.core.scenario.SimulationParams.$anonfun$scenarios$1(Simulation.scala:194)
[error] at scala.collection.immutable.List.map(List.scala:286)
[error] at io.gatling.core.scenario.SimulationParams.scenarios(Simulation.scala:194)
[error] at io.gatling.app.Runner.run0(Runner.scala:92)
[error] at io.gatling.app.Runner.run(Runner.scala:61)
[error] at io.gatling.app.Gatling$.start(Gatling.scala:73)
[error] at io.gatling.app.Gatling$.fromArgs(Gatling.scala:46)
[error] at io.gatling.sbt.GatlingTask.liftedTree1$1(GatlingTask.scala:52)
[error] at io.gatling.sbt.GatlingTask.execute(GatlingTask.scala:51)
[error] at sbt.ForkMain$Run.lambda$runTest$1(ForkMain.java:304)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)```
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error] at java.lang.Thread.run(Thread.java:745)
[info] Simulation(s) execution ended.
[error] Error during tests:
[error] simulation.GatlingSpec
[error] (Gatling / test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 4 s, completed Jun 4, 2019 8:08:14 PM
dwijnand commented
It looks like this is an issue of Gatling bringing in a version of Netty that is incompatible with what Play brings in. See if you can find what those two versions are, and then see if you can find a version of Gatling that is compatible with Play's choice of Netty version.