FileInputStream fis = new FileInputStream(file);
try {
ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(fis));
GBeanData config = new GBeanData();
try {
config.readExternal(ois);
} catch (ClassNotFoundException e) {
//TODO more informative exceptions
throw new InvalidConfigException("Unable to read attribute ", e);
} catch (Exception e) {
throw new InvalidConfigException("Unable to set attribute ", e);