Reputation: 21
I am getting below error in browser while recording an application in JMeter
.
org.apache.http.conn.HttpHostConnectException: Connection to http://access.xyz.com refused at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190) at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294) at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:643) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:481) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:298) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1105) at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:236) Caused by: java.net.ConnectException: Connection timed out: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:127) at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180) ... 10 more
I am giving the address as Localhost
and port as 8080
.
I am using JMeter 2.11
and it is working fine for all other applications.
Only while recording this particular application I am getting above error.
Upvotes: 1
Views: 2598
Reputation: 11463
Your stack trace says in the first line:
org.apache.http.conn.HttpHostConnectException: Connection to http://access.xyz.com refused
In your description after the stack trace you said the service was on localhost port 8080. The problem is you are requesting a URL with no service behind it. Change the URL you are querying to:
http://localhost:8080
or if you've hacked your HOSTS file to have access.xyz.com
resolve to localhost, then you need to specify the port number in your URL like this:
http://access.xyz.com:8080
Without the :8080
, the protocol http
uses the default port of 80. Similarly, the default port for the protocol https
(SSL) is 443. If you use anything other than the default port, you have to explicitly set the port in the URL.
Upvotes: 0