2017-10-16 13 views
1

シミュレーションを作成しようとしていますが、シミュレーションを実行したいと考えています。 $ mvn gatling:executeの実行中にエラーが発生しました。ギャトリング負荷テスト中にコンパイルエラーが発生する

私のポンポンは、次の依存関係があります。

<dependency> 
    <groupId>io.gatling</groupId> 
    <artifactId>gatling-charts</artifactId> 
    <version>2.2.5</version> 
</dependency> 
<dependency> 
    <groupId>io.gatling</groupId> 
    <artifactId>gatling-core</artifactId> 
    <version>2.2.5</version> 
</dependency> 

と、次のプラグイン:

<build> 
    <plugins> 
     <plugin> 
      <groupId>net.alchim31.maven</groupId> 
      <artifactId>scala-maven-plugin</artifactId> 
      <version>3.3.1</version> 
      <configuration> 
       <scalaVersion>2.12.3</scalaVersion> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>io.gatling</groupId> 
      <artifactId>gatling-maven-plugin</artifactId> 
      <version>2.2.4</version> 
      <executions> 
       <execution> 
        <id>performanceTests</id> 
        <goals> 
         <goal>execute</goal> 
        </goals> 
        <configuration> 
         <simulationClass>simulations.SimulationClass</simulationClass> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
</build> 

これは私が出会ったのエラーです:

12:50:36.313 [main][WARN ][ZincCompiler.scala:141] i.g.c.ZincCompiler$ - 
Pruning sources from previous analysis, due to incompatible CompileSetup. 
java.lang.ClassNotFoundException: io.gatling.app.Gatling 
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) 
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) 
    at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:42) 
    at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33) 

付属の依存関係:

<dependency> 
    <groupId>io.gatling</groupId> 
    <artifactId>gatling-app</artifactId> 
    <version>2.2.5</version> 
</dependency> 

しかし、今、私は新しいエラーを取得:

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.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)V 
at com.github.mnogu.gatling.mqtt.protocol.MqttProtocolOptionPart.<init>(MqttProtocol.scala:124) 
at com.github.mnogu.gatling.mqtt.protocol.MqttProtocol$.apply(MqttProtocol.scala:24) 
at com.github.mnogu.gatling.mqtt.protocol.MqttProtocolBuilder$.apply(MqttProtocolBuilder.scala:13) 
at com.github.mnogu.gatling.mqtt.Predef$.mqtt(Predef.scala:9) 
at simulations.SimulationClass.<init>(SimulationClass.scala:10) 
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:59) 
at io.gatling.app.Gatling$.fromArgs(Gatling.scala:43) 
at io.gatling.app.Gatling$.main(Gatling.scala:35) 
at io.gatling.app.Gatling.main(Gatling.scala) 

...

この問題に関するすべてのリードは大きな助けになるでしょう。

<!-- https://mvnrepository.com/artifact/io.gatling/gatling-app --> 
<dependency> 
    <groupId>io.gatling</groupId> 
    <artifactId>gatling-app</artifactId> 
    <version>2.2.5</version> 
</dependency> 

はあなたのコードが実行時に参照するjarファイルがあるので

はあなたの2番目のエラーが主に更新、

答えて

1

あなたのエラーは次の依存関係が欠落していると言うありがとうコンパイル時に使用される同じjarファイルではありません。コンパイル中や実行中に同じjarファイルを使用していることを確認してください。

このため、依存するjarファイルを削除して、プロジェクトをクリーンアップし、プログラムを再コンパイルして実行することができます。

+0

は、依存関係を含め、今、私は別のエラーを参照してください。ここでは

は私のポンポンが今どのように見えるかです – aria

+0

新しいエラーは何ですか?あなたは更新できますか? –

+0

が投稿のエラーを更新しました。 – aria

1

gatling core 2.2.3に準拠した外部ジャーのように見えます。 gatlingコアバージョンを2.2.3に、スカラバージョンを2.11.8に戻すことで問題は解決されました。

<dependency> 
     <groupId>io.gatling.highcharts</groupId> 
     <artifactId>gatling-charts-highcharts</artifactId> 
     <version>2.2.3</version> 
    </dependency> 
    <dependency> 
     <groupId>io.gatling</groupId> 
     <artifactId>gatling-core</artifactId> 
     <version>2.2.3</version> 
    </dependency> 
    <dependency> 
     <groupId>io.gatling</groupId> 
     <artifactId>gatling-app</artifactId> 
     <version>2.2.3</version> 
    </dependency> 

<plugins> 
     <plugin> 
      <groupId>net.alchim31.maven</groupId> 
      <artifactId>scala-maven-plugin</artifactId> 
      <version>3.3.1</version> 
      <configuration> 
       <scalaVersion>2.11.8</scalaVersion> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>io.gatling</groupId> 
      <artifactId>gatling-maven-plugin</artifactId> 
      <version>2.2.3</version> 
      <executions> 
       <execution> 
        <id>performanceTests</id> 
        <goals> 
         <goal>execute</goal> 
        </goals> 
        <configuration> 
         <simulationClass>simulations.SimulationClass</simulationClass> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
関連する問題