Search in sources :

Example 1 with DatabaseUpdateException

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();
    }
}
Also used : ServletException(javax.servlet.ServletException) InputRequiredException(org.openmrs.util.InputRequiredException) DatabaseUpdateException(org.openmrs.util.DatabaseUpdateException) OpenmrsCoreModuleException(org.openmrs.module.OpenmrsCoreModuleException) MandatoryModuleException(org.openmrs.module.MandatoryModuleException) ServletException(javax.servlet.ServletException) DatabaseUpdateException(org.openmrs.util.DatabaseUpdateException) InputRequiredException(org.openmrs.util.InputRequiredException) ModuleMustStartException(org.openmrs.module.ModuleMustStartException) OpenmrsCoreModuleException(org.openmrs.module.OpenmrsCoreModuleException) BeanCreationException(org.springframework.beans.factory.BeanCreationException) MandatoryModuleException(org.openmrs.module.MandatoryModuleException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 ServletException (javax.servlet.ServletException)1 MandatoryModuleException (org.openmrs.module.MandatoryModuleException)1 ModuleMustStartException (org.openmrs.module.ModuleMustStartException)1 OpenmrsCoreModuleException (org.openmrs.module.OpenmrsCoreModuleException)1 DatabaseUpdateException (org.openmrs.util.DatabaseUpdateException)1 InputRequiredException (org.openmrs.util.InputRequiredException)1 BeanCreationException (org.springframework.beans.factory.BeanCreationException)1