Type mismatch error on injection

My code is as below. I seethat andThen is introduced in a later version. But when I use the below version, it doesnt run
setUp(
allScenarios50.inject(atOnceUsers(rampupUsers) )
.andThen(
historicBidScenarios50.inject(atOnceUsers(rampupUsers) )
)
).protocols(httpProtocol)

with mvn plugin

io.gatling
gatling-maven-plugin
3.1.1

gives compilation error io.gatling.core.structure.PopulationBuilder
required: io.gatling.commons.validation.Validation[io.gatling.core.structure.PopulationBuilder] => ?
historicBidScenarios50.inject(atOnceUsers(rampupUsers) )

The versions of the gatling-maven-plugin and of Gatling itself are unrelated.
Please check your Gatling version. andThen was introduced in 3.4.0.

Now I have added the dependency

io.gatling
gatling-core
3.7.4

I get the error on other parts of code

type mismatch;
found : io.gatling.core.check.CheckBuilder.Final[io.gatling.core.check.jsonpath.JsonPathCheckType,com.fasterxml.jackson.databind.JsonNode]
required: io.gatling.http.check.HttpCheck
.check(jsonPath(“$[0].panelId”).is(“CUR”))

Sorry, it’s impossible to tell without you providing a full sample, eg a sample project on GitHub.
Then, please note that since Gatling 3.7, Gatling also supports Java and Kotlin.
I would recommend against starting a new Gatling project in Scala unless you’re a Scala developer.

Now after adding scala plugin many errors vanished. The only error now is
Symbol ‘type io.gatling.commons.shared.unstable.model.stats.assertion.AssertionPathParts’ is missing from the classpath.
This symbol is required by ‘method io.gatling.core.assertion.AssertionSupport.string2PathParts’.
Make sure that type AssertionPathParts is in your classpath and check for conflicting dependencies with -Ylog-classpath.
A full rebuild may help if ‘AssertionSupport.class’ was compiled against an incompatible version of io.gatling.commons.shared.unstable.model.stats.assertion.
val rampupUsers: Int = if(System.getProperty(“rampupUsers”) != null && System.getProperty(“rampupUsers”) != “”) System.getProperty(“rampupUsers”).toInt else 50

The sample code is
val usersFile: String = if(System.getProperty(“users”) != null && System.getProperty(“users”) != “”) System.getProperty(“users”) else "users.csv"
val rampupUsers: Int = if(System.getProperty(“rampupUsers”) != null && System.getProperty(“rampupUsers”) != “”) System.getProperty(“rampupUsers”).toInt else 50

setUp(
allScenarios.inject(atOnceUsers(rampupUsers) )
.andThen(
historicScenarios.inject( rampUsers(rampupUsers) during (1 minute) )

)

I hope the sample is clear. I cannot share the whole in github, since beacuse of company regulations.

Mvn dependencies are


io.gatling
gatling-core
3.5.0


net.alchim31.maven
scala-maven-plugin
4.4.0
maven-plugin


org.scala-lang
scala-library
2.12.0

Really, why don’t you upgrade to Gatling 3.7.4 and switch to Java instead of Scala?

2.12.0

This is wrong. Since Gatling 3.5, Gatling requires Scala 2.13.

Now changed to 2.13.0

But the error persists

Somehow it was the teams decision to use scala somehow. Now I need to live with this. I have no say in this. Hopeyou understand my helplessness