0

im trying to connect a client to a server. The server is running, but when i try to connect the client i get this error: "Exp_Client cannot connect to Exp_Server. Connection refused to host: 127.0.0.1.; nested exception is: java.net.ConnectException: Connection refused"

the method which should connect; the marked line does not work

the relevant constants

  • I turned off the firewall
  • VM-Options are: -Djava.security.manager -Djava.security.policy=/Users/Max/Documents/Uni/Bachelor/Vertiefung/Bachelorarbeit/workspace/kit-iism-experimenttool/Exp_Implementation/java.policy
  • Program arguments: none
  • I use IntelliJ IDEA 14.1.5
  • JRE: 1.60_65
  • jdk1.7.0_79
  • JVM: Java HotSpot(TM) 64-Bit Server VM
  • h2-1.3.176

Any ideas what the problem could be? Would be very thankful for help. Kind regards, Max

Joop Eggen
  • 107,315
  • 7
  • 83
  • 138
Max Meyer
  • 1
  • 1
  • likely cause: you're trying to connect to a port that's not listening. Check your port settings, check if the port is listening. – eis Oct 07 '15 at 15:51
  • Running on the same machine only. With the emergence of IPv6 "::1" instead of "127.0.0.1" could be tried for the loop-back localhost. – Joop Eggen Oct 07 '15 at 15:57

2 Answers2

0

Just a few ideas:

  • You have not started your server correctly.
  • You are trying to connect to the wrong port.
  • Your server is not waiting to accept connections.

Your source code would be great to have a look on

user207421
  • 305,947
  • 44
  • 307
  • 483
Jürgen K.
  • 3,427
  • 9
  • 30
  • 66
  • What does 'your server is not waiting to accept connections' mean? NB don't use code formatting for text that isn't code. – user207421 Oct 07 '15 at 21:03
0

You haven't started the RMI registry, or the URL isn't correct.

user207421
  • 305,947
  • 44
  • 307
  • 483