Make it compile for JDK6
Better exception handling for servers