# Migration from 3.9.4 to 3.10.5 and compilation error

**URL:** <https://community.gatling.io/t/migration-from-3-9-4-to-3-10-5-and-compilation-error/8916>\
**Category:** Gatling (Open-Source)\
**Created:** [April 19, 2024, 9:26am UTC](https://community.gatling.io/t/migration-from-3-9-4-to-3-10-5-and-compilation-error/8916 "2024-04-19T09:26:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gribo](https://avatars.discourse-cdn.com/v4/letter/g/c0e974/32.png) [@gribo](https://community.gatling.io/u/gribo)\
**Post date:** [April 19, 2024, 9:26am UTC](https://community.gatling.io/t/migration-from-3-9-4-to-3-10-5-and-compilation-error/8916/1 "2024-04-19T09:26:50Z")

</div>

Hi,  
I’m trying to upgrade from 3.9.4 to 3.10.5 and get compilation failure in an old scala code.

I will try to describe in a short exemple

The code complaining is here :

```auto
def trackRequest(sessionParam: String, maxDuration: FiniteDuration = 3.minutes): ChainBuilder = {
 exec((ctx: ScenarioContext, next: Action) => TrackProgress(sessionParam, ctx.coreComponents.statsEngine, next))
}

```

The TrackProgress trait is as follow (simplified) :

```auto
private case class TrackProgress(sessionParam: String, statsEngine: StatsEngine, next: Action) extends ChainableAction with NameGen {

    override def name: String = genName(getClass.getName)

    override def execute(session: Session): Unit = {
 //do some complexe stuff here but compilation is ok
   next
    }
  }

```

The compilation error code is as follow :

```auto
[ERROR] HandledProgrammationEventWatcher.scala:65: overloaded method exec with alternatives:
  (execs: Iterable[io.gatling.core.action.builder.Executable])io.gatling.core.structure.ChainBuilder <and>
  (head: io.gatling.core.action.builder.Executable,tail: io.gatling.core.action.builder.Executable*)io.gatling.core.structure.ChainBuilder <and>
  (sessionFunction: io.gatling.core.session.Expression[io.gatling.core.session.Session])io.gatling.core.structure.ChainBuilder
 cannot be applied to ((io.gatling.core.structure.ScenarioContext, io.gatling.core.action.Action) => HandledProgrammationEventWatcher.this.TrackProgress)
[ERROR] one error found

```

I see that chainbleaction et exec trait code has changed but cannot make it compile.  
I need to stand with scala code from now

Thank you in advance if you can propose input to dig

---

<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:** [April 19, 2024, 9:37am UTC](https://community.gatling.io/t/migration-from-3-9-4-to-3-10-5-and-compilation-error/8916/2 "2024-04-19T09:37:26Z")

</div>

Hi,

This is custom code, not standard Gatling API usage.  
Is this code open-source?

---

<div class="post-metadata">

**Author:** ![gribo](https://avatars.discourse-cdn.com/v4/letter/g/c0e974/32.png) [@gribo](https://community.gatling.io/u/gribo)\
**Post date:** [April 19, 2024, 12:43pm UTC](https://community.gatling.io/t/migration-from-3-9-4-to-3-10-5-and-compilation-error/8916/3 "2024-04-19T12:43:13Z")

</div>

Well, it is developped for a company, but I can share it if needed, the code cheks in a list of kafka messages if one has been consumed and marks the wait time and processed time in the statsEngine in order to have those times processed by the Gatling report.  
We use Gatling this 8 years, this code is legacy code, i’ll probably rework it in Java, but thought to be up to date with Gatling version before starting this kind of refacto

---

<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:** [April 22, 2024, 7:04am UTC](https://community.gatling.io/t/migration-from-3-9-4-to-3-10-5-and-compilation-error/8916/4 "2024-04-22T07:04:11Z")

</div>

> I see that chainbleaction et exec trait code has changed but cannot make it compile.

Here’s the file that contains the `Action` hierarchy: [gatling/gatling-core/src/main/scala/io/gatling/core/action/Action.scala at main · gatling/gatling · GitHub](https://github.com/gatling/gatling/blob/main/gatling-core/src/main/scala/io/gatling/core/action/Action.scala)

You can check on GitHub the diff between the 2 tags you’re using.

I’m afraid we can’t directly help with a Gatling private extension without a consulting contract.

Regards

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/b/b148e0742de35c6280726cabf3ecd3de2d320f63.png) [@system](https://community.gatling.io/u/system)\
**Post date:** [May 22, 2024, 7:04am UTC](https://community.gatling.io/t/migration-from-3-9-4-to-3-10-5-and-compilation-error/8916/5 "2024-05-22T07:04:59Z")

</div>

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