Connection refused to host: 127.0.0.1 java.net.ConnectException



  • I have very recently started to look at Jmeter for non-functional testing web applications and have found numerous articles, tutorials etc including this Where can I find good JMeter tutorials? which has lots of links to useful information, which is great, but none of these are really solving my issue. I have built my first test plan in Jmeter, but when I run it I get an error: Error initialising remote server: 127.0.0.1 Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refused: connect So my question is, do I need to set my java.rmi.server.hostname property at the server? If so, how? Is this done in the jmeter.properties file? If so, I tried changing remote_hosts=127.0.0.1 to the IP address of the target server once I had pinged it to find the address, but this did nothing and still produced the error as it appears to be binding to 127.0.0.1 Set my environment variables as: JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_05 JMETER_HOME=C:\Program Files\apache-jmeter-2.11 In Jmeter I've built a test plan as follows: Test plan element: Added a variable Name: site, Value: testenvironment:8012 Thread Group element: Threads = 1, Ramp-up = 1, Loop count = 1 HTTP Request Defaults element: Server name or IP = ${site} HTTP Cookie Manager element HTTP Request element: Path = /Login/Index Method = POST Added two parameters: Username with value and Password with value View Results in Table Response Assertion Click remote start and the error is produced. Please help.



  • java.rmi.server.hostname property can be set either in system.properties file (which lives under /bin folder of your JMeter installation) or passed directly to JMeter startup script via -D key as jmeter -Djava.rmi.server.hostname=10.20.30.40 This way you can specify interface to bind to. See Apache JMeter Properties Customization Guide for more details on manipulating JMeter properties. If you one just one host there is no need to use distributed testing. If you want to test the approach check out JMeter Distributed Testing Step-by-step guide. If you're going to use a single machine for it you'll need to launch both master and slave on it.


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2