If you have a premium account:
-
Close all Minecraft related windows on your computer.
-
Then open Minecraft again and try to join your server.
-
If this does not work try restarting your computer.
If you recently changed your Minecraft username:
-
Close all Minecraft related windows on your computer.
-
Then open the launcher and log out and log back in.
-
Try to join the server.
If you are using a non-premium account:
To resolve the error on a non-premium account, follow this guide: How to allow cracked or non-premium players