Search code examples
javascalagatlingpebble

Bad symbolic reference error after updating one of our artefact


I updated one of the dependencies gatling-config-library-ext to 3.10.2 which is the latest version in our company artifactory, updated project sdk to JDK 17 in IntelliJ and I am using Scala sdk 2.13.8

On doing a maven compile, I am getting below exception.

***** missing reference, looking for Extension/T in package io.pebbletemplates.pebble.extension
decls = Scope{}
[ERROR] [Error] : Bad symbolic reference. A signature in /Users/manr4/.m2/repository/io/gatling/gatling-core/3.10.5/gatling-core-3.10.5.jar(io/gatling/core/body/BodySupport.class)
refers to Extension/T in package io.pebbletemplates.pebble.extension which is not available.
It may be completely missing from the current classpath, or the version on
the classpath might be incompatible with the version used when compiling /Users/manr4/.m2/repository/io/gatling/gatling-core/3.10.5/gatling-core-3.10.5.jar(io/gatling/core/body/BodySupport.class).

I am not using io.pebbletemplates.pebble.extension anywhere in my code

my pom.xml

    <properties>
        <gcle.version>3.10.2</gcle.version>
        <commons-io.version>2.14.0</commons-io.version>
        <json4s-jackson.version>4.1.0-M2</json4s-jackson.version>
        <scalaj-http.version>2.4.2</scalaj-http.version>
        <aws-java-sdk-s3.version>1.12.693</aws-java-sdk-s3.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>com.company.app</groupId>
            <artifactId>gatling-config-library-ext</artifactId>
            <version>${gcle.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io.version}</version>
        </dependency>
        <dependency>
            <groupId>org.json4s</groupId>
            <artifactId>json4s-jackson_3</artifactId>
            <version>${json4s-jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>org.scalaj</groupId>
            <artifactId>scalaj-http_2.13</artifactId>
            <version>${scalaj-http.version}</version>
        </dependency>
        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-s3</artifactId>
            <version>${aws-java-sdk-s3.version}</version>
        </dependency>
    </dependencies>

gatling-config-library-ext pom.xml

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>

        <gcl.version>2.0.0</gcl.version>
        <gatling.version>3.10.5</gatling.version>
        <spock.version>2.3-groovy-4.0</spock.version>
        <typesafe.version>1.4.3</typesafe.version>
        <scalatest.version>3.2.18</scalatest.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-core</artifactId>
            <version>${spock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-junit4</artifactId>
            <version>${spock.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.typesafe</groupId>
            <artifactId>config</artifactId>
            <version>${typesafe.version}</version>
        </dependency>

        <dependency>
            <groupId>io.gatling.highcharts</groupId>
            <artifactId>gatling-charts-highcharts</artifactId>
            <version>${gatling.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>io.pebbletemplates</groupId>
                    <artifactId>pebble</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.pebbletemplates</groupId>
            <artifactId>pebble</artifactId>
            <version>3.2.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.company.app</groupId>
            <artifactId>gatling-config-library</artifactId>
            <version>${gcl.version}</version>
        </dependency>

        <dependency>
            <groupId>org.scalactic</groupId>
            <artifactId>scalactic_2.13</artifactId>
            <version>${scalatest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_2.13</artifactId>
            <version>${scalatest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.scalamock</groupId>
            <artifactId>scalamock_2.13</artifactId>
            <version>5.2.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

Solution

  • The pom of your gatling-config-library-ext library is explicitly excluding the pebble dependency from the Gatling dependencies branch. Your main project is pulling Gatling transitively through this library so pebble is missing from the classpath. As pebble is a required dependency and not an optional one, one of our classes fails to load.

    You must stop forcefully removing pebble from the classpath. Your not using it doesn’t mean Gatling can work without it.