我刚开始加特林。我按照this page上的说明进行操作,但最后一节却陷入了困境。我想直接从Intellij运行Recorder.scala
和/或Engine.scala
,但是出现如下错误:
C:\jdk12\bin\java.exe "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.1.2\lib\idea_rt.jar=59109:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.1.2\bin" -Dfile.encoding=UTF-8 -classpath C:\etc\ws\Gatling\target\test-classes;C:\Users\PCUSER\.m2\repository\io\gatling\highcharts\gatling-charts-highcharts\3.1.2\gatling-charts-highcharts-3.1.2.jar;C:\Users\PCUSER\.m2\repository\org\scala-lang\scala-library\2.12.8\scala-library-2.12.8.jar;C:\Users\PCUSER\.m2\repository\io\gatling\gatling-charts\3.1.2\gatling-charts-3.1.2.jar;C:\Users\PCUSER\.m2\repository\com\tdunning\t-digest\3.1\t-digest-3.1.jar;C:\Users\PCUSER\.m2\repository\io\gatling\gatling-http-client\3.1.2\gatling-http-client-3.1.2.jar;C:\Users\PCUSER\.m2\repository\io\gatling\gatling-netty-util\3.1.2\gatling-netty-util-3.1.2.jar;C:\Users\PCUSER\.m2\repository\io\netty\netty-buffer\4.1.36.Final\netty-buffer-4.1.36.Final.jar;C:\Users\PCUSER\.m2\repository\io\netty\netty-handler\4.1.36.Final\netty-handler-4.1.36.Final.jar;C:\Users\PCUSER\.m2\repository\io\netty\netty-handler-proxy\4.1.36.Final\netty-handler-proxy-4.1.36.Final.jar;C:\Users\PCUSER\.m2\repository\io\netty\netty-codec-socks\4.1.36.Final\netty-codec-socks-4.1.36.Final.jar;C:\Users\PCUSER\.m2\repository\io\netty\netty-resolver-dns\4.1.36.Final\netty-resolver-dns-4.1.36.Final.jar;C:\Users\PCUSER\.m2\repository\io\netty\netty-resolver\4.1.36.Final\netty-resolver-4.1.36.Final.jar;C:\Users\PCUSER\.m2\repository\io\netty\netty-codec-dns\4.1.36.Final\netty-codec-dns-4.1.36.Final.jar;C:\Users\PCUSER\.m2\repository\io\netty\netty-transport-native-epoll\4.1.36.Final\netty-transport-native-epoll-4.1.36.Final-linux-x86_64.jar;C:\Users\PCUSER\.m2\repository\io\netty\netty-transport-native-unix-common\4.1.36.Final\netty-transport-native-unix-common-4.1.36.Final.jar;C:\Users\PCUSER\.m2\repository\io\netty\netty-codec-http2\4.1.36.Final\netty-codec-http2-4.1.36.Final.jar;C:\Users\PCUSER\.m2\repository\io\netty\netty-tcnative-boringssl-static\2.0.25.Final\netty-tcnative-boringssl-static-2.0.25.Final.jar;C:\Users\PCUSER\.m2\repository\com\sun\activation\javax.activation\1.2.0\javax.activation-1.2.0.jar;C:\Users\PCUSER\.m2\repository\org\slf4j\slf4j-api\1.7.26\slf4j-api-1.7.26.jar;C:\Users\PCUSER\.m2\repository\com\typesafe\scala-logging\scala-logging_2.12\3.9.2\scala-logging_2.12-3.9.2.jar;C:\Users\PCUSER\.m2\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;C:\Users\PCUSER\.m2\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;C:\Users\PCUSER\.m2\repository\io\gatling\gatling-commons\3.1.2\gatling-commons-3.1.2.jar;C:\Users\PCUSER\.m2\repository\org\scala-lang\scala-reflect\2.12.8\scala-reflect-2.12.8.jar;C:\Users\PCUSER\.m2\repository\com\typesafe\config\1.3.4\config-1.3.4.jar;C:\Users\PCUSER\.m2\repository\com\dongxiguo\fastring_2.12\1.0.0\fastring_2.12-1.0.0.jar;C:\Users\PCUSER\.m2\repository\io\suzaku\boopickle_2.12\1.3.1\boopickle_2.12-1.3.1.jar;C:\Users\PCUSER\.m2\repository\org\typelevel\spire-macros_2.12\0.16.1\spire-macros_2.12-0.16.1.jar;C:\Users\PCUSER\.m2\repository\org\scala-lang\modules\scala-collection-compat_2.12\0.3.0\scala-collection-compat_2.12-0.3.0.jar;C:\Users\PCUSER\.m2\repository\com\softwaremill\quicklens\quicklens_2.12\1.4.12\quicklens_2.12-1.4.12.jar;C:\Users\PCUSER\.m2\repository\org\scala-lang\modules\scala-java8-compat_2.12\0.9.0\scala-java8-compat_2.12-0.9.0.jar;C:\Users\PCUSER\.m2\repository\com\eatthepath\fast-uuid\0.1\fast-uuid-0.1.jar;C:\Users\PCUSER\.m2\repository\io\gatling\gatling-app\3.1.2\gatling-app-3.1.2.jar;C:\Users\PCUSER\.m2\repository\io\gatling\gatling-core\3.1.2\gatling-core-3.1.2.jar;C:\Users\PCUSER\.m2\repository\com\typesafe\akka\akka-slf4j_2.12\2.5.22\akka-slf4j_2.12-2.5.22.jar;C:\Users\PCUSER\.m2\repository\org\simpleflatmapper\lightning-csv\6.7.0\lightning-csv-6.7.0.jar;C:\Users\PCUSER\.m2\repository\org\simpleflatmapper\sfm-util\6.7.0\sfm-util-6.7.0.jar;C:\Users\PCUSER\.m2\repository\com\github\ben-manes\caffeine\caffeine\2.7.0\caffeine-2.7.0.jar;C:\Users\PCUSER\.m2\repository\org\checkerframework\checker-qual\2.6.0\checker-qual-2.6.0.jar;C:\Users\PCUSER\.m2\repository\com\google\errorprone\error_prone_annotations\2.3.3\error_prone_annotations-2.3.3.jar;C:\Users\PCUSER\.m2\repository\io\pebbletemplates\pebble\3.0.9\pebble-3.0.9.jar;C:\Users\PCUSER\.m2\repository\org\unbescape\unbescape\1.1.6.RELEASE\unbescape-1.1.6.RELEASE.jar;C:\Users\PCUSER\.m2\repository\org\scala-lang\modules\scala-parser-combinators_2.12\1.1.2\scala-parser-combinators_2.12-1.1.2.jar;C:\Users\PCUSER\.m2\repository\com\github\scopt\scopt_2.12\3.7.1\scopt_2.12-3.7.1.jar;C:\Users\PCUSER\.m2\repository\io\gatling\jsonpath_2.12\0.6.14\jsonpath_2.12-0.6.14.jar;C:\Users\PCUSER\.m2\repository\org\jodd\jodd-json\5.0.13\jodd-json-5.0.13.jar;C:\Users\PCUSER\.m2\repository\org\jodd\jodd-bean\5.0.13\jodd-bean-5.0.13.jar;C:\Users\PCUSER\.m2\repository\org\jodd\jodd-core\5.0.13\jodd-core-5.0.13.jar;C:\Users\PCUSER\.m2\repository\net\sf\saxon\Saxon-HE\9.9.1-2\Saxon-HE-9.9.1-2.jar;C:\Users\PCUSER\.m2\repository\com\ibm\icu\icu4j\63.1\icu4j-63.1.jar;C:\Users\PCUSER\.m2\repository\org\jodd\jodd-lagarto\5.0.13\jodd-lagarto-5.0.13.jar;C:\Users\PCUSER\.m2\repository\org\jodd\jodd-log\5.0.13\jodd-log-5.0.13.jar;C:\Users\PCUSER\.m2\repository\io\gatling\gatling-http\3.1.2\gatling-http-3.1.2.jar;C:\Users\PCUSER\.m2\repository\org\scala-lang\modules\scala-xml_2.12\1.2.0\scala-xml_2.12-1.2.0.jar;C:\Users\PCUSER\.m2\repository\io\gatling\gatling-jms\3.1.2\gatling-jms-3.1.2.jar;C:\Users\PCUSER\.m2\repository\org\apache\geronimo\specs\geronimo-jms_1.1_spec\1.1.1\geronimo-jms_1.1_spec-1.1.1.jar;C:\Users\PCUSER\.m2\repository\io\gatling\gatling-jdbc\3.1.2\gatling-jdbc-3.1.2.jar;C:\Users\PCUSER\.m2\repository\io\gatling\gatling-redis\3.1.2\gatling-redis-3.1.2.jar;C:\Users\PCUSER\.m2\repository\net\debasishg\redisclient_2.12\3.9\redisclient_2.12-3.9.jar;C:\Users\PCUSER\.m2\repository\org\apache\commons\commons-pool2\2.6.0\commons-pool2-2.6.0.jar;C:\Users\PCUSER\.m2\repository\io\gatling\gatling-graphite\3.1.2\gatling-graphite-3.1.2.jar;C:\Users\PCUSER\.m2\repository\org\hdrhistogram\HdrHistogram\2.1.11\HdrHistogram-2.1.11.jar;C:\Users\PCUSER\.m2\repository\io\gatling\gatling-recorder\3.1.2\gatling-recorder-3.1.2.jar;C:\Users\PCUSER\.m2\repository\org\scala-lang\modules\scala-swing_2.12\2.1.1\scala-swing_2.12-2.1.1.jar;C:\Users\PCUSER\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.9.8\jackson-databind-2.9.8.jar;C:\Users\PCUSER\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;C:\Users\PCUSER\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.8\jackson-core-2.9.8.jar;C:\Users\PCUSER\.m2\repository\org\json4s\json4s-jackson_2.12\3.6.5\json4s-jackson_2.12-3.6.5.jar;C:\Users\PCUSER\.m2\repository\org\json4s\json4s-core_2.12\3.6.5\json4s-core_2.12-3.6.5.jar;C:\Users\PCUSER\.m2\repository\org\json4s\json4s-ast_2.12\3.6.5\json4s-ast_2.12-3.6.5.jar;C:\Users\PCUSER\.m2\repository\org\json4s\json4s-scalap_2.12\3.6.5\json4s-scalap_2.12-3.6.5.jar;C:\Users\PCUSER\.m2\repository\com\thoughtworks\paranamer\paranamer\2.8\paranamer-2.8.jar;C:\Users\PCUSER\.m2\repository\org\bouncycastle\bcpkix-jdk15on\1.61\bcpkix-jdk15on-1.61.jar;C:\Users\PCUSER\.m2\repository\org\bouncycastle\bcprov-jdk15on\1.61\bcprov-jdk15on-1.61.jar;C:\Users\PCUSER\.m2\repository\io\netty\netty-codec-http\4.1.36.Final\netty-codec-http-4.1.36.Final.jar;C:\Users\PCUSER\.m2\repository\io\netty\netty-common\4.1.36.Final\netty-common-4.1.36.Final.jar;C:\Users\PCUSER\.m2\repository\io\netty\netty-transport\4.1.36.Final\netty-transport-4.1.36.Final.jar;C:\Users\PCUSER\.m2\repository\io\netty\netty-codec\4.1.36.Final\netty-codec-4.1.36.Final.jar;C:\Users\PCUSER\.m2\repository\com\typesafe\akka\akka-actor_2.12\2.5.22\akka-actor_2.12-2.5.22.jar Recorder
Error: Could not find or load main class Recorder
Caused by: java.lang.ClassNotFoundException: Recorder
我尝试使用JDK12,但它不起作用。
运行独立的recorder.bat
很好。
答案 0 :(得分:0)
现在可以使用。我无法按照https://gatling.io/docs/3.1/installation/#with-maven中所述在POM.XML中添加以下内容。
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>MANUALLY_REPLACE_WITH_LATEST_VERSION</version>
<configuration>
<args>
<arg>-target:jvm-1.8</arg>
<arg>-deprecation</arg>
<arg>-feature</arg>
<arg>-unchecked</arg>
<arg>-language:implicitConversions</arg>
<arg>-language:postfixOps</arg>
</args>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>