Examples of ConfigurationException


Examples of org.apache.jackrabbit.core.config.ConfigurationException

    public Object newInstance(Class<?> clazz, BeanConfig config) throws ConfigurationException {
        Class targetClass = getClassFromConfig(config);
        if (targetClass.isInterface()) {
            Object o = instanceMap.get(targetClass);
            if (o == null) {
                throw new ConfigurationException("No instance registered for type " + targetClass.getName());
            }
            return o;
        }
        return delegate.newInstance(clazz, config);
    }
View Full Code Here

Examples of org.apache.ldap.server.configuration.ConfigurationException

     */
    protected void setMinaServiceRegistry( ServiceRegistry minaServiceRegistry )
    {
        if( minaServiceRegistry == null )
        {
            throw new ConfigurationException( "MinaServiceRegistry cannot be null" );
        }
        this.minaServiceRegistry = minaServiceRegistry;
    }
View Full Code Here

Examples of org.apache.logging.log4j.core.config.ConfigurationException

                                            final int batchSize, String dataDir) {
            final Properties props = new Properties();

            if ((agents == null || agents.length == 0) && (properties == null || properties.length == 0)) {
                LOGGER.error("No Flume configuration provided");
                throw new ConfigurationException("No Flume configuration provided");
            }

            if ((agents != null && agents.length > 0 && properties != null && properties.length > 0)) {
                LOGGER.error("Agents and Flume configuration cannot both be specified");
                throw new ConfigurationException("Agents and Flume configuration cannot both be specified");
            }

            if (agents != null && agents.length > 0) {
                props.put(name + ".sources", FlumeEmbeddedManager.SOURCE_NAME);
                props.put(name + ".sources." + FlumeEmbeddedManager.SOURCE_NAME + ".type", SOURCE_TYPE);

                if (dataDir != null && dataDir.length() > 0) {
                    if (dataDir.equals(IN_MEMORY)) {
                        props.put(name + ".channels", "primary");
                        props.put(name + ".channels.primary.type", "memory");
                    } else {
                        props.put(name + ".channels", "primary");
                        props.put(name + ".channels.primary.type", "file");

                        if (!dataDir.endsWith(FiLE_SEP)) {
                            dataDir = dataDir + FiLE_SEP;
                        }

                        props.put(name + ".channels.primary.checkpointDir", dataDir + "checkpoint");
                        props.put(name + ".channels.primary.dataDirs", dataDir + "data");
                    }

                } else {
                    props.put(name + ".channels", "primary");
                    props.put(name + ".channels.primary.type", "file");
                }

                final StringBuilder sb = new StringBuilder();
                String leading = "";
                int priority = agents.length;
                for (int i = 0; i < agents.length; ++i) {
                    sb.append(leading).append("agent").append(i);
                    leading = " ";
                    final String prefix = name + ".sinks.agent" + i;
                    props.put(prefix + ".channel", "primary");
                    props.put(prefix + ".type", "avro");
                    props.put(prefix + ".hostname", agents[i].getHost());
                    props.put(prefix + ".port", Integer.toString(agents[i].getPort()));
                    props.put(prefix + ".batch-size", Integer.toString(batchSize));
                    props.put(name + ".sinkgroups.group1.processor.priority.agent" + i, Integer.toString(priority));
                    --priority;
                }
                props.put(name + ".sinks", sb.toString());
                props.put(name + ".sinkgroups", "group1");
                props.put(name + ".sinkgroups.group1.sinks", sb.toString());
                props.put(name + ".sinkgroups.group1.processor.type", "failover");
                final String sourceChannels = "primary";
                props.put(name + ".channels", sourceChannels);
                props.put(name + ".sources." + FlumeEmbeddedManager.SOURCE_NAME + ".channels", sourceChannels);
            } else {
                String channels = null;
                String[] sinks = null;

                props.put(name + ".sources", FlumeEmbeddedManager.SOURCE_NAME);
                props.put(name + ".sources." + FlumeEmbeddedManager.SOURCE_NAME + ".type", SOURCE_TYPE);

                for (final Property property : properties) {
                    final String key = property.getName();

                    if (key == null || key.length() == 0) {
                        final String msg = "A property name must be provided";
                        LOGGER.error(msg);
                        throw new ConfigurationException(msg);
                    }

                    final String upperKey = key.toUpperCase(Locale.ENGLISH);

                    if (upperKey.startsWith(name.toUpperCase(Locale.ENGLISH))) {
                        final String msg =
                            "Specification of the agent name is not allowed in Flume Appender configuration: " + key;
                        LOGGER.error(msg);
                        throw new ConfigurationException(msg);
                    }

                    // Prohibit setting the sources as they are set above but allow interceptors to be set
                    if (upperKey.startsWith("SOURCES.") && !upperKey.startsWith("SOURCES.LOG4J-SOURCE.INTERCEPTORS")) {
                        final String msg = "Specification of Sources is not allowed in Flume Appender: " + key;
                        LOGGER.error(msg);
                        throw new ConfigurationException(msg);
                    }

                    final String value = property.getValue();
                    if (value == null || value.length() == 0) {
                        final String msg = "A value for property " + key + " must be provided";
                        LOGGER.error(msg);
                        throw new ConfigurationException(msg);
                    }

                    if (upperKey.equals("CHANNELS")) {
                        channels = value.trim();
                    } else if (upperKey.equals("SINKS")) {
                        sinks = value.trim().split(" ");
                    }

                    props.put(name + '.' + key, value);
                }

                String sourceChannels = channels;

                if (channels == null) {
                    sourceChannels = "primary";
                    props.put(name + ".channels", sourceChannels);
                }

                props.put(name + ".sources." + FlumeEmbeddedManager.SOURCE_NAME + ".channels", sourceChannels);

                if (sinks == null || sinks.length == 0) {
                    final String msg = "At least one Sink must be specified";
                    LOGGER.error(msg);
                    throw new ConfigurationException(msg);
                }
            }
            return props;
        }
View Full Code Here

Examples of org.apache.maven.continuum.configuration.ConfigurationException

            configurationService.store();
            return populateBuildAgent( configurationService.getBuildAgent( buildAgentConfiguration.getUrl() ) );
        }
        catch ( ContinuumException e )
        {
            throw new ConfigurationException( "Error in adding buildAgent", e );
        }
    }
View Full Code Here

Examples of org.apache.mina.api.ConfigurationException

    @Override
    public Boolean isTcpNoDelay() {
        try {
            return socket.getTcpNoDelay();
        } catch (SocketException e) {
            throw new ConfigurationException(e);
        }
    }
View Full Code Here

Examples of org.apache.ode.bpel.explang.ConfigurationException

      elangRT.initialize(oelang.properties);
      _runtimes.put(oelang, elangRT);
    } catch (ConfigurationException ce) {
      throw ce;
    } catch (IllegalAccessException e) {
      throw new ConfigurationException("Illegal Access Error", e);
    } catch (InstantiationException e) {
      throw new ConfigurationException("Instantiation Error", e);
    } catch (ClassNotFoundException e) {
      throw new ConfigurationException("Class Not Found Error", e);
    }

  }
View Full Code Here

Examples of org.apache.ode.bpel.rtrep.common.ConfigurationException

            Class cls = Class.forName(className);
            ExpressionLanguageRuntime elangRT = (ExpressionLanguageRuntime) cls.newInstance();
            elangRT.initialize(oelang.properties);
            _runtimes.put(oelang, elangRT);
        } catch (IllegalAccessException e) {
            throw new ConfigurationException("Illegal Access Error", e);
        } catch (InstantiationException e) {
            throw new ConfigurationException("Instantiation Error", e);
        } catch (ClassNotFoundException e) {
            throw new ConfigurationException("Class Not Found Error: " + className, e);
        }

    }
View Full Code Here

Examples of org.apache.ojb.broker.util.configuration.ConfigurationException

        {
            lockservlet = new URL(url);
        }
        catch (MalformedURLException e)
        {
            throw new ConfigurationException("Invalid LockServlet Url was specified: " + url, e);
        }

    }
View Full Code Here

Examples of org.apache.pluto.portalImpl.services.ConfigurationException

    {
        PortletApplicationDefinition definition =
            PortletDefinitionRegistry.getPortletApplicationDefinitionList()
                .get(org.apache.pluto.portalImpl.util.ObjectID.createFromString(definitionId));
        if(definition == null) {
            throw new ConfigurationException("Unable to find portlet application definition. "+
                    "Ensure that all portlets definied within the portlet registry are correct" +
                    "and have been deployed.");
        }
        return definition;
    }
View Full Code Here

Examples of org.apache.shiro.config.ConfigurationException

    protected InputStream getCacheManagerConfigFileInputStream() {
        String configFile = getCacheManagerConfigFile();
        try {
            return ResourceUtils.getInputStreamForPath(configFile);
        } catch (IOException e) {
            throw new ConfigurationException("Unable to obtain input stream for cacheManagerConfigFile [" +
                    configFile + "]", e);
        }
    }
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.