Examples of StartupException


Examples of org.ofbiz.base.start.StartupException

        this.configFile = config.containerConfig;
        Collection<ContainerConfig.Container> containers = null;
        try {
            containers = ContainerConfig.getContainers(configFile);
            if (UtilValidate.isEmpty(containers)) {
                throw new StartupException("No containers loaded; problem with configuration");
            }
        } catch (ContainerException e) {
            throw new StartupException(e);
        }
        for (ContainerConfig.Container containerCfg : containers) {
            if (this.unloading) {
                return;
            }
            Container tmpContainer = loadContainer(containerCfg, args);
            this.loadedContainers.add(tmpContainer);
            containerMap.put(containerCfg.name, tmpContainer);

            // TODO: Put container-specific code in the container.
            // This is only used in case of OFBiz running in Geronimo or WASCE. It allows to use the RMIDispatcher
            if (containerCfg.name.equals("rmi-dispatcher") && configFile.equals("limited-containers.xml")) {
                try {
                    ContainerConfig.Container.Property initialCtxProp = containerCfg.getProperty("use-initial-context");
                    String useCtx = initialCtxProp == null || initialCtxProp.value == null ? "false" : initialCtxProp.value;
                    if (!useCtx.equalsIgnoreCase("true")) {
                        //system.setProperty("java.security.policy", "client.policy"); maybe used if needed...
                        if (System.getSecurityManager() == null) { // needed by WASCE with a client.policy file.
                            System.setSecurityManager(new java.rmi.RMISecurityManager());
                        }
                        tmpContainer.start();
                    }
                } catch (ContainerException e) {
                    throw new StartupException("Cannot start() " + tmpContainer.getClass().getName(), e);
                } catch (java.lang.AbstractMethodError e) {
                    throw new StartupException("Cannot start() " + tmpContainer.getClass().getName(), e);
                }
            }
        }
        if (this.unloading) {
            return;
        }
        // Get hot-deploy container configuration files
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        Enumeration<URL> resources;
        try {
            resources = loader.getResources("hot-deploy-containers.xml");
            while (resources.hasMoreElements() && !this.unloading) {
                URL xmlUrl = resources.nextElement();
                Debug.logInfo("Loading hot-deploy containers from " + xmlUrl, module);
                Collection<ContainerConfig.Container> hotDeployContainers = ContainerConfig.getContainers(xmlUrl);
                for (ContainerConfig.Container containerCfg : hotDeployContainers) {
                    if (this.unloading) {
                        return;
                    }
                    Container tmpContainer = loadContainer(containerCfg, args);
                    this.loadedContainers.add(tmpContainer);
                    containerMap.put(containerCfg.name, tmpContainer);
                }
            }
        } catch (Exception e) {
            Debug.logError(e, "Could not load hot-deploy-containers.xml", module);
            throw new StartupException(e);
        }
        loaded = true;
    }
View Full Code Here

Examples of org.olat.core.logging.StartupException

       
        if (portlet instanceof OLATExtension) {
          try {
            extMgr.deployExtension((OLATExtension)portlet);
          } catch (IOException ioe) {
            throw new StartupException("Error deploying bean '" + portlet + "'.", ioe);
          }
        }
      }
    }
    catch (ClassCastException cce) {
        throw new StartupException("Configured portlet is not of type portlet", cce);
    }
   
  }
View Full Code Here

Examples of org.olat.core.logging.StartupException

        if (portal instanceof OLATExtension) {
          try {
            extMgr.deployExtension((OLATExtension)portal);
          } catch (IOException ioe) {
            throw new StartupException("Error deploying bean '" + portal + "'.", ioe);
          }
        }
      }
    }
    catch (ClassCastException cce) {
        throw new StartupException("Configured portlet is not of type portal", cce);
    }
  }
View Full Code Here

Examples of org.olat.core.logging.StartupException

        FolderConfig.setFolderRoot(homesRoot + "_junittest");
      } else {
        FolderConfig.setFolderRoot(homesRoot);
      }
    } catch (Exception e) {
      throw new StartupException("Unable to find folder root config. Please fix!", e);
    }
    Tracing.logInfo("Folder root set to '" + FolderConfig.getCanonicalRoot() + "'.", FolderModule.class);

    // Set maximum upload filesize
    try {
View Full Code Here

Examples of org.olat.core.logging.StartupException

  public void destroy() {
    try {
      // closing database session for this thread
      DBImpl.getInstance(false).closeSession()
    } catch (Exception e) {
      throw new StartupException("Error closing database. ", e.getCause());
    }
  }
View Full Code Here

Examples of org.olat.core.logging.StartupException

      }
     
      // test database settings, if something is wrong we will get exception here
      DBFactory.getInstance()
    } catch (Exception e) {
      throw new StartupException("Database mapping problem. Check your build.properties for valid entries. Empty values can cause problems!", e);
    }
    DBImpl.getInstance(false).intermediateCommit();
  }
View Full Code Here

Examples of org.olat.core.logging.StartupException

  /**
   * [spring]
   * @param instanceId
   */
  public void setInstanceId(String instanceId) {
    if (instanceId == null) throw new StartupException("No instance id set for this installation (see build.properties). Please fix!");
    if (instanceId.length() > 10) throw new StartupException("InstanceID is limited to 10 characters (see build.properties). Please fix!", null);
    WebappHelper.instanceId = instanceId;
  }
View Full Code Here

Examples of org.olat.core.logging.StartupException

   * @param userDataRoot
   */
  public void setUserDataRoot(String userDataRoot) {
    File fUserData = new File(userDataRoot);
    if (!fUserData.exists()) {
      if (!fUserData.mkdirs()) throw new StartupException("Unable to create userdata dir '" + userDataRoot + "'. Please fix!");
    }
    WebappHelper.userDataRoot = userDataRoot;
  }
View Full Code Here

Examples of org.olat.core.logging.StartupException

          if (regexp.startsWith("##")) continue;
          else {
            try {
              Pattern.compile(regexp);
            } catch (PatternSyntaxException pse) {
              throw new StartupException("Invalid pattern syntax in blacklist. Pattern: " + regexp);
            }
            loginBlacklist.add(regexp);
            count++;
          }
        }
        Tracing.logInfo("Successfully added " + count + " entries to login blacklist.", UserModule.class);
      } catch (Exception e) {
        throw new StartupException("Unable to read blacklist. Please fix.");
      } finally {
        if (fReader != null) try {
          fReader.close();
        } catch (Exception e) {
          // ok in finally block.
        }
      }
    }

    // Autogeneration of test users
    String generateTestUsers = configuration.getChildValue("generateTestUsers");
    if (generateTestUsers == null) hasTestUsers = false;
    else {
      if (generateTestUsers.equals("true")) {
        hasTestUsers = true;
      } else if (generateTestUsers.equals("false")) {
        hasTestUsers = false;
      } else {
        throw new StartupException("UserModule configuration Element 'generateTestUsers' was set to '" + generateTestUsers
            + "' but only value 'true' or 'false' is allowed.");
      }
    }
    // Check if default users exists, if not create them
    securityManager = ManagerFactory.getManager();
View Full Code Here

Examples of org.olat.core.logging.StartupException

        propertyDefined = true;
        break;
      }
    }
    if ( ! propertyDefined) {
      throw new StartupException("The user property handler for the mandatory user property "
        + userPropertyIdentifyer + " is not defined. Check your olat_userconfig.xml file!");
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.