# Receiving Scala Compilation error

**URL:** https://community.gatling.io/t/receiving-scala-compilation-error/8610
**Category:** Gatling (Open-Source)
**Created:** [January 10, 2024, 2:43pm UTC](https://community.gatling.io/t/receiving-scala-compilation-error/8610 "2024-01-10T14:43:42Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Hina](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@Hina](https://community.gatling.io/u/Hina)
#### Post date: [January 10, 2024, 2:43pm UTC](https://community.gatling.io/t/receiving-scala-compilation-error/8610/1 "2024-01-10T14:43:42Z")

</div>

Running the following command:  
mvn gatling:test -Dgatling.simulationClass=Simulations.TryFile

The Project has just one Simulation class: TryFile

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/b/b7ecb5e61238b0cb5a89003c7ee94713ef90b183.png)

Receiving the below error when trying to run Gatling Simulation via maven:

06:39:04.928 [main][ERROR][ZincCompiler.scala:142] i.g.c.ZincCompiler$ - ## Exception when compiling 4 sources to C:\Users\devadmin\IdeaProjects\Gatling2\target\test-classes  
06:39:04.942 [main][ERROR][ZincCompiler.scala:268] i.g.c.ZincCompiler$ - Compilation crashed  
scala.reflect.internal.FatalError:  
bad constant pool index: 0 at pos: 48445  
while compiling:   
during phase: globalPhase=, enteringPhase=  
library version: version 2.13.6  
compiler version: version 2.13.6

I have not faced compilation errors previously. Does anyone what could be the probable reason? Any help would be much appreciated.

---

<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 10, 2024, 2:50pm UTC](https://community.gatling.io/t/receiving-scala-compilation-error/8610/2 "2024-01-10T14:50:49Z")

</div>

Please comply to the requirements for posting here: [How to Ask a Question](https://community.gatling.io/t/how-to-ask-a-question/6538)

---

<div class="post-metadata">

### Author: ![Hina](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@Hina](https://community.gatling.io/u/Hina)
#### Post date: [January 10, 2024, 3:31pm UTC](https://community.gatling.io/t/receiving-scala-compilation-error/8610/3 "2024-01-10T15:31:42Z")

</div>

This simulation is working fine via Intellij. But failing while using mvn comman via command prompt. So can anyone tell me what could be the possible rootcause?

---

<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 10, 2024, 3:38pm UTC](https://community.gatling.io/t/receiving-scala-compilation-error/8610/4 "2024-01-10T15:38:38Z")

</div>

Please do as requested.

---

<div class="post-metadata">

### Author: ![Hina](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@Hina](https://community.gatling.io/u/Hina)
#### Post date: [January 10, 2024, 4:53pm UTC](https://community.gatling.io/t/receiving-scala-compilation-error/8610/5 "2024-01-10T16:53:26Z")

</div>

What are the other details required? Let me know Do you know the solution?  
following is the pom file used:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.example</groupId>
  <artifactId>GatlingRun</artifactId>
  <version>1.0-SNAPSHOT</version>

  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <encoding>UTF-8</encoding>

    <gatling.version>3.6.1</gatling.version>
    <gatling-maven-plugin.version>3.1.2</gatling-maven-plugin.version>
    <scala-maven-plugin.version>4.8.1</scala-maven-plugin.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.gatling.highcharts</groupId>
      <artifactId>gatling-charts-highcharts</artifactId>
      <version>${gatling.version}</version>
    </dependency>
    <dependency>
      <groupId>io.gatling</groupId>
      <artifactId>gatling-app</artifactId>
      <version>${gatling.version}</version>
    </dependency>
    <dependency>
      <groupId>io.gatling</groupId>
      <artifactId>gatling-recorder</artifactId>
      <version>${gatling.version}</version>
    </dependency>

    <dependency>
      <groupId>io.gatling</groupId>
      <artifactId>gatling-maven-plugin</artifactId>
      <version>${gatling-maven-plugin.version}</version>
    </dependency>
  </dependencies>

  <build>
    <testSourceDirectory>src/test/scala</testSourceDirectory>
    <plugins>
      <plugin>
        <groupId>io.gatling</groupId>
        <artifactId>gatling-maven-plugin</artifactId>
        <version>${gatling-maven-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <version>${scala-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>testCompile</goal>
            </goals>
            <configuration>
              <jvmArgs>
                <jvmArg>-Xss100M</jvmArg>
              </jvmArgs>
              <args>
                <arg>-deprecation</arg>
                <arg>-feature</arg>
                <arg>-unchecked</arg>
                <arg>-language:implicitConversions</arg>
                <arg>-language:postfixOps</arg>
              </args>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>

  </build>
</project>

```

---

<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 10, 2024, 5:01pm UTC](https://community.gatling.io/t/receiving-scala-compilation-error/8610/6 "2024-01-10T17:01:22Z")

</div>

Please properly comply with the requirements listed on the page I first mentioned:

> Use Up-to-Date Versions

Not compliant. You’re currently using Gatling 3.6.1 from 2.5 years ago. The current version is 3.10.3.  
Same thing goes for your Java version and your gatling-maven-plugin.  
Here the official up-to-date sample: [GitHub - gatling/gatling-maven-plugin-demo-scala: Showcase of the Gatling Plugin for Maven + Scala](https://github.com/gatling/gatling-maven-plugin-demo-scala)

> Provide a Reproducer

Not compliant either. If you don’t provide a way for us to reproduce your issue on our side, we can’t help you.

---

<div class="post-metadata">

### Author: ![Hina](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@Hina](https://community.gatling.io/u/Hina)
#### Post date: [January 10, 2024, 5:06pm UTC](https://community.gatling.io/t/receiving-scala-compilation-error/8610/7 "2024-01-10T17:06:45Z")

</div>

The same POM file without the scala plugin worked perfectly in my local. Hence I am puzzled as to why it’s not working in the VM. However I will give it a try

---

<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 10, 2024, 5:21pm UTC](https://community.gatling.io/t/receiving-scala-compilation-error/8610/8 "2024-01-10T17:21:51Z")

</div>

Also: unless you’re a Scala developper, Gatling Java is definitely more suited than Gatling Scala.

---

<div class="post-metadata">

### Author: ![Hina](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@Hina](https://community.gatling.io/u/Hina)
#### Post date: [January 10, 2024, 5:42pm UTC](https://community.gatling.io/t/receiving-scala-compilation-error/8610/9 "2024-01-10T17:42:05Z")

</div>

I have tried my best not to be rude here, but this is the limit. All the projects worked perfectly well with maven in my system with the previous versions, and I have gone on to add some case blocks in scala for scenario selection and Injection profile selection. Clearly this is not about the lack of skill or knowledge of scala. I am trying to set up gatling project in a new server and have been facing issues ever since with maven execution due to scala files compilation errors. It workes from IDE though.  
Also for the record , I tried the POM file with the latest version. Facing a different set of errors. I will figure this out with the help from my colleagues, but might I add here that gatling has a very bad community support! I regret posting my question here

---

<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 10, 2024, 5:49pm UTC](https://community.gatling.io/t/receiving-scala-compilation-error/8610/10 "2024-01-10T17:49:24Z")

</div>

> I have tried my best not to be rude here, but this is the limit.

That’s sad that things are turning up this way, but this is exactly what I feel on my side too.

Community support is something that is built together. Users requesting help must do their best to provide valuable information and make the best use of the time and effort they are given for free.

Let’s say we disagree and stop here.

---

<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 10, 2024, 5:49pm UTC](https://community.gatling.io/t/receiving-scala-compilation-error/8610/11 "2024-01-10T17:49:28Z")

</div>


