Package org.rhq.core.pluginapi.inventory

Examples of org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException


        }
    }

    private void singleFileAvailabilityCheck(File f) {
        if (!f.isAbsolute()) {
            throw new InvalidPluginConfigurationException("Path '" + f.getPath() + "' is not an absolute path.");
        }
        if (!f.exists()) {
            throw new InvalidPluginConfigurationException("File '" + f.getPath() + "' does not exist.");
        }
        if (f.isDirectory()) {
            throw new InvalidPluginConfigurationException("Path '" + f.getPath()
                + "' is a directory, not a regular file.");
        }
    }
View Full Code Here


        try {
           new URL(url);
           serverUrl = url;
        }
        catch (MalformedURLException e) {
           throw new InvalidPluginConfigurationException(e.getMessage());
        }
        url = conf.getSimpleValue("searchBaseUrl", "http://search.twitter.com/");
        if (!url.endsWith("/"))
           url= url+"/";
        try {
           new URL(url);
           searchBaseUrl = url;
        }
        catch (MalformedURLException e) {
           throw new InvalidPluginConfigurationException(e.getMessage());
        }



        eventContext = context.getEventContext();
View Full Code Here

        String url = pluginConfig.getSimple(URL_CONFIG_PROP).getStringValue();
        if (url != null) {
            try {
                this.url = new URL(url);
                if (this.url.getPort() == 0) {
                    throw new InvalidPluginConfigurationException(
                        "The 'url' connection property is invalid - 0 is not a valid port; please change the value to the "
                            + "port this virtual host is listening on. NOTE: If the 'url' property was set this way "
                            + "after autodiscovery, you most likely did not include the port in the ServerName directive for "
                            + "this virtual host in httpd.conf.");
                }
View Full Code Here

                if (log.isDebugEnabled()) {
                    log.debug("Failed to connect to Profile Service.", e);
                } else {
                    log.warn("Failed to connect to Profile Service - cause: " + rootCause);
                }
                throw new InvalidPluginConfigurationException(
                    "Values of 'principal' and/or 'credentials' connection properties are invalid.", rootCause);
            }
            log.debug("Failed to connect to Profile Service.", e);
        }
    }
View Full Code Here

        Configuration pluginConfig = this.resourceContext.getPluginConfiguration();
        String serverHomeDir = getRequiredPropertyValue(pluginConfig,
            ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR);
        File configPath = resolvePathRelativeToHomeDir(serverHomeDir);
        if (!configPath.isDirectory()) {
            throw new InvalidPluginConfigurationException("Configuration path '" + configPath + "' does not exist.");
        }
        return configPath;
    }
View Full Code Here

        URL url;
        try {
            url = new URL(path);
        }
        catch (MalformedURLException e) {
            throw new InvalidPluginConfigurationException("Value of 'urlBase' property is not a valid URL.");
        }

        JSONObject server = HudsonJSONUtility.getData(path, 0);

        try {
View Full Code Here

            ApacheServerComponent.resolvePathRelativeToServerRoot(pluginConfig, executablePath).getPath();
        ApacheBinaryInfo binaryInfo;
        try {
            binaryInfo = ApacheBinaryInfo.getInfo(absoluteExecutablePath, discoveryContext.getSystemInformation());
        } catch (Exception e) {
            throw new InvalidPluginConfigurationException("'" + absoluteExecutablePath
                + "' is not a valid Apache executable (" + e + "). Please make sure the '"
                + ApacheServerComponent.PLUGIN_CONFIG_PROP_EXECUTABLE_PATH + "' connection property is set correctly.");
        }

        if (!isSupportedVersion(binaryInfo.getVersion())) {
            throw new InvalidPluginConfigurationException("Version of Apache executable (" + binaryInfo.getVersion()
                + ") is not a supported version; supported versions are 1.3.x and 2.x.");
        }

        ProcessInfo processInfo = null;
        try {
View Full Code Here

            serverRootFile = new File(serverRoot).getCanonicalFile(); // this will resolve symlinks
        } catch (IOException e) {
            serverRootFile = null;
        }
        if (serverRootFile == null || !serverRootFile.isDirectory()) {
            throw new InvalidPluginConfigurationException("'" + serverRoot
                + "' does not exist or is not a directory. Please make sure the '"
                + ApacheServerComponent.PLUGIN_CONFIG_PROP_SERVER_ROOT + "' connection property is set correctly.");
        }
        String httpdConf = pluginConfig.getSimple(ApacheServerComponent.PLUGIN_CONFIG_PROP_HTTPD_CONF).getStringValue();
        File httpdConfFile;
        try {
            httpdConfFile = new File(httpdConf).getCanonicalFile(); // this will resolve symlinks
        } catch (IOException e) {
            httpdConfFile = null;
        }
        if (httpdConfFile == null || !httpdConfFile.isFile()) {
            throw new InvalidPluginConfigurationException("'" + httpdConf
                + "' does not exist or is not a regular file. Please make sure the '"
                + ApacheServerComponent.PLUGIN_CONFIG_PROP_HTTPD_CONF + "' connection property is set correctly.");
        }
    }
View Full Code Here

        // trying to connect each time it is called.
        try {
            internalStart();
        } catch (Exception e) {
            if (e.getCause() instanceof SecurityException) {
                throw new InvalidPluginConfigurationException("Failed to authenticate to managed JVM - "
                    + "principal and/or credentials connection properties are not set correctly.");
            }
            // don't litter agent log with a stack trace unless we're in debug
            if (log.isDebugEnabled()) {
                log.warn("Failed to connect to " + context.getResourceType() + "[" + context.getResourceKey() + "].", e);
View Full Code Here

     *
     * @throws InvalidPluginConfigurationException if settings are incorrect
     */
    public void validate() {
        if (getPort() == null || getPort() <= 0) {
            throw new InvalidPluginConfigurationException(
                "Unable to detect management port. Please enable management HTTP interface on and then set correct port number in Connection Settings of this resource");
        }
        if (isSecure()) {
            String truststore = getTruststore();
            if (truststore != null) {
                if (!new File(truststore).isFile()) {
                    throw new InvalidPluginConfigurationException("Truststore file does not exist");
                }
                String truststoreType = getTruststoreType();
                if (truststoreType == null) {
                    throw new InvalidPluginConfigurationException(
                        "Truststore type is required when using a custom truststore file");
                }
                try {
                    KeyStore.getInstance(truststoreType);
                } catch (KeyStoreException e) {
                    throw new InvalidPluginConfigurationException("Truststore type not supported: " + e.getMessage());
                }
                try {
                    loadKeystore(truststoreType, truststore, getTruststorePassword());
                } catch (Exception e) {
                    throw new InvalidPluginConfigurationException("Cannot read the truststore: " + e.getMessage());
                }
            }
            if (isClientcertAuthentication()) {
                String keystore = getKeystore();
                if (keystore == null) {
                    throw new InvalidPluginConfigurationException(
                        "Keystore is required when using client certificate authentication");
                }
                if (!new File(keystore).isFile()) {
                    throw new InvalidPluginConfigurationException("Keystore file does not exist");
                }
                String keystoreType = getKeystoreType();
                if (keystoreType == null) {
                    throw new InvalidPluginConfigurationException(
                        "Keystore type is required when using a custom keystore file");
                }
                try {
                    KeyStore.getInstance(keystoreType);
                } catch (KeyStoreException e) {
                    throw new InvalidPluginConfigurationException("Keystore type not supported: " + e.getMessage());
                }
                try {
                    loadKeystore(keystoreType, keystore, getKeystorePassword());
                } catch (Exception e) {
                    throw new InvalidPluginConfigurationException("Cannot read the keystore: " + e.getMessage());
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException

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.