2

I’ve installed Jmeter 3.1 on my mac with Java 1.7. I just started with simple http request on blaze demo.com, I get the

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)

I never had this issue before when I installed on windows machine. I tried my best to search from google but none of them helped. Can any one please help.

2
  • can you post your jmeter property file? Commented Feb 14, 2017 at 18:17
  • please share the screenshots of test plan highlighting the HTTP Sampler and View Results Tree result Commented Feb 15, 2017 at 6:31

3 Answers 3

4

Connection Refused means no server is listening on the port you try to connect with. You can check:

  1. server is on and waiting for accepting connection.
  2. public ip or internal ip.
  3. port is accurate or not.

Validate with telnet ip-address port

Sign up to request clarification or add additional context in comments.

7 Comments

jmeter.property file is too big, what section you want to see, I can just post that.
@user3381098 you don't have to post it. you need to check the server hostname and port, and test whether you can connect or not. use the command in my answer
sorry I didn't understand what ip address and port are you talking about? Is it local host you mean? In my meter.property file, it shows remote_hosts=127.0.0.1
when I try to connect to 127.0.0.1, then it says connection refused from the command line
@user3381098 seems like your server is down or it is not expecting connection request
|
1

Did you try to access your application outside JMeter on your Mac? Is it loading? You can also open the terminal in Mac and test it by using Curl.

curl http://www.google.com

If your application is working in Mac outside JMeter then please check the values that you have given in "Server Name of IP:" field and the "Port Number" field. You should be able to access the same IP:port combination using Curl like the following and it should return a successful response.

curl http://IP:port

enter image description here

4 Comments

Outside of Jmeter I tried curl blazedemo.com from the command line on mac and it worked but when I tried in Jmeter it says connection refused. I'm not getting at all.
Post a screenshot of how you have configured your HTTPSampler or share your test plan here. There is a possibility that JMeter or JVM is not allowed to make connections as per Mac Firewall if the same test plan is working on Windows. support.apple.com/en-us/HT201642
I'm not sure how to attach a screenshot here. If you want me to send via an email I can do. Basically it is just simple test. I 've created a HTTP request sampler and in the Server Name or IP = blazedemo.com and Method = GET and that's all I've given. In the view results tree, I see java.net.ConnectException: Connection refused (Connection refused).
I think the site has the problem. I can connect to other sites now. Thanks
0

Check if you are behind a proxy. If you are, there are more than one option to set the proxy.

1- command line

jmeter -H my.proxy.server -P 8000 -u username -a password -N localhost

2- in system.properties inside JMeter-instal-location\jmeter-3.3\bin

3- in JMeter UI in Http Request -> Advance tab

enter image description here

more details here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.