Package org.olat.core.logging

Examples of org.olat.core.logging.StartupException


    if (attrTransConfig != null) {
      List transList = attrTransConfig.getChildren();
      for (Iterator iter = transList.iterator(); iter.hasNext();) {
        Configuration attributeTranslation = (Configuration)iter.next();
        if (!attributeTranslation.getName().equals(CONF_ATTRIBUTE)) {
          throw new StartupException("Invalid child config element: " + attributeTranslation);
        }
        String inname = attributeTranslation.getAttribute(CONF_ATTRIBUTE_INNAME);
        String outname = attributeTranslation.getAttribute(CONF_ATTRIBUTE_OUTNAME);
        attributeTranslations.put(inname, outname);
        // check if this attribute has predefined values
View Full Code Here


  public UniqueIdentifierMapper(Configuration uidConfig) {
    uniqueIdentifierMap = new HashMap();
    Configuration defaultUidConfig = uidConfig.getChild(CONF_UNIQUEIDENTIFIERS_DEFAULT);
    if (defaultUidConfig == null)
      throw new StartupException("Missing default unique identifier. Please fix!");
    defaultUniqueIdentifier = defaultUidConfig.getAttribute(CONF_UNIQUEIDENTIFIERS_UIDATTRIBUTE);
    List originUidConfig = uidConfig.getChildren(CONF_UNIQUEIDENTIFIERS_ORIGINSITE);
    if (originUidConfig != null) { // fetch origin specific uidAttributes
      for (Iterator iter = originUidConfig.iterator(); iter.hasNext();) {
        Configuration originSite = (Configuration) iter.next();
View Full Code Here

        deleteStmt.addBatch(query_sub);
        deleteStmt.addBatch(query_pub);
        deleteStmt.executeBatch();
      } catch (ClassNotFoundException e){
        log.warn("Could not load jdbc driver for database configured in olat_config.xml. Driver: "+ driverClass, e);
        throw new StartupException("Could not load jdbc driver for database configured in olat_config.xml. Driver: "+ driverClass, e);
      catch (SQLException e) {
        log.warn("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
        log.warn("%%%          Please upgrade your database!          %%%");
        log.warn("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
        log.warn("Could not execute system upgrade! Your database does not support the following syntax: 'WHERE experession IN (subquery)'."
                      + "First query: "+ query_sub +" Second query: "+ query_pub,
                        e);
      } finally {
        try {
          deleteStmt.close();
        } catch (SQLException e2){
          log.warn("Could not close sql delete statement of system upgrade 5.1.0", e2);
          throw new StartupException("Could not close sql delete statement of system upgrade 5.1.0", e2);
        } finally {
          try {
            con.close();
          } catch (SQLException e3){
            log.warn("Could not close db connection.", e3);
            throw new StartupException("Could not close db connection.", e3);
          }
        }
      }
      cleaned = true;
      uhd.setBooleanDataValue(TASK_CLEAN_UP_OF_PUB_AND_SUB_OF_RETURNBOXES_DONE, cleaned);
View Full Code Here

       
        con.close();
        con = null;
      } catch (ClassNotFoundException e) {
        Tracing.logWarn("Could not load jdbc driver for database configured in olat_config.xml. Driver: "+ driverClass, e, OLATUpgrade_4_1_0.class);
        throw new StartupException("Could not load jdbc driver for database configured in olat_config.xml. Driver: "+ driverClass, e);
      } catch (SQLException e) {
        Tracing.logWarn("Could not execute system upgrade sql query. Query:"+ query, e, OLATUpgrade_4_1_0.class);
        throw new StartupException("Could not execute system upgrade sql query. Query:"+ query, e);
      }
      uhd.setBooleanDataValue(TASK_CLEAN_UP_MSGREAD_PROPERTIES_DONE, true);
      upgradeManager.setUpgradesHistory(uhd, VERSION);
    }
  }
View Full Code Here

        // pls review and change appropriately - here for the time being is a "workback" solution
        // inlined to try the original setting (based on a cvs diff -r1.35 -r1.36)
        configurationFile = new File(new File(servletContext.getRealPath("/")), "WEB-INF/" + CONFIG_FILE);
        // ...and if this does not work then we really cannot find the file :) so new semantics are preserved
        if(!configurationFile.canRead()) {
          throw new StartupException("cannot read file! file = "+configurationFile.getAbsolutePath());
        }
      } else {
        log.info("parsing configuration file now: "+configurationFile.getAbsolutePath());
      }
      try {
View Full Code Here

   *
   * @param e
   */
  private void abort(Throwable e) {
    if (e instanceof StartupException) {
      StartupException se = (StartupException) e;
      log.error("Startup Exception! ", se);
    }
    //DB.getInstance().rollback();
    log.error("*** CRITICAL ERROR. Loading aborted.",e);
    throw new RuntimeException(e);
View Full Code Here

   * given state of configuration.
   * @param e
   */
  protected void abort(Throwable e) {
    if (e instanceof StartupException) {
      StartupException se = (StartupException) e;
      log.warn("Message: " + se.getLogMsg());
      Throwable cause = se.getCause();
      log.warn("Cause: " + (cause != null ? cause.getMessage() : "n/a"));
    }
    throw new RuntimeException("*** CRITICAL ERROR IN UPGRADE MANAGER. Loading aborted.", e);
  }
View Full Code Here

      if (f.isAbsolute()) {
        setRoot(rootConf);
      } else {
        setRoot(WebappHelper.getContextRoot() + "/" + rootConf);
      }
    } else throw new StartupException("ContextHelpFilePathHandler did not find mandatory <root> element:" + config.getName());
  }
View Full Code Here

  /**
   * @see org.olat.commons.servlets.pathhandlers.PathHandler#init(com.anthonyeden.lib.config.Configuration)
   */
  public void init(Configuration config) {
    String rootConf = config.getChildValue("root");
    if (rootConf == null) throw new StartupException("child 'root' missing in config for filepathhandler");
    File f = new File(rootConf);
    if (f.isAbsolute()) setRoot(rootConf);
    else {
      setRoot(WebappHelper.getContextRoot() + "/" + rootConf);
    }
View Full Code Here

      Statement selectStmt = con.createStatement();
      selectStmt.executeQuery(checkVersionQuery);
     return;
    } catch (ClassNotFoundException e) {
      log.warn("Could not load jdbc driver for database configured in olat_config.xml. Driver: "+ driverClass, e);
      throw new StartupException("Could not load jdbc driver for database configured in olat_config.xml. Driver: "+ driverClass, e);
    } catch (SQLException e){
      log.warn("Version before 5.1.1 detected! Continue running upgrade for 5.1.1 ...", e);
    }
   
    String query = "select u.firstname, u.lastname, u.email from o_property as p, o_bs_identity as i, o_user as u " +
                   "where p.name = 'v2guipreferences' " +
                   "and p.textvalue like '%<int>2_</int>%' " +
                   "and p.identity = i.id " +
                   "and i.fk_user_id = u.user_id;";
    try {
      Class.forName(driverClass);
      Connection con = DriverManager.getConnection(dbUrl, username, password);
      Statement selectStmt = con.createStatement();
      ResultSet res = selectStmt.executeQuery(query);

      while (res.next()){
        log.audit(res.getString(1)+", "+res.getString(2)+", "+res.getString(3)+" ");
      }
     
    } catch (ClassNotFoundException e) {
      log.warn("Could not load jdbc driver for database configured in olat_config.xml. Driver: "+ driverClass, e);
      throw new StartupException("Could not load jdbc driver for database configured in olat_config.xml. Driver: "+ driverClass, e);
    } catch (SQLException e) {
      log.warn("Could not execute system upgrade sql query. Query:"+ query, e);
      throw new StartupException("Could not execute system upgrade sql query. Query:"+ query, e);
    }
  }
View Full Code Here

TOP

Related Classes of org.olat.core.logging.StartupException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.