我试图在TCP聊天服务器上启动JMeter测试。但是我在初始化时总是有同样的错误:
2017-12-03 18:21:13,366 ERROR o.a.j.p.t.s.TCPSampler: org.apache.jmeter.protocol.tcp.sampler.TCPSampler@3b957217 Exception creating: src.camix.TCPClientImpl
java.lang.InstantiationException: null
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48) ~[?:1.8.0_151]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_151]
at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_151]
at org.apache.jmeter.protocol.tcp.sampler.TCPSampler.getProtocol(TCPSampler.java:338) [ApacheJMeter_tcp.jar:3.3 r1808647]
at org.apache.jmeter.protocol.tcp.sampler.TCPSampler.initSampling(TCPSampler.java:496) [ApacheJMeter_tcp.jar:3.3 r1808647]
at org.apache.jmeter.protocol.tcp.sampler.TCPSampler.sample(TCPSampler.java:357) [ApacheJMeter_tcp.jar:3.3 r1808647]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:498) [ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:424) [ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255) [ApacheJMeter_core.jar:3.3 r1808647]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
2017-12-03 18:21:13,378 DEBUG o.a.j.p.t.s.TCPSampler: Using Protocol Handler: NONE
2017-12-03 18:21:13,378 DEBUG o.a.j.p.t.s.TCPSampler: tcp://127.0.0.1:12345
2017-12-03 18:21:13,379 WARN o.a.j.p.t.s.TCPSampler: Could not create socket for tcp://127.0.0.1:12345
java.net.ConnectException: Connexion refusée (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:1.8.0_151]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[?:1.8.0_151]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[?:1.8.0_151]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[?:1.8.0_151]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:1.8.0_151]
at java.net.Socket.connect(Socket.java:589) ~[?:1.8.0_151]
at org.apache.jmeter.protocol.tcp.sampler.TCPSampler.getSocket(TCPSampler.java:169) [ApacheJMeter_tcp.jar:3.3 r1808647]
at org.apache.jmeter.protocol.tcp.sampler.TCPSampler.sample(TCPSampler.java:385) [ApacheJMeter_tcp.jar:3.3 r1808647]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:498) [ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:424) [ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255) [ApacheJMeter_core.jar:3.3 r1808647]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
有什么想法吗?在Windows / Ubuntu上尝试使用Oracle和Open JDK ...
答案 0 :(得分:0)
将ApacheJmeter_core.jar添加到项目中解决了问题。 ApacheJmeter_tcp.jar还不够