use of org.openmrs.util.DatabaseUpdateException in project openmrs-core by openmrs.
the class Listener method startOpenmrs.
/**
* Do the work of starting openmrs.
*
* @param servletContext
* @throws ServletException
*/
public static void startOpenmrs(ServletContext servletContext) throws ServletException {
// start openmrs
try {
// load bundled modules that are packaged into the webapp
Listener.loadBundledModules(servletContext);
Context.startup(getRuntimeProperties());
} catch (DatabaseUpdateException | InputRequiredException updateEx) {
throw new ServletException("Should not be here because updates were run previously", updateEx);
} catch (MandatoryModuleException mandatoryModEx) {
throw new ServletException(mandatoryModEx);
} catch (OpenmrsCoreModuleException coreModEx) {
// in the StartupErrorFilter class
throw coreModEx;
}
try {
// web load modules
Listener.performWebStartOfModules(servletContext);
// start the scheduled tasks
SchedulerUtil.startup(getRuntimeProperties());
} catch (Exception t) {
Context.shutdown();
WebModuleUtil.shutdownModules(servletContext);
throw new ServletException(t);
} finally {
Context.closeSession();
}
}
Aggregations