Package org.apache.avalon.framework.configuration

Examples of org.apache.avalon.framework.configuration.ConfigurationException


            Object obj = jxContext.getValue(name);
            if (getLogger().isDebugEnabled())
                getLogger().debug("for "+name+" returning an "+(obj == null ? "null" : obj.getClass().getName())+" as "+obj);
            return obj;
        } catch (Exception e) {
            throw new ConfigurationException(
                "Module does not support <" + name + ">" + "attribute.",
                e
            );
        }
    }
View Full Code Here


            for (int i = 0; i < properties.length; i++) {
                names.add(properties[i].getName());
            }
            return names.listIterator();
        } catch (Exception e) {
            throw new ConfigurationException(
                "Error retrieving attribute names for class: "
                + contextObj.getClass(),
                e
            );
        }
View Full Code Here

            if (obj.length == 0) obj = null;
            if (getLogger().isDebugEnabled())
                getLogger().debug("for "+name+" returning an "+(obj == null ? "null" : obj.getClass().getName())+" as "+obj);
            return obj;
        } catch (Exception e) {
            throw new ConfigurationException(
                "Module does not support <" + name + ">" + "attribute.",
                e
            );
        }
    }
View Full Code Here

        for (int i = 0; i < children.length; i++) {
            if (children[i] instanceof PipelinesNode) {
                if (pipelines != null) {
                    String msg = "Only one 'pipelines' is allowed, at " + config.getLocation();
                    throw new ConfigurationException(msg);
                }
                pipelines = children[i];
            }
        }

        if (pipelines == null) {
            String msg = "Invalid sitemap : there must be a 'pipelines' at " + config.getLocation();
            throw new ConfigurationException(msg);
        }

        return pipelines;
    }
View Full Code Here

                this.languages.put(language.getName(), language);
            }
        } catch (Exception e) {
          getLogger().warn("Configuration Error: " + e.getMessage(), e);
          throw new ConfigurationException("AbstractMarkupLanguage: "
                                           + e.getMessage(), e);
        }
    }
View Full Code Here

        }
      }
    }
        if (children.size() == 0) {
            String msg = "There must be at least one pipeline at " + config.getLocation();
            throw new ConfigurationException(msg);
        }

    node.setChildren(toNodeArray(children));
    node.setErrorHandler(handler);
View Full Code Here

                        throw (e);
                    }
                }
            }
        } catch (Exception e) {
            throw new ConfigurationException("Cannot configure action", e);
        }
    }
View Full Code Here

                }
                log.debug(debug.toString());
            }
           
            if (filterMap.get(type) != null) {
                throw new ConfigurationException("A filterList of type '"
                    + type + "' has already been defined");
            }
            filterMap.put(type, filterList);
        }
        return filterMap;               
View Full Code Here

            try {
                final Class inspectorClass = classloader.loadClass(className);
                inspector = (SourceInspector)inspectorClass.newInstance();
            } catch (InstantiationException ie) {
                throw new ConfigurationException("Could not instantiate class "+className, ie);
            } catch (ClassNotFoundException cnfe) {
                throw new ConfigurationException("Could not load class "+className, cnfe);
            } catch (IllegalAccessException iae) {
                 throw new ConfigurationException("Could not load class "+className, iae);
            }

            if (inspector instanceof Configurable)
                ((Configurable)inspector).configure(configurations[i]);

            try {
                if (inspector instanceof Parameterizable)
                    ((Parameterizable)inspector).parameterize(Parameters.fromConfiguration(configurations[i]));
            } catch (ParameterException pe) {
                throw new ConfigurationException("Could not parameterize inspector", pe);
            }

            inspectors.add(inspector);
        }
    }
View Full Code Here

    protected static Configuration getConfiguration(String descriptor, SourceResolver resolver,
                                                    boolean reloadable, Logger logger)
            throws ConfigurationException {

        if (descriptor == null) {
            throw new ConfigurationException("The form descriptor is not set!");
        }

        ConfigurationHelper conf = null;
        synchronized (XSPFormValidatorHelper.configurations) {
            Source source = null;
            try {
                source = resolver.resolveURI(descriptor);
                conf = (ConfigurationHelper) XSPFormValidatorHelper.configurations.get(source.getURI());
                if (conf == null || (reloadable && conf.lastModified != source.getLastModified())) {
                    logger.debug("(Re)Loading " + descriptor);

                    if (conf == null) {
                        conf = new ConfigurationHelper();
                    }

                    SAXConfigurationHandler builder = new SAXConfigurationHandler();
                    resolver.toSAX(source, builder);

                    conf.lastModified = source.getLastModified();
                    conf.configuration = builder.getConfiguration();

                    XSPFormValidatorHelper.cacheConfiguration(source.getURI(), conf);
                } else {
                    logger.debug("Using cached configuration for " + descriptor);
                }
            } catch (Exception e) {
                logger.error("Could not configure Database mapping environment", e);
                throw new ConfigurationException("Error trying to load configurations for resource: " + source.getURI());
            } finally {
                resolver.release(source);
            }
        }
View Full Code Here

TOP

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