Package org.exoplatform.container.configuration

Examples of org.exoplatform.container.configuration.ConfigurationException


   {

      ValueParam bnParam = params.getValueParam("bind-name");
      if (bnParam == null)
      {
         throw new ConfigurationException("No 'bind-name' parameter found");
      }
      ValueParam cnParam = params.getValueParam("class-name");
      if (cnParam == null)
      {
         throw new ConfigurationException("No 'class-name' parameter found");
      }
      ValueParam factoryParam = params.getValueParam("factory");
      if (factoryParam == null)
      {
         throw new ConfigurationException("No 'factory' parameter found");
      }
      ValueParam flParam = params.getValueParam("factory-location");
      String factoryLocation;
      if (flParam != null)
         factoryLocation = flParam.getValue();
View Full Code Here


    */
   public DBCreator(InitParams params, ConfigurationManager cm) throws ConfigurationException
   {
      if (params == null)
      {
         throw new ConfigurationException("Initializations parameters expected");
      }

      PropertiesParam prop = params.getPropertiesParam(CONNECTION_PROPERTIES);

      if (prop != null)
      {
         if (prop.getProperty(DRIVER_NAME) == null)
         {
            throw new ConfigurationException("driverClassName expected in db-connection properties section");
         }

         serverUrl = prop.getProperty(SERVER_URL);
         if (serverUrl == null)
         {
            throw new ConfigurationException("url expected in db-connection properties section");
         }

         if (prop.getProperty(USERNAME) == null)
         {
            throw new ConfigurationException("username expected in db-connection properties section");
         }

         if (prop.getProperty(PASSWORD) == null)
         {
            throw new ConfigurationException("password expected in db-connection properties section");
         }

         // Store all connection properties into single map         
         Iterator<Property> pit = prop.getPropertyIterator();
         connectionProperties = new HashMap<String, String>();
         while (pit.hasNext())
         {
            Property p = pit.next();
            if (!p.getName().equalsIgnoreCase(SERVER_URL))
            {
               connectionProperties.put(p.getName(), p.getValue());
            }
         }
      }
      else
      {
         throw new ConfigurationException("db-connection properties expected in initializations parameters");
      }

      prop = params.getPropertiesParam(DB_CREATION_PROPERTIES);
      if (prop != null)
      {
         String scriptPath = prop.getProperty(DB_SCRIPT_PATH);
         if (scriptPath != null)
         {
            this.dbScript = readScript(scriptPath, cm);
         }
         else
         {
            throw new ConfigurationException("scriptPath expected in db-creation properties section");
         }

         this.dbUserName = prop.getProperty(DB_USERNAME);
         if (dbUserName == null)
         {
            throw new ConfigurationException("username expected in db-creation properties section");
         }

         this.dbPassword = prop.getProperty(DB_PASSWORD);
         if (dbPassword == null)
         {
            throw new ConfigurationException("password expected in db-creation properties section");
         }
      }
      else
      {
         throw new ConfigurationException("db-creation properties expected in initializations parameters");
      }
   }
View Full Code Here

         {
            return IOUtil.getFileContentAsString(scriptPath);
         }
         catch (IOException ioe)
         {
            throw new ConfigurationException("Can't read script at " + scriptPath, e);
         }
      }
   }
View Full Code Here

    */
   public DBCreator(InitParams params) throws ConfigurationException
   {
      if (params == null)
      {
         throw new ConfigurationException("Initializations parameters expected");
      }

      PropertiesParam prop = params.getPropertiesParam(DB_CONNECTION);

      if (prop != null)
      {
         if (prop.getProperty(DB_DRIVER) == null)
         {
            throw new ConfigurationException("driverClassName expected in db-connection properties section");
         }

         serverUrl = prop.getProperty(DB_URL);
         if (serverUrl == null)
         {
            throw new ConfigurationException("url expected in db-connection properties section");
         }

         if (prop.getProperty(DB_USERNAME) == null)
         {
            throw new ConfigurationException("username expected in db-connection properties section");
         }

         if (prop.getProperty(DB_PASSWORD) == null)
         {
            throw new ConfigurationException("password expected in db-connection properties section");
         }

         // Store all connection properties into single map         
         Iterator<Property> pit = prop.getPropertyIterator();
         connectionProperties = new HashMap<String, String>();
         while (pit.hasNext())
         {
            Property p = pit.next();
            if (!p.getName().equalsIgnoreCase(DB_URL))
            {
               connectionProperties.put(p.getName(), p.getValue());
            }
         }
      }
      else
      {
         throw new ConfigurationException("db-connection properties expected in initializations parameters");
      }

      prop = params.getPropertiesParam(DB_CREATION);
      if (prop != null)
      {
         String scriptPath = prop.getProperty(DB_SCRIPT_PATH);
         if (scriptPath != null)
         {
            try
            {
               dbScript = readScriptResource(scriptPath);
            }
            catch (IOException e)
            {
               throw new ConfigurationException("Can't read script resource " + scriptPath, e);
            }
         }
         else
         {
            throw new ConfigurationException("scriptPath expected in db-creation properties section");
         }

         this.dbUserName = prop.getProperty(DB_USERNAME);
         if (dbUserName == null)
         {
            throw new ConfigurationException("username expected in db-creation properties section");
         }

         this.dbPassword = prop.getProperty(DB_PASSWORD);
         if (dbPassword == null)
         {
            throw new ConfigurationException("password expected in db-creation properties section");
         }
      }
      else
      {
         throw new ConfigurationException("db-creation properties expected in initializations parameters");
      }
   }
View Full Code Here

    */
   public DBCreator(InitParams params, ConfigurationManager configurationManager) throws ConfigurationException
   {
      if (params == null)
      {
         throw new ConfigurationException("Initializations parameters expected");
      }

      PropertiesParam prop = params.getPropertiesParam(DB_CONNECTION);

      if (prop != null)
      {
         if (prop.getProperty(DB_DRIVER) == null)
         {
            throw new ConfigurationException("driverClassName expected in db-connection properties section");
         }

         serverUrl = prop.getProperty(DB_URL);
         if (serverUrl == null)
         {
            throw new ConfigurationException("url expected in db-connection properties section");
         }

         if (prop.getProperty(DB_USERNAME) == null)
         {
            throw new ConfigurationException("username expected in db-connection properties section");
         }

         if (prop.getProperty(DB_PASSWORD) == null)
         {
            throw new ConfigurationException("password expected in db-connection properties section");
         }

         // Store all connection properties into single map         
         Iterator<Property> pit = prop.getPropertyIterator();
         connectionProperties = new HashMap<String, String>();
         while (pit.hasNext())
         {
            Property p = pit.next();
            if (!p.getName().equalsIgnoreCase(DB_URL))
            {
               connectionProperties.put(p.getName(), p.getValue());
            }
         }
      }
      else
      {
         throw new ConfigurationException("db-connection properties expected in initializations parameters");
      }

      prop = params.getPropertiesParam(DB_CREATION);
      if (prop != null)
      {
         String scriptPath = prop.getProperty(DB_SCRIPT_PATH);
         if (scriptPath != null)
         {
            String dbScript;
            try
            {
               dbScript = readScriptResource(configurationManager.getInputStream(scriptPath));
            }
            catch (Exception e)
            {
               try
               {
                  dbScript = readScriptResource(PrivilegedFileHelper.fileInputStream(scriptPath));
               }
               catch (IOException ioe)
               {
                  throw new ConfigurationException("Can't read script resource " + scriptPath, e);
               }
            }
            this.dbScript = dbScript;
         }
         else
         {
            throw new ConfigurationException("scriptPath expected in db-creation properties section");
         }

         this.dbUserName = prop.getProperty(DB_USERNAME);
         if (dbUserName == null)
         {
            throw new ConfigurationException("username expected in db-creation properties section");
         }

         this.dbPassword = prop.getProperty(DB_PASSWORD);
         if (dbPassword == null)
         {
            throw new ConfigurationException("password expected in db-creation properties section");
         }
      }
      else
      {
         throw new ConfigurationException("db-creation properties expected in initializations parameters");
      }
   }
View Full Code Here

      this.cacheHandler = new JCRCacheHandler(cservice, this, cacheEnabled);

      if (initParams == null)
      {
         throw new ConfigurationException("Initialization parameters expected !!!");
      }

      // create DAO object
      membershipDAO_ = new MembershipHandlerImpl(this);
      groupDAO_ = new GroupHandlerImpl(this);
View Full Code Here

    */
   public DBCreator(InitParams params, ConfigurationManager cm) throws ConfigurationException
   {
      if (params == null)
      {
         throw new ConfigurationException("Initializations parameters expected");
      }

      PropertiesParam prop = params.getPropertiesParam(CONNECTION_PROPERTIES);

      if (prop != null)
      {
         if (prop.getProperty(DRIVER_NAME) == null)
         {
            throw new ConfigurationException("driverClassName expected in db-connection properties section");
         }

         serverUrl = prop.getProperty(SERVER_URL);
         if (serverUrl == null)
         {
            throw new ConfigurationException("url expected in db-connection properties section");
         }

         if (prop.getProperty(USERNAME) == null)
         {
            throw new ConfigurationException("username expected in db-connection properties section");
         }

         if (prop.getProperty(PASSWORD) == null)
         {
            throw new ConfigurationException("password expected in db-connection properties section");
         }

         // Store all connection properties into single map         
         Iterator<Property> pit = prop.getPropertyIterator();
         connectionProperties = new HashMap<String, String>();
         while (pit.hasNext())
         {
            Property p = pit.next();
            if (!p.getName().equalsIgnoreCase(SERVER_URL))
            {
               connectionProperties.put(p.getName(), p.getValue());
            }
         }
      }
      else
      {
         throw new ConfigurationException("db-connection properties expected in initializations parameters");
      }

      prop = params.getPropertiesParam(DB_CREATION_PROPERTIES);
      if (prop != null)
      {
         String scriptPath = prop.getProperty(DB_SCRIPT_PATH);
         if (scriptPath != null)
         {
            this.dbScript = findScriptResource(scriptPath, cm);
         }
         else
         {
            throw new ConfigurationException("scriptPath expected in db-creation properties section");
         }

         this.dbUserName = prop.getProperty(DB_USERNAME);
         if (dbUserName == null)
         {
            throw new ConfigurationException("username expected in db-creation properties section");
         }

         this.dbPassword = prop.getProperty(DB_PASSWORD);
         if (dbPassword == null)
         {
            throw new ConfigurationException("password expected in db-creation properties section");
         }
      }
      else
      {
         throw new ConfigurationException("db-creation properties expected in initializations parameters");
      }
   }
View Full Code Here

         {
            return readResource(PrivilegedFileHelper.fileInputStream(scriptPath));
         }
         catch (IOException ioe)
         {
            throw new ConfigurationException("Can't read script resource " + scriptPath, e);
         }
      }
   }
View Full Code Here

      this.registryService = registryService;
      this.cacheHandler = new JCRCacheHandler(cservice, this);

      if (initParams == null)
      {
         throw new ConfigurationException("Initialization parameters expected !!!");
      }

      this.initParams = initParams;

      // create DAO object
View Full Code Here

         }
      }

      if (is == null)
      {
         throw new ConfigurationException("Could not open input stream for db script "
            + cl.getResource(scriptFileParam.getValue()));
      }

      try
      {
View Full Code Here

TOP

Related Classes of org.exoplatform.container.configuration.ConfigurationException

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.