Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.ConfigurationException


    @Override
    public void validateConfiguration() throws ConfigurationException
    {
        if (getPolicyName() == null)
        {
            throw new ConfigurationException("No Slow consumer policy defined.");
        }
    }
View Full Code Here


            }

            //check the keystore path value is valid
            if (keyStorePath == null)
            {
                throw new ConfigurationException("JMX management SSL keystore path not defined, " +
                                             "unable to start SSL protected JMX ConnectorServer");
            }
            else
            {
                //ensure the system property is set
                System.setProperty("javax.net.ssl.keyStore", keyStorePath);

                //check the file is usable
                File ksf = new File(keyStorePath);

                if (!ksf.exists())
                {
                    throw new FileNotFoundException("Cannot find JMX management SSL keystore file: " + ksf);
                }
                if (!ksf.canRead())
                {
                    throw new FileNotFoundException("Cannot read JMX management SSL keystore file: "
                                                    + ksf +  ". Check permissions.");
                }

                CurrentActor.get().message(ManagementConsoleMessages.SSL_KEYSTORE(ksf.getAbsolutePath()));
            }

            //check the key store password is set
            if (System.getProperty("javax.net.ssl.keyStorePassword") == null)
            {

                if (appRegistry.getConfiguration().getManagementKeyStorePassword() == null)
                {
                    throw new ConfigurationException("JMX management SSL keystore password not defined, " +
                                                   "unable to start requested SSL protected JMX server");
                }
                else
                {
                   System.setProperty("javax.net.ssl.keyStorePassword",
View Full Code Here

            keyStorePath = appRegistry.getConfiguration().getManagementKeyStorePath();
        }

        if (keyStorePath == null)
        {
            throw new ConfigurationException("Management SSL keystore path not defined, unable to start SSL protected HTTP connector");
        }
        else
        {
            File ksf = new File(keyStorePath);
            if (!ksf.exists())
View Full Code Here

        // QPID-3249.  Support for specifying authentication name at vhost level is no longer supported.
        if (getListValue("security.authentication.name").size() > 0)
        {
            String message = "Validation error : security/authentication/name is no longer a supported element within the configuration xml."
                    + " It appears in virtual host definition : " + _name;
            throw new ConfigurationException(message);
        }

        // QPID-3266.  Tidy up housekeeping configuration option for scheduling frequency
        if (contains("housekeeping.expiredMessageCheckPeriod"))
        {
            String message = "Validation error : housekeeping/expiredMessageCheckPeriod must be replaced by housekeeping/checkPeriod."
                    + " It appears in virtual host definition : " + _name;
            throw new ConfigurationException(message);
        }
    }
View Full Code Here

        public void validateConfiguration() throws ConfigurationException
        {
            if (getConfig().isEmpty())
            {
                throw new ConfigurationException("security section is incomplete, no elements found.");
            }
        }
View Full Code Here

        public void validateConfiguration() throws ConfigurationException
        {
            if (getConfig().isEmpty())
            {
                throw new ConfigurationException("Queue section cannot be empty.");
            }

            if (getName() == null)
            {
                throw new ConfigurationException("Queue section must have a 'name' element.");
            }

        }
View Full Code Here

    {
        try
        {
            if (!containsPositiveLong(property))
            {
                throw new ConfigurationException(this.getClass().getSimpleName()
                                                 + ": '" + property +
                                                 "' must be a Positive Long value.");
            }
        }
        catch (Exception e)
        {
            Throwable last = e;

            // Find the first cause
            if (e instanceof ConversionException)
            {
                Throwable t = e.getCause();
                while (t != null)
                {
                    last = t;
                    t = last.getCause();
                }
            }

            throw new ConfigurationException(this.getClass().getSimpleName() +
                                             ": unable to configure invalid " +
                                             property + ":" +
                                             _config.getString(property),
                                             last);
        }
View Full Code Here

        if (!containsPositiveLong("messageAge") &&
            !containsPositiveLong("depth") &&
            !containsPositiveLong("messageCount"))
        {
            throw new ConfigurationException("At least one configuration property" +
                                             "('messageAge','depth' or 'messageCount') must be specified.");
        }

        SlowConsumerDetectionPolicyConfiguration policyConfig = getConfiguration(SlowConsumerDetectionPolicyConfiguration.class.getName());
        Map<String, SlowConsumerPolicyPluginFactory> factories = pluginManager.getSlowConsumerPlugins();

        if (policyConfig == null)
        {
            throw new ConfigurationException("No Slow Consumer Policy specified. Known Policies:" + factories.keySet());
        }

        if (_logger.isDebugEnabled())
        {
            Iterator<?> keys = policyConfig.getConfig().getKeys();

            while (keys.hasNext())
            {
                String key = (String) keys.next();

                _logger.debug("Policy Keys:" + key);
            }

        }

        SlowConsumerPolicyPluginFactory<SlowConsumerPolicyPlugin> pluginFactory = factories.get(policyConfig.getPolicyName().toLowerCase());

        if (pluginFactory == null)
        {
            throw new ConfigurationException("Unknown Slow Consumer Policy specified:" + policyConfig.getPolicyName() + " Known Policies:" + factories.keySet());
        }

        _policyPlugin = pluginFactory.newInstance(policyConfig);

        // Debug the creation of this Config
View Full Code Here

    public void validateConfiguration() throws ConfigurationException
    {
        if (getConfig().isEmpty())
        {
            throw new ConfigurationException("Topic section cannot be empty.");
        }

        if (getStringValue("name") == null && getSubscriptionName() == null)
        {
            throw new ConfigurationException("Topic section must have a 'name' or 'subscriptionName' element.");
        }

    }
View Full Code Here

    @Override
    public void validateConfiguration() throws ConfigurationException
    {
        if (getConfig().isEmpty())
        {
            throw new ConfigurationException("Topics section cannot be empty.");
        }

        int topics = getConfig().getList("topic.name").size() +
                     getConfig().getList("topic.subscriptionName").size();
View Full Code Here

TOP

Related Classes of org.apache.commons.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.