«Refused» is different from «timed out». Refused means something answered and said no — the address is right but nothing is accepting connections there. That narrows it down a lot.
What you are seeing
java.net.ConnectException: Connection refused: no further information- It fails instantly rather than hanging first.
- The server list shows the connection bar with a red X.
Why it happens
Your client reached the machine and found nothing listening on that port. Either the server is not running, or you are pointed at the wrong port.
What to do
- Check the server is actually running
In the panel, the status has to be running and the console has to have reached
Done. A server that is starting is not yet accepting connections. - Compare the port you typed with the panel
The most common cause after «not started» is a wrong or missing port. It has to match exactly, and it is not always
25565. - Retype the address rather than pasting it
A trailing space or an invisible character from a chat message produces this too. Typing it fresh rules that out in seconds.
- Wait if the server just started
Between the process starting and the port opening there is a gap. On a modpack that gap can be minutes.
The connection either succeeds or fails with a different message — any change of message means you have moved past this cause.
If you get a timeout instead of a refusal, that is the opposite situation: nothing answered at all, which points at the address or the route rather than at the server being down.