This is a very weird problem I'm having with my Messages app on Mountain Lion. I have two accounts: a Google Talk and a Jabber account that is linked to my Facebook chat. Whenever I open my Messages app, my connection to Google Talk works just fine, but there is always a connection error with my Facebook account. But my Internet is working fine (like, I'm able to browse to www.facebook.com just fine). It's not an account authorization problem (incorrect username/password), trust me. To fix the problem, I need to go into Preferences -> delete my Facebook Jabber account -> recreate the account -> boom, connection is working fine again.
But, as soon as I log off from my Messages app (by closing it) and re-opening it, the problem re-emerges. Connection to Google Talk works fine, but a connection error with Facebook again. Perhaps this is an issue with Mountain Lion's implementation of Messages; because it is a newer app than the battle-tested iChat, there are still some rough edges needing to be sorted out.
Anyone having any tips regarding this problem?
PS: I did try to look at this question: iChat + facebook disconnection