java.net.ConnectException: Connection refused: connect

Jenkins JIRA | namue | 6 years ago
  1. 0

    I use Jenkins 1.397. When I start jobs on slaves (jnlp-slaves and windows-service-slaves) sometimes I get following error, so that I have to restart the build multiple times until the exception does not appear. {quote} [ak4.main.branch-4.3-M1-BSF] $ java -Xmx1024M -Dfile.encoding=Cp850 -cp C:\Jenkins\maven-agent.jar;C:\Jenkins\classworlds.jar hudson.maven.agent.Main "C:\Program Files (x86)\Entwicklung\apache-maven-2.1.0" C:\Users\mkr.ARCHIKART\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\20\22feb5d4-6a7aca32 C:\Jenkins\maven-interceptor.jar 80 C:\Jenkins\maven2.1-interceptor.jar Exception in thread "main" java.net.ConnectException: Connection refused: 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 java.net.Socket.connect(Unknown Source) at java.net.Socket.<init>(Unknown Source) at java.net.Socket.<init>(Unknown Source) at hudson.maven.agent.Main.main(Main.java:124) at hudson.maven.agent.Main.main(Main.java:62) {quote} When it succeeds there messages like: {quote} [ak4.main.branch-4.3-M1-BSF] $ java -Xmx1024M -Dfile.encoding=Cp850 -cp C:\Jenkins\maven-agent.jar;C:\Jenkins\classworlds.jar hudson.maven.agent.Main "C:\Program Files (x86)\Entwicklung\apache-maven-2.1.0" C:\Users\mkr.ARCHIKART\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\20\22feb5d4-6a7aca32 C:\Jenkins\maven-interceptor.jar 55046 C:\Jenkins\maven2.1-interceptor.jar {quote} As I understand the logs, the Jenkins slave is instructed to communicate with Jenkins server on Port 80. But on port 80 there is another application running on the maschine, that contains Jenkins server. So possible solutions would be to retry with another port, configure a list of ports to be avoided or configure a range of ports to be used.

    Jenkins JIRA | 6 years ago | namue
    java.net.ConnectException: Connection refused: connect
  2. 0

    I use Jenkins 1.397. When I start jobs on slaves (jnlp-slaves and windows-service-slaves) sometimes I get following error, so that I have to restart the build multiple times until the exception does not appear. {quote} [ak4.main.branch-4.3-M1-BSF] $ java -Xmx1024M -Dfile.encoding=Cp850 -cp C:\Jenkins\maven-agent.jar;C:\Jenkins\classworlds.jar hudson.maven.agent.Main "C:\Program Files (x86)\Entwicklung\apache-maven-2.1.0" C:\Users\mkr.ARCHIKART\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\20\22feb5d4-6a7aca32 C:\Jenkins\maven-interceptor.jar 80 C:\Jenkins\maven2.1-interceptor.jar Exception in thread "main" java.net.ConnectException: Connection refused: 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 java.net.Socket.connect(Unknown Source) at java.net.Socket.<init>(Unknown Source) at java.net.Socket.<init>(Unknown Source) at hudson.maven.agent.Main.main(Main.java:124) at hudson.maven.agent.Main.main(Main.java:62) {quote} When it succeeds there messages like: {quote} [ak4.main.branch-4.3-M1-BSF] $ java -Xmx1024M -Dfile.encoding=Cp850 -cp C:\Jenkins\maven-agent.jar;C:\Jenkins\classworlds.jar hudson.maven.agent.Main "C:\Program Files (x86)\Entwicklung\apache-maven-2.1.0" C:\Users\mkr.ARCHIKART\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\20\22feb5d4-6a7aca32 C:\Jenkins\maven-interceptor.jar 55046 C:\Jenkins\maven2.1-interceptor.jar {quote} As I understand the logs, the Jenkins slave is instructed to communicate with Jenkins server on Port 80. But on port 80 there is another application running on the maschine, that contains Jenkins server. So possible solutions would be to retry with another port, configure a list of ports to be avoided or configure a range of ports to be used.

    Jenkins JIRA | 6 years ago | namue
    java.net.ConnectException: Connection refused: connect
  3. 0

    ConnectException (Windows only)

    Google Groups | 6 years ago | Oli
    java.net.ConnectException: Connection refused: connect
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Jenkins users - java.net.SocketTimeoutException: Accept timed out

    nabble.com | 7 months ago
    java.net.ConnectException: Connection refused: connect

  1. michallos 1 times, last 5 days ago
  2. treefolk 2 times, last 2 days ago
  3. linxiaolong 18 times, last 4 weeks ago
  4. Kialandei 1 times, last 1 month ago
  5. DoktorDoener666 41 times, last 3 weeks ago
24 more registered users
65 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.net.ConnectException

    Connection refused: connect

    at java.net.PlainSocketImpl.socketConnect()
  2. Java RT
    Socket.<init>
    1. java.net.PlainSocketImpl.socketConnect(Native Method)
    2. java.net.PlainSocketImpl.doConnect(Unknown Source)
    3. java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    4. java.net.PlainSocketImpl.connect(Unknown Source)
    5. java.net.SocksSocketImpl.connect(Unknown Source)
    6. java.net.Socket.connect(Unknown Source)
    7. java.net.Socket.connect(Unknown Source)
    8. java.net.Socket.<init>(Unknown Source)
    9. java.net.Socket.<init>(Unknown Source)
    9 frames
  3. Hudson M2
    Main.main
    1. hudson.maven.agent.Main.main(Main.java:124)
    2. hudson.maven.agent.Main.main(Main.java:62)
    2 frames