use of com.netflix.exhibitor.standalone.MissingConfigurationTypeException in project exhibitor by soabase.
the class ExhibitorServletContextListener method contextInitialized.
@Override
public void contextInitialized(ServletContextEvent event) {
Map<String, String> argsBuilder = makeArgsBuilder();
try {
exhibitorCreator = new ExhibitorCreator(toArgsArray(argsBuilder));
exhibitor = new Exhibitor(exhibitorCreator.getConfigProvider(), null, exhibitorCreator.getBackupProvider(), exhibitorCreator.getBuilder().build());
exhibitor.start();
event.getServletContext().setAttribute(ExhibitorServletContextListener.class.getName(), exhibitor);
} catch (MissingConfigurationTypeException exit) {
log.error("Configuration type (" + OUR_PREFIX + ExhibitorCLI.CONFIG_TYPE + ") must be specified");
exit.getCli().logHelp(OUR_PREFIX);
throw new RuntimeException(exit);
} catch (ExhibitorCreatorExit exit) {
if (exit.getError() != null) {
log.error(exit.getError());
}
exit.getCli().logHelp(OUR_PREFIX);
throw new RuntimeException(exit);
} catch (Exception e) {
log.error("Trying to create Exhibitor", e);
throw new RuntimeException(e);
}
}
Aggregations