# Maven error : java.lang.reflect.InvocationTargetException, while upgrading Gatling from 2.2.0 to 2.3.1

**URL:** <https://community.gatling.io/t/maven-error-java-lang-reflect-invocationtargetexception-while-upgrading-gatling-from-2-2-0-to-2-3-1/4466>\
**Category:** Gatling (Open-Source)\
**Created:** [August 27, 2018, 9:08am UTC](https://community.gatling.io/t/maven-error-java-lang-reflect-invocationtargetexception-while-upgrading-gatling-from-2-2-0-to-2-3-1/4466 "2018-08-27T09:08:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charishma](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@Charishma](https://community.gatling.io/u/Charishma)\
**Post date:** [August 27, 2018, 9:08am UTC](https://community.gatling.io/t/maven-error-java-lang-reflect-invocationtargetexception-while-upgrading-gatling-from-2-2-0-to-2-3-1/4466/1 "2018-08-27T09:08:22Z")

</div>

Hi,

I’m getting this error :

_java.lang.reflect.InvocationTargetException_  
_at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)_  
_at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)_  
_at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)_  
_at java.lang.reflect.Method.invoke(Method.java:498)_  
_at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50)_  
_at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33)_  
_Caused by: java.lang.NoClassDefFoundError: scala/Function0$class_  
_at org.json4s.ThreadLocal.(Formats.scala:337)_  
_at org.json4s.DefaultFormats$class.$init$(Formats.scala:344)_  
_at org.json4s.DefaultFormats$.(Formats.scala:322)_  
_at org.json4s.DefaultFormats$.(Formats.scala)_  
_at com.bioware.bigs.gatling.Service.StressInventory$.(StressInventory.scala:51)_  
_at com.bioware.bigs.gatling.Service.StressInventory$.(StressInventory.scala)_  
_at com.bioware.bigs.gatling.AnthemScenarios.MenuFlow$.(MenuFlow.scala:42)_  
_at com.bioware.bigs.gatling.AnthemScenarios.MenuFlow$.(MenuFlow.scala)_  
_at com.bioware.bigs.gatling.Simulation.LoadTestSimulation.(LoadTestSimulation.scala:39)_  
_at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)_  
_at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)_  
_at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)_  
_at java.lang.reflect.Constructor.newInstance(Constructor.java:423)_  
_at java.lang.Class.newInstance(Class.java:442)_  
_at io.gatling.app.Runner.run0(Runner.scala:79)_  
_at io.gatling.app.Runner.run(Runner.scala:64)_  
_at io.gatling.app.Gatling$.start(Gatling.scala:63)_  
_at io.gatling.app.Gatling$.fromArgs(Gatling.scala:45)_  
_at io.gatling.app.Gatling$.main(Gatling.scala:37)_  
_at io.gatling.app.Gatling.main(Gatling.scala)_  
_… 6 more_  
_Caused by: java.lang.ClassNotFoundException: scala.Function0$class_  
_at java.net.URLClassLoader.findClass(URLClassLoader.java:381)_  
_at java.lang.ClassLoader.loadClass(ClassLoader.java:424)_  
_at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)_  
_at java.lang.ClassLoader.loadClass(ClassLoader.java:357)_  
_… 26 more_  
_[INFO] ------------------------------------------------------------------------_  
_[INFO] BUILD FAILURE_  
_[INFO] ------------------------------------------------------------------------_

My pom.xml file is :

```auto
<?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>
    <prerequisites>
        <maven>3.5.3</maven>
    </prerequisites>

    <groupId>com.bioware.bigs</groupId>
    <artifactId>bigs-loadtests</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <gatling.version>2.3.1</gatling.version>
        <gatling-plugin.version>2.2.4</gatling-plugin.version>
        <gatling.skip>false</gatling.skip>
        <path.config.file>${project.basedir}/src/test/resources/config.properties</path.config.file>
        <gatling.environment>${env.USER}</gatling.environment>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.scalaj</groupId>
            <artifactId>scalaj-time_2.11</artifactId>
            <version>0.8</version>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>2.12.6</version>
        </dependency>
        <dependency>
            <groupId>io.gatling.highcharts</groupId>
            <artifactId>gatling-charts-highcharts</artifactId>
            <version>${gatling.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.gatling</groupId>
            <artifactId>gatling-core</artifactId>
            <version>${gatling.version}</version>
        </dependency>
        <dependency>
            <groupId>io.gatling</groupId>
            <artifactId>gatling-http</artifactId>
            <version>${gatling.version}</version>
        </dependency>
        <dependency>
            <groupId>io.gatling</groupId>
            <artifactId>gatling-maven-plugin</artifactId>
            <version>${gatling-plugin.version}</version>
        </dependency>
        <dependency>
            <groupId>org.json4s</groupId>
            <artifactId>json4s-native_2.11</artifactId>
            <version>3.5.3</version>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-compiler</artifactId>
            <version>2.12.6</version>
        </dependency>
    </dependencies>
    <build>
        <defaultGoal>install</defaultGoal>
        <sourceDirectory>src/test/scala</sourceDirectory>
        <testSourceDirectory>src/test/scala</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>io.gatling</groupId>
                <artifactId>gatling-maven-plugin</artifactId>
                <version>${gatling-plugin.version}</version>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>LOADTEST</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>io.gatling</groupId>
                        <artifactId>gatling-maven-plugin</artifactId>
                        <version>${gatling-plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>compile</phase>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <dataFolder>src/test/resources/data</dataFolder>
                            <bodiesFolder>src/test/resources/bodies</bodiesFolder>
                            <resultsFolder>target/gatling/results</resultsFolder>
                            <simulationsFolder>src/test/scala</simulationsFolder>
                            <simulationClass>${gatling.simulation}</simulationClass>
                            <jvmArgs>
                                <!-- Enable this for debugging: -->
                                <!--jvmArg>-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7000</jvmArg-->
                            </jvmArgs>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

```

Command I’m using to execute : **\>mvn -P=LOADTEST -Denv=dev -Dgatling.simulation=com.bioware.bigs.gatling.Simulation.LoadTestSimulation**

Maven Version: **3.5.3**  
JDK Version: **1.8.0\_181**

I’m not getting what I have missed. Please help me out.

---

<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:** [August 27, 2018, 9:10am UTC](https://community.gatling.io/t/maven-error-java-lang-reflect-invocationtargetexception-while-upgrading-gatling-from-2-2-0-to-2-3-1/4466/2 "2018-08-27T09:10:26Z")

</div>

[https://gatling.io/docs/current/migration\_guides/2.2-to-2.3/](https://gatling.io/docs/current/migration_guides/2.2-to-2.3/)

---

<div class="post-metadata">

**Author:** ![Charishma](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@Charishma](https://community.gatling.io/u/Charishma)\
**Post date:** [August 27, 2018, 10:19am UTC](https://community.gatling.io/t/maven-error-java-lang-reflect-invocationtargetexception-while-upgrading-gatling-from-2-2-0-to-2-3-1/4466/3 "2018-08-27T10:19:57Z")

</div>

I have missed upgrading one dependency (org.native.json4s) to 2.12.X

Thanks.
