Package org.olat.core.logging

Examples of org.olat.core.logging.OLATRuntimeException


    // viewIdentifier contains key of tab to be activated
    TabbedPane myTabbedPane = getTabbedPane();
    Translator translator = getTranslator();
    String[] paneKeys = getPaneKeys();

    if (myTabbedPane == null) { throw new OLATRuntimeException("tabs not yet added!", new IllegalStateException()); }
    boolean foundKey = false;
    if (paneKeys.length > 0) {
      int i = 0;
      while (!foundKey && i<paneKeys.length) {
        foundKey = viewIdentifier.equals(paneKeys[i]);
View Full Code Here


  public VFSLeafHandler(VFSLeaf vfsLeaf, Formatter formatter) {
    setFormatter(formatter);
    try {
      setEncoding("utf8");
    } catch (SecurityException e) {
      throw new OLATRuntimeException(this.getClass(), "Error when setting encoding of to 'utf8' ",e);
    } catch (UnsupportedEncodingException e) {
      throw new OLATRuntimeException(this.getClass(), "Error when setting encoding of to 'utf8' ",e);
    }
    this.vfsLeaf = vfsLeaf;
  }
View Full Code Here

            // let all extensions add hibernate configuration, if needed
            ExtManager extm = null;
            try {
              extm = ExtManager.getInstance();
            } catch (Exception e) {
              throw new OLATRuntimeException(this.getClass(), "Can not load extensions. Check xml files.", e);
            }
            Class extensionPoint = this.getClass();
            int cnt = extm.getExtensionCnt();
            for (int i = 0; i < cnt; i++) {
              Extension anExt = extm.getExtension(i);
              HibernateConfigurator hibconfigure = (HibernateConfigurator) anExt.getExtensionFor(extensionPoint.getName());
              if (hibconfigure != null) {
                hibconfigure.extend(cfg);
                extm.inform(extensionPoint, anExt, "added hibernate configuration");
              }
            }

            // set audit interceptor that traces lastChanged
            cfg.setInterceptor(new AuditInterceptor());
            cfg.setProperties(getConnectionProperties());

            sessionFactory = cfg.buildSessionFactory();
            registerStatisticsServiceAsMBean(sessionFactory);
            try {
              String lev = "n/a";
              session = sessionFactory.openSession();
              int iso = session.connection().getTransactionIsolation();
              switch (iso) {
                case Connection.TRANSACTION_READ_COMMITTED:
                  lev = "TRANSACTION_READ_COMMITTED";
                  break;
                case Connection.TRANSACTION_READ_UNCOMMITTED:
                  lev = "TRANSACTION_READ_UNCOMMITTED";
                  break;
                case Connection.TRANSACTION_REPEATABLE_READ:
                  lev = "TRANSACTION_REPEATABLE_READ";
                  break;
                case Connection.TRANSACTION_SERIALIZABLE:
                  lev = "TRANSACTION_SERIALIZABLE";
                  break;
              }
              session.close();
              logInfo("Transaction Level::::" + lev, null);
            } catch (SQLException e) {
              throw new DBRuntimeException("could not get TransactionIsolationLevel from db", e);
            }
          }
        }
        initializeSession();
        // else we have an DBSession in the current thread, but check if
        // session was closed
      } else if (!dbs.isOpen()) {
        initializeSession();
      }
      setInitialized(true);
    } catch (HibernateException he) {
      throw new OLATRuntimeException(DBImpl.class, "current session could not be obtained", he);
    } finally {
      if (isLogDebugEnabled()) logDebug("createSession finally...", null);
    }
    if (isLogDebugEnabled()) logDebug("createSession end...", null);
  }
View Full Code Here

            if (isDebugLog) {
              long rstop = System.currentTimeMillis();
              long diff = rstop - rstart;
              debugMsg.append("render:").append(diff).append(LOG_SEPARATOR);
            }
            if (renderResult.getRenderException() != null) throw new OLATRuntimeException(Window.class, renderResult.getLogMsg(),
                renderResult.getRenderException());
   
            // after rendering we know if some component awaits further async
            // calls
            // like images, so get a handler
View Full Code Here

                  debugMsg.append(toRender.getComponentName()).append(":").append((pstop - pstart));
                  if (i < dCnt - 1)
                    debugMsg.append(",");
                }
              } catch (Exception e) {
                throw new OLATRuntimeException(Window.class,renderResult.getLogMsg(), renderResult.getRenderException());
              } finally {
                toRender.setDomReplaceable(true);
              }
              if (renderResult.getRenderException() != null) throw new OLATRuntimeException(Window.class, renderResult.getLogMsg(),
                  renderResult.getRenderException());
             
              AsyncMediaResponsible curAmr = renderResult.getAsyncMediaResponsible();
              if (curAmr != null) {
                if (amr != null) {
View Full Code Here

      // the
      // gui tree was changed by another thread in the meantime.
      // do not throw an exception here, because this can happen if the gui
      // tree was changed by another thread in the meantime
    }
    if (!target.isVisible()) { throw new OLATRuntimeException(Window.class, "target with name: '" + target.getComponentName()
        + "', was invisible, but called to dispatch", null); }
    boolean toDispatch = true; //TODO:fj:c is foundpath needed for something else than the enabled-check. if no -> one boolean is enough
    for (Iterator iter = foundPath.iterator(); iter.hasNext();) {
      Component curComp = (Component) iter.next();
      if (!curComp.isEnabled()) {
View Full Code Here

   *      org.olat.core.gui.render.RenderResult, java.lang.String[])
   */
  public void render(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator,
      RenderResult renderResult, String[] args) {
    // nothing to render
    throw new OLATRuntimeException(HtmlHeaderRenderer.class, "render method should never be called for JsCssHeaderRenderer", null);
  }
View Full Code Here

          }
          DBFactory.getInstance(false).commitAndCloseSession();
          success = true;
      } catch (Exception e) {
        Tracing.logError("Exception in WebDAV request", e,  SecureWebdavServlet.class);
        throw new OLATRuntimeException(this.getClass(), "Exception in SecureWebDavServlet.", e);
      } catch (Error er) {
        Tracing.logError("Error in WebDAV request", er,  SecureWebdavServlet.class);
        throw new OLATRuntimeException(this.getClass(), "Error in SecureWebDavServlet.", er);
      } catch (Throwable er) {
        Tracing.logError("Throwable in WebDAV request", er,  SecureWebdavServlet.class);
        throw new OLATRuntimeException(this.getClass(), "Throwable in SecureWebDavServlet.", er);
    } finally {
      try {
        if (!success) {
          DBFactory.getInstance(false).rollbackAndCloseSession();
        }
View Full Code Here

      // Now finally create that user thing on the database with all
      // credentials, person etc. in one transation context!
      identity = ManagerFactory.getManager().createAndPersistIdentityAndUser(username, newUser, OLATAuthenticationController.PROVIDER_OLAT,
          username, Encoder.encrypt(pwd));
      if (identity == null) {
        throw new OLATRuntimeException(this.getClass(), "Error, could not create  user and subject with name " + username, null);
      } else {
        Boolean isGuest = Boolean.valueOf(user.getAttribute("isGuest"));
        Boolean isAuthor = Boolean.valueOf(user.getAttribute("isAuthor"));
        Boolean isAdmin = Boolean.valueOf(user.getAttribute("isAdmin"));
        Boolean isUserManager = Boolean.valueOf(user.getAttribute("isUserManager"));
View Full Code Here

      ScormPackageHandler pm = new ScormPackageHandler(this);
      if (!sequenceFile.exists() || pm.checkIfScormPackageHasChanged()) {
        try {
          pm.buildSettings();
        } catch (NoItemFoundException e) {
          throw new OLATRuntimeException(SettingsHandlerImpl.class, "Problem loading the reload-settings.xml file. No item found in scorm item sequence file!",e);
        }
      }
    } catch (JDOMException e) {
      throw new OLATRuntimeException(SettingsHandlerImpl.class, "Problem loading the reload-settings.xml file.",e);
    } catch (IOException e) {
      throw new OLATRuntimeException(SettingsHandlerImpl.class, "Problem loading the reload-settings.xml file.",e);
    }
    return sequenceFile;
  }
View Full Code Here

TOP

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

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.