Scala signature predef has wrong version

Hi, currently I’m trying to build a Gatling Project by using SBT, I have tried out 2 versions of scala that are 2.13.12 and 2.12.18. Here is my build.sbt:

libraryDependencies += "io.gatling.highcharts" % "gatling-charts-highcharts" % "3.9.0" % "test"
libraryDependencies += "io.gatling"            % "gatling-test-framework"    % "3.9.0" % "test"


addSbtPlugin("io.gatling" % "gatling-sbt" % "4.5.0")

Hit compile will cause me the error that returns Scala signature Predef has wrong version
expected: 5.0o / Test / compileIncremental 6s
found: 5.2 in Predef.class
[error] error while loading Predef, class file 'dir\gatling-core\3.9.0\gatling-core-3.9.0.jar(io/gatling/core/Predef.class)' is broken  
[error] (class java.lang.RuntimeException/error reading Scala signature of Predef.class: Scala signature Predef has wrong version
[error]  expected: 5.0
[error]  found: 5.2 in Predef.class)

I did some research, but there are not much about this behavior and I know that there is a library version conflicted, but I’m not sure what exactly the version of the Gatling I should use to fit with scala 2.12 and 2.13. Can I have a suggestion ? Scala signature Predef has wrong version
expected: 5.0o / Test / compileIncremental 6s
found: 5.2 in Predef.class

This error message means you’re trying to compile with Scala 2.12 but Gatling 3.9 requires Scala 2.13.

1 Like

Hi @slandelle , thank you for your help, just a suggestion that if we are going to use plugin, there should be a brief scala compatible on website.
After changing the version on sbt, I have finished compiling and it runs smoothly, but however it returns as this:

[info] No tests to run for Gatling / testOnly

I believe I had put the directories followed the default tree as Gatling - SBT Plugin mentioned (src/test/scala), and here is my project tree, compiling using Gatling / testOnly (dir).testReqres

 - plugins.sbt
 - test
   - scala
     - testReqres.scala

Is there anything that I am lacking from the build ?

Gatling / testOnly (dir).testReqres

Does your simulation inside the Scala file properly match the file name? Do you really have class testReqres extends Simulation in there?
What’s this (dir). in your command? The parameter must be a Java fully qualified class name (package + class simple name), not the path of the file (they don’t necessarily match if you don’t follow the convention).

1 Like

Thank you for pointing out, I forgot to change the class name

class testReqres extends Simulation

The (dir). was a *. but the HTML read it as bold, and I don’t put package, so the correct command was

Gatling / testOnly testReqres

The false one (the one I found on some random page, not on this one)

Gatling / testOnly *.testReqres

Thank you again, mr.Landelle.

At this point, I don’t know if things now work for you or not.
If they don’t, I’m afraid I can’t help. I recommend that you check the official sample: GitHub - gatling/gatling-sbt-plugin-demo: Showcase of the Gatling Plugin for SBT

Then, as you’re struggling with Scala, sbt and this third party plugin for gRPC, please note that we’re about to release an official gRPC plugin available on Gatling Enterprise. It will support Java and Kotlin, and maven and gradle. It would be way easier to set up than what you’re currently struggling with.

I am truly sorry if I cause the trouble for you guys these days, but my team demands on Scala and sbt is a must so I could not convince them to change, since there will be a large portion in project changing too.
There are some good progress here and there, hopefully I can code them in so that I won’t make a fuss more.

Honestly, migrating from Gatling Scala to Gatling Java is pretty easy.
And you can also consider contracting with us to have us do it for you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.