1.grpc调试的时候,提示下面问题
SLF4J: Found binding in [jar:file:${NGRINDER_HOME}/tmp/webapp/WEB-INF/lib/logback-classic-1.0.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
2018-08-14 19:00:31,201 ERROR worker-bootstrap: Error running worker process
java.lang.IncompatibleClassChangeError: Implementing class
2.分析是jar冲突了。需要进行jar升级或者是删除jar动作
考虑到本身的ngridner代码里面就有这个包,并且1.0.0版本比较低。先升级到1.1.11版本上来。
3.解决方式
重新进行编译ngrinder的代码。jar版本进行升级。
先在本机调试,日志打印为;
2018-08-15 10:19:38,396 INFO The Grinder version 3.9.1
2018-08-15 10:19:38,400 INFO Java(TM) SE Runtime Environment 1.8.0_151-b12: Java HotSpot(TM) 64-Bit Server VM (25.151-b12, mixed mode) on Mac OS X x86_64 10.13.4
2018-08-15 10:19:38,405 INFO time zone is CST (+0800)
2018-08-15 10:19:38,485 INFO worker process 0 of agent number 0
2018-08-15 10:19:38,501 INFO Instrumentation agents: byte code transforming instrumenter for Java; byte code transforming instrumenter for Java
2018-08-15 10:19:39,340 INFO registered plug-in net.grinder.plugin.http.HTTPPlugin
2018-08-15 10:19:39,352 INFO before process.
2018-08-15 10:19:39,354 INFO Running "TestRunner.groovy" using GroovyScriptEngine running with groovy version: 2.2.1
2018-08-15 10:19:39,398 INFO before thread.
2018-08-15 10:19:39,398 INFO starting, will do 1 run
都是标准日志输出。考虑到调用版本会和ngrinder。在mvn库引入的时候不要进行重复定义
升级备注:
<!-- For Log -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.11</version>
</dependency>
<!-- use common-logging over SLF4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.25</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
</dependency>
4.调试:
提示错误:
2018-08-15 10:43:11,251 ERROR Script error - Error while initialize test runner
net.grinder.engine.common.EngineException: Error while initialize test runner
at net.grinder.scriptengine.groovy.GroovyScriptEngine.<init>(GroovyScriptEngine.java:71)
at net.grinder.scriptengine.groovy.GroovyScriptEngineService.createScriptEngine(GroovyScriptEngineService.java:109)
at net.grinder.engine.process.ScriptEngineContainer.getScriptEngine(ScriptEngineContainer.java:105)
at net.grinder.engine.process.GrinderProcess.run(GrinderProcess.java:330)
at net.grinder.engine.process.WorkerProcessEntryPoint.run(WorkerProcessEntryPoint.java:87)
at net.grinder.engine.process.WorkerProcessEntryPoint.main(WorkerProcessEntryPoint.java:60)
Caused by: net.grinder.scriptengine.groovy.GroovyScriptEngine$GroovyScriptExecutionException: Exception occurs in @BeforeProcess block.
at net.grinder.scriptengine.groovy.GrinderContextExecutor.runBeforeProcess(GrinderContextExecutor.java:88)
at net.grinder.scriptengine.groovy.GroovyScriptEngine.<init>(GroovyScriptEngine.java:64)
... 5 common frames omitted
Caused by: java.lang.UnsupportedOperationException: null
at java.util.Collections$UnmodifiableCollection.addAll(Collections.java:1065)
at net.grinder.scriptengine.groovy.junit.GrinderRunner.withBeforeProcess(GrinderRunner.java:268)
at net.grinder.scriptengine.groovy.GrinderContextExecutor.runBeforeProcess(GrinderContextExecutor.java:85)
... 6 common frames omitted
2018-08-15 10:43:11,252 ERROR worker-bootstrap: Error running worker process
net.grinder.engine.common.EngineException: Error while initialize test runner
at net.grinder.scriptengine.groovy.GroovyScriptEngine.<init>(GroovyScriptEngine.java:71)
at net.grinder.scriptengine.groovy.GroovyScriptEngineService.createScriptEngine(GroovyScriptEngineService.java:109)
at net.grinder.engine.process.ScriptEngineContainer.getScriptEngine(ScriptEngineContainer.java:105)
at net.grinder.engine.process.GrinderProcess.run(GrinderProcess.java:330)
at net.grinder.engine.process.WorkerProcessEntryPoint.run(WorkerProcessEntryPoint.java:87)
at net.grinder.engine.process.WorkerProcessEntryPoint.main(WorkerProcessEntryPoint.java:60)
Caused by: net.grinder.scriptengine.groovy.GroovyScriptEngine$GroovyScriptExecutionException: Exception occurs in @BeforeProcess block.
at net.grinder.scriptengine.groovy.GrinderContextExecutor.runBeforeProcess(GrinderContextExecutor.java:88)
at net.grinder.scriptengine.groovy.GroovyScriptEngine.<init>(GroovyScriptEngine.java:64)
... 5 common frames omitted
Caused by: java.lang.UnsupportedOperationException: null
at java.util.Collections$UnmodifiableCollection.addAll(Collections.java:1065)
at net.grinder.scriptengine.groovy.junit.GrinderRunner.withBeforeProcess(GrinderRunner.java:268)
at net.grinder.scriptengine.groovy.GrinderContextExecutor.runBeforeProcess(GrinderContextExecutor.java:85)
... 6 common frames omitted