# Type mismatch error on injection

**URL:** <https://community.gatling.io/t/type-mismatch-error-on-injection/6397>\
**Category:** Gatling (Open-Source)\
**Created:** [January 18, 2022, 11:44am UTC](https://community.gatling.io/t/type-mismatch-error-on-injection/6397 "2022-01-18T11:44:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anna](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Anna](https://community.gatling.io/u/Anna)\
**Post date:** [January 18, 2022, 11:44am UTC](https://community.gatling.io/t/type-mismatch-error-on-injection/6397/1 "2022-01-18T11:44:17Z")

</div>

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) )

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [January 18, 2022, 11:52am UTC](https://community.gatling.io/t/type-mismatch-error-on-injection/6397/2 "2022-01-18T11:52:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Anna](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Anna](https://community.gatling.io/u/Anna)\
**Post date:** [January 18, 2022, 12:07pm UTC](https://community.gatling.io/t/type-mismatch-error-on-injection/6397/3 "2022-01-18T12:07:21Z")

</div>

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”))

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [January 18, 2022, 12:25pm UTC](https://community.gatling.io/t/type-mismatch-error-on-injection/6397/4 "2022-01-18T12:25:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Anna](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Anna](https://community.gatling.io/u/Anna)\
**Post date:** [January 18, 2022, 12:38pm UTC](https://community.gatling.io/t/type-mismatch-error-on-injection/6397/5 "2022-01-18T12:38:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [January 18, 2022, 12:43pm UTC](https://community.gatling.io/t/type-mismatch-error-on-injection/6397/6 "2022-01-18T12:43:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Anna](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Anna](https://community.gatling.io/u/Anna)\
**Post date:** [January 18, 2022, 12:48pm UTC](https://community.gatling.io/t/type-mismatch-error-on-injection/6397/7 "2022-01-18T12:48:05Z")

</div>

Now changed to 2.13.0

But the error persists

---

<div class="post-metadata">

**Author:** ![Anna](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Anna](https://community.gatling.io/u/Anna)\
**Post date:** [January 18, 2022, 12:56pm UTC](https://community.gatling.io/t/type-mismatch-error-on-injection/6397/8 "2022-01-18T12:56:12Z")

</div>

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
