While my home machine never sees this error, I get this when playing on an older machine.
As Kezza suggested, clearing the cache is conventional wisdom, and can't hurt. I always do that first, to insure I'm starting with a clean slate and no leftovers. This is regardless of the PC configuration. But if that doesn't solve the problem, try the opposite.
I find the best thing to do is just hit the page refresh button. This puts you back at the character selection screen. It should work when you re-enter.
What is happening, at least for me, is that Java is shutting down completely. I posted what I could get of the log awhile back, but the crash also closes the console and destroys the log. Basically, it can happen any time the game is loading data from the server, whether at login or when loading realm data. It is (almost?) always preceded by calls to some method 'CleanupThread' (case may be incorrect).
Against conventional wisdom for Java, If you are getting the same problem I am, clearing the cache after the initial attempt is not a good idea. The more data the game can retrieve from the cache, the less often the error occurs.