if (sessionFile.exists()) {
logger.info("Activating from file " + sessionFile);
InputStream in = new FileInputStream(sessionFile);
in = new BufferedInputStream(in);
ObjectInputStream ois = new EjbObjectInputStream(in);
Object state = ois.readObject();
ois.close();
sessionFile.delete();
return state;
} else {
logger.info("Activation failed: file not found " + sessionFile);
return null;