我已经在Java 1.7上安装了Jmeter 3.1。我刚开始使用blaze demo.com上的简单http请求,我得到了
java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:120)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:179)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:328)
at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.open(MeasuringConnectionManager.java:114)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:612)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:447)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:884)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:654)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:413)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1166)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1155)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:475)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:418)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249)
at java.lang.Thread.run(Thread.java:745)
我在Windows机器上安装之前从未遇到此问题。我尽力从谷歌搜索,但没有一个帮助。任何人都可以帮忙。
答案 0 :(得分:1)
Connection Refused
表示没有服务器正在侦听您尝试连接的端口。
你可以查看:
使用telnet ip-address port
答案 1 :(得分:1)
您是否尝试在Mac上的JMeter外部访问您的应用程序?是加载吗?您也可以在Mac中打开终端并使用Curl进行测试。
curl http://www.google.com
如果您的应用程序在JMeter外部使用Mac,请检查您在“IP服务器名称:”字段和“端口号”字段中给出的值。您应该能够使用Curl访问相同的IP:端口组合,如下所示,它应该返回一个成功的响应。
curl http://IP:port
答案 2 :(得分:0)
检查您是否支持代理。如果是,则可以有多个选项来设置代理。
1- 命令行
jmeter -H my.proxy.server -P 8000 -u username -a password -N localhost
在 JMeter-instal-location \ jmeter-3.3 \ bin 中的 2- system >properties
Http请求中的 3- 在JMeter UI中 - >高级选项卡 更多详情here