I'm making some assumptions here but here are some real world scenarios for you to consider. The assumption is you are running windows operating systems
This error can (does) occur when running Aware IM as a service if - after a reboot AwareIM tries to start before MySQL (or other database) is ready.
If you are running server 2008 try putting a delayed start on AwareIM.
If your server is set to automatically download and install microsoft updates - reset it so that the install process is at your discretion under your control. because some updates will cause a reboot.
A complete reboot is not usually necessary, just shut down the services and then restart them (in the order jBoss, Tomcat, AwareIM) If you are using the control panel - just shut down and restart the control panel
If you are running on a VPS some service providers will restart the server if another user has caused a hang. This again is outside of your control and you'll just have to live with it. When the server restarts - the above scenarion will apply. Consider a dedicated server or a cloud server running xen technology
If you are running backup exec 2010 This program uses port 9000, try setting jBoss on another port (easy to do in the control panel - but don't forget to open the new port on your firewall)
Try assigning more memory to jBoss. It might be a "too may sockets" issue
If you're running Unix OS - then you are on your own - I know nothing about unix but same principles apply. Make sure there is no other software running on your server that conflicts with port 9000 and that jBoss has a good chunk of memory
Ater several months of pain, I recently moved to a dedicated server and am now having really restful night's sleep - and no grief from my users
Let me know how you all get on 🙂