factory = new ClassPathXmlApplicationContext(configurationFile);
}
// get the main service from the configuration file
String[] names = factory.getBeanNamesForType(Main.class);
Main main = null;
if (names.length == 0) {
throw new FatalStartupError("No bean of type: " + Main.class.getName() + " found in the bootstrap file: " + configurationFile, 10);
}
main = (Main) factory.getBean(names[0]);
return main;