Package org.olat.core.logging

Examples of org.olat.core.logging.StartupException


        updateStmt.addBatch(query_tc_tr);

        updateStmt.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("Could not execute system upgrade sql query composed of : "
            + query_cn_zh +" and "
            + query_cz_cs +" and "
            + query_dk_da +" and "
            + query_gr_el +" and "
            + query_pe_fa +" and "
            + query_tc_tr, e);
        throw new StartupException("Could not execute system upgrade sql query composed of : "
            + query_cn_zh +" and "
            + query_cz_cs +" and "
            + query_dk_da +" and "
            + query_gr_el +" and "
            + query_pe_fa +" and "
            + query_tc_tr, e);
      } finally {
        try {
          updateStmt.close();
        } catch (SQLException e2){
          log.warn("Could not close sql update statement of system upgrade 5.1.1", e2);
          throw new StartupException("Could not close sql update statement of system upgrade 5.1.1", 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);
          }
        }
      }

      uhd.setBooleanDataValue(TASK_UPDATE_LANGUAGE_ACCORDING_ISO936_DONE, true);
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.language, u.firstname, u.lastname, i.name " +
                   "from o_user as u, o_bs_identity as i " +
                   "where i.fk_user_id = u.user_id " +
                   "and (language='cn' or language='cz' or language='dk' or language='gr' or language='pe' or language='tc') order by language;";
   
    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)+", "+res.getString(4)+" ");
      }
     
    } 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

    return replaceStringForEmailAt;
  }
 
  public void setReplaceStringForEmailAt(String replaceStringForEmailAt) {
    if (replaceStringForEmailAt.contains("#") || replaceStringForEmailAt.contains("%")) {
      throw new StartupException("do not use '#' or '%' as replace string as they get url encoded!");
    }
    this.replaceStringForEmailAt = replaceStringForEmailAt;
  }
View Full Code Here

      Tracing.logInfo("Added authentication Provider: name='"
        + authProvider.getName() + "' enabled='" + (authProvider.isEnabled() ? "yes" : "no") + "'.", LoginModule.class);
    }
    Configuration defProviderConf = moduleConfig.getChild("DefaultAuthProvider");
    if (defProviderConf == null)
      throw new StartupException("No DefaultAuthProvider defined. Please fix.");
    defaultProviderName = defProviderConf.getAttribute("name");
    if (defaultProviderName == null)
      throw new StartupException("No DefaultAuthProvider defined. Please fix.");
   
    AuthenticationProvider defaultProvider = getAuthenticationProvider(defaultProviderName);
    if (defaultProvider == null || !defaultProvider.isEnabled())
      throw new StartupException("Defined DefaultAuthProvider::" + defaultProviderName + " not existent or not enabled. Please fix.");
    Tracing.logInfo("Using default authentication provider '" + defaultProviderName + "'.", LoginModule.class);
   
    // check attack prevention
    Configuration attack_conf = moduleConfig.getChild(CONF_ATTACK);
    if (attack_conf != null) {
      String attack_enabled = attack_conf.getAttribute(CONF_ATTACK_ENABLED);
      if (attack_enabled != null &&
          (attack_enabled.toLowerCase().equals("true") || attack_enabled.toLowerCase().equals("yes"))) {
        attackPreventionEnabled = true;
        String attack_maxattempts = attack_conf.getAttribute(CONF_ATTACK_MAXATTEMPTS);
        String attack_timeoutmin = attack_conf.getAttribute(CONF_ATTACK_TIMEOUTMIN);
        try {
          attackPreventionMaxAttempts = Integer.parseInt(attack_maxattempts);
          attackPreventionTimeout = Integer.parseInt(attack_timeoutmin);
        } catch (NumberFormatException nfe) {
          throw new StartupException("Attribute 'attempts' and/or 'timeoutmin' of config Parameter AttackPrevention are either missing or not a number. Please fix!");
        }
        // configure timed cache default params: refresh 1 minute, timeout according to configuration
        failedLoginCache = CoordinatorManager.getCoordinator().getCacher().getOrCreateCache(this.getClass(), "blockafterfailedattempts");
       
        Tracing.logInfo("Attack prevention enabled. Max number of attempts: " + attack_maxattempts + ", timeout: " + attack_timeoutmin + " minutes.", LoginModule.class);
View Full Code Here

      for (Indexer indexer:indexerList) {
        childIndexers.put(indexer.getSupportedTypeName(), indexer);
        log.debug("Adding indexer from configuraton. TypeName=" + indexer.getSupportedTypeName());
      }
    }  catch (ClassCastException cce) {
        throw new StartupException("Configured indexer is not of type Indexer", cce);
    }
  }
View Full Code Here

      for (CourseNodeIndexer courseNodeIndexer : indexerList) {
        CourseNodeIndexerFactory.getInstance().registerIndexer(courseNodeIndexer);
        if (log.isDebug()) log.debug("Adding indexer from configuraton: ");
      }
    }  catch (ClassCastException cce) {
        throw new StartupException("Configured indexer is not of type RepositoryEntryIndexer", cce);
    }
  }
View Full Code Here

    clazz = providerConfig.getAttribute(CONF_CONTROLLERCLASS);
    enabled = providerConfig.getAttribute(CONF_ENABLED).equalsIgnoreCase("true")
      || providerConfig.getAttribute(CONF_ENABLED).equalsIgnoreCase("yes");
    // double check config
    if (name == null || clazz == null)
      throw new StartupException("Invalid AuthProvider: " + name + ". Please fix!");
    }
View Full Code Here

   * @param adminPassword
   * @param nodeId
   */
  private AdminUserConnection(String serverName, String adminUsername, String adminPassword, String nodeId, boolean enabled) {
    if (serverName == null || adminUsername == null || adminPassword == null) {
      throw new StartupException("Instant Messaging settings for admin user are not correct");
    }
    this.serverName = serverName;
    this.adminUsername = adminUsername;
    this.adminPassword = adminPassword;
    this.nodeId = nodeId;
View Full Code Here

      throw new AssertException(
          "Instant Messaging is enabled in olat.properties but could not connect with admin user. Does the admin user account exist on the IM server?: "
              + e.getMessage());
    }
    if (connection == null || !connection.isAuthenticated()) {
     throw new StartupException("could not connect to instant messaging server with admin user!");
    }
   
  }
View Full Code Here

  /**
   * [used by spring]
   * @param config
   */
  public IMNameHelper(IMConfig config, String instanceID) {
    if (config == null) throw new StartupException("IMConfig cannot be null!");
    this.config = config;
    this.instanceID = instanceID;
  }
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.