-2

If I connect to my server via any of the ips (moo1210.tk:25561 or localhost:25561) I get a java.net.connectexception: Connection refused: no further information error, its allow on the firewall and its being port forwarded, what should I do? The server type is a 1.7.10 forge server.

4
  • Posting possible duplicate all over the forums isn't helping, also server and lan are two different things. – moo1210 May 19 '19 at 21:50
  • @dupe, I'd rather link the other question here, since the other answer is not helpful at all. – dly May 19 '19 at 22:48
  • mhm the other answer isn't helpful at all. – moo1210 May 24 '19 at 16:47
  • ikr, the other answer is useless, why did you think I opened this question, maybe answer the question and not mark it as a duplicate with out looking into it more? – moo1210 May 24 '19 at 16:48
1

1) Client and Server, either or both of them are not in the network. Yes it's possible that they are not connected to LAN or internet or any other network, in that case, Java will throw "java.net.ConnectException: Connection refused" exception on client side.

2) Server is not running The second most common reason is the server is down and not running. In that case, also you will get java.net.ConnectException: Connection refused error. What I don't like is that the message it gives, no matter what is the reason it prints the same error. By the way, you can use following networking commands e.g. ping to check if the server is running and listening on the port.

3) The server is running but not listening on the port, a client is trying to connect. This is another common cause of "java.net.ConnectException: Connection refused", where the server is running but listening on the different port. It’s hard to figure out this case, until, you think about it and verify the configuration. If you are working on a large project and have a hierarchical configuration file, Its possible that either default configuration is taking place or some other settings are overriding your correct setting.

4) Firewall is not permitted for host-port combination Almost every corporate network is protected by firewalls. If you are connecting to some other companies network e.g. opening an FIX session to the broker, in any Electronic Trading System, then you need to raise firewall request from both sides to ensure that they permit each other's IP address and port number. If the firewall is not allowing connection then also you will receive same java.net.ConnectException: Connection refused exception in Java application.

5) Host Port combination is incorrect. This could be another reason of java.net.ConnectException: Connection refused: connect.It’s quite possible that either you are providing incorrect host port combination or earlier host port combination has been changed on the server side. Check the latest configuration on both client and server side to avoid connection refused exception.

6) Incorrect protocol in Connection String TCP is underlying protocol for much high-level protocol including HTTP, RMI and others. While passing connection string, you need to ensure that you are passing correct protocol, which server is expecting e.g. if server has exposed its service via RMI than connection string should begin with rmi://

3
  • Non of the steps worked, there is already a firewall rule, 1 is for LAN and this isn't LAN its a world wide server, the port is correct and 6, its using TCP and its not using RMI. Any other ideas? – moo1210 May 19 '19 at 22:22
  • Did you try using ping to test the connection outside minecraft? – Stephen May 21 '19 at 1:00
  • Yeah,it pings outside of minecraft. – moo1210 May 24 '19 at 16:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.