Add try-catch blocks for ioexceptions and classnotfoundexceptions on ser...

...ver side: