ElParserException: Failed to parse <MyRequestName> with error '[B cannot be cast to [C'

178 views
Skip to first unread message

M S Puranik

unread,
May 22, 2018, 12:55:37 PM5/22/18
to Gatling User Group
Hi All,

I recently started using Gatling for testing. At first to learn, I recorded a simulation from HAR converter, then ran the same with gatling.bat file. The test ran successfully.

Now I want to create a project for myself, enable CI for performance testing such that after every deployment, my simulation should run.

Here are the steps that I followed:
1. Installed Eclipse Oxygen 
2. Set up Maven 
3. Created a Maven project using archetype as explained here
4. Imported the archetype, modified pom.xml with gatling-maven-plugin (while scala-maven-plugin, and gatling-charts-highcharts bundle were already present as dependencies)
5. Placed the earlier recorded simulation in /src/test/scala/
6. Added <disableCompiler>true</disableCompiler> as a configuration in gatling-maven-plugin (since I am using scala-maven-plugin too)
6. Ran the following commands: 1. mvn eclipse:clean eclipse:eclipse 2. mvn clean install 3. mvn gatling:test

While command 1 and 2 give the message as Build Successful, the 3rd command throws following error:

java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50)
        at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33)
Caused by: io.gatling.core.session.el.ElParserException: Failed to parse OKRHomePage with error '[B cannot be cast to [C'
        at io.gatling.core.session.el.ElCompiler.parseEl(ElCompiler.scala:249)
        at io.gatling.core.session.el.ElCompiler$.parse(ElCompiler.scala:171)
        at io.gatling.core.session.el.ElCompiler$.compile(ElCompiler.scala:174)
        at io.gatling.core.session.el.package$El$.el$extension(package.scala:26)
        at io.gatling.core.ValidationImplicits.stringToExpression(ValidationImplicits.scala:48)
        at io.gatling.core.ValidationImplicits.stringToExpression$(ValidationImplicits.scala:48)
        at io.gatling.core.Predef$.stringToExpression(Predef.scala:22)
        at Dontknow.<init>(Dontknow.scala:158)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
        at java.base/java.lang.Class.newInstance(Unknown Source)
        at io.gatling.app.Runner.run0(Runner.scala:79)
        at io.gatling.app.Runner.run(Runner.scala:64)
        at io.gatling.app.Gatling$.start(Gatling.scala:63)
        at io.gatling.app.Gatling$.fromArgs(Gatling.scala:45)
        at io.gatling.app.Gatling$.main(Gatling.scala:37)
        at io.gatling.app.Gatling.main(Gatling.scala)
        ... 6 more

I searched in this group for this error message, I got following possible fixes/repairs from few of the posts:
1. This post Make sure project is using JDK 1.8 -  I am using JDK 1.8
2. This post says it could be due to class/project name conflicts, re-create the project from scratch - Did it twice, once in Eclipse, another in IntelliJ. Both throw the same error

I would highly appreciate if someone could point me in a right direction. Attaching the pom.xml. And here are the versions I'm currently using:
gatling-maven-plugin - 2.2.4
gatling-highcharts-maven-archetype - 2.3.1
scala - 2.12.3
gatling and gatling-charts-highcharts - 2.3.0
scala-maven-plugin - 3.2.2
apache-maven - 3.5.3

Note: Attaching two different versions of pom.xml with slightly different versions of above components. I get the same error in both of poms though.
pom_intellij.xml
pom_eclipse.xml

Stéphane LANDELLE

unread,
May 22, 2018, 2:58:12 PM5/22/18
to gat...@googlegroups.com
Gatling 2 doesn't support Java 9+, Gatling 3 will.

Stéphane Landelle
GatlingCorp CEO


--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

M S Puranik

unread,
May 23, 2018, 2:14:55 PM5/23/18
to Gatling User Group
Thank You Mr.Stéphane,

That worked! Actually I had both Java 10 and Java 8 on my machine. I had to uninstall Java 10 to make it work. We can mark this issue as closed.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages