java.io.IOException: An existing connection was forcibly closed by the remote host

Upon entering any given minecraft server, after a minute or two I am forced out of the server, and I'm given the following error:

java.io.IOException: An existing connection was forcibly closed by the remote host.

What does this mean, and how can I prevent it from happening again?


I usually see that when ever I crash, /stop, or /restart my server.

There isn't really a way you can prevent it if you're playing on a server such as mineplex.

If you're hosting it yourself, you can add more RAM to the server (if your have some to spare on your computer), or be more careful with your commands. I used to crash mine a lot with worldedit until I got Async worldedit.

Edit: Same thing could be causing it if you are paying for it to be hosted

Edit2: A plugin crashing could also cause it, if you have access to console or the files read though the logs from around the time of you getting the Java error.