/** * @see javax.servlet.Servlet#init(javax.servlet.ServletConfig) */ @Override public synchronized void init(ServletConfig config) throws ServletException { super.init(config); try { // upgrade the runlevel // usually this should have already been done by the context listener // however, after a fresh install / setup this will be done from here OpenCmsCore.getInstance().upgradeRunlevel(config.getServletContext()); // finalize OpenCms initialization OpenCmsCore.getInstance().initServlet(this); } catch (CmsInitException e) { if (Messages.ERR_CRITICAL_INIT_WIZARD_0.equals(e.getMessageContainer().getKey())) { // if wizard is still enabled - allow retry of initialization (required for setup wizard) // this means the servlet init() call must be terminated by an exception if (CmsServletContainerSettings.isServletThrowsException()) { throw new ServletException(e.getMessage()); } else { // this is needed since some servlet containers does not like the servlet to throw exceptions, // like BEA WLS 9.x and Resin LOG.error(Messages.get().getBundle().key(Messages.LOG_ERROR_GENERIC_0), e); } } } catch (Throwable t) { LOG.error(Messages.get().getBundle().key(Messages.LOG_ERROR_GENERIC_0), t); } }
/** * @see javax.servlet.Servlet#init(javax.servlet.ServletConfig) */ @Override public synchronized void init(ServletConfig config) throws ServletException { super.init(config); try { // upgrade the runlevel // usually this should have already been done by the context listener // however, after a fresh install / setup this will be done from here OpenCmsCore.getInstance().upgradeRunlevel(config.getServletContext()); // finalize OpenCms initialization OpenCmsCore.getInstance().initServlet(this); } catch (CmsInitException e) { if (Messages.ERR_CRITICAL_INIT_WIZARD_0.equals(e.getMessageContainer().getKey())) { // if wizard is still enabled - allow retry of initialization (required for setup wizard) // this means the servlet init() call must be terminated by an exception if (CmsServletContainerSettings.isServletThrowsException()) { throw new ServletException(e.getMessage()); } else { // this is needed since some servlet containers does not like the servlet to throw exceptions, // like BEA WLS 9.x and Resin LOG.error(Messages.get().getBundle().key(Messages.LOG_ERROR_GENERIC_0), e); } } } catch (Throwable t) { LOG.error(Messages.get().getBundle().key(Messages.LOG_ERROR_GENERIC_0), t); } }