1
votes

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.

1
And the URL is working on your browser? Because the error says it is not able to connect to access.xyz.com port 80alphamikevictor
I am able to access the application in browser.kane
Only while recording m getting above error. For recording I am giving address as localhost and port as 8080 as mentioned in Jmeter proxy settings.kane

1 Answers

0
votes

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.