Receiving Scala Compilation error

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

The Project has just one Simulation class: TryFile

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.

Please comply to the requirements for posting here: How to Ask a Question

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?

Please do as requested.

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

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

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

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.

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

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

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

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.

1 Like