Package org.impalaframework.exception

Examples of org.impalaframework.exception.ConfigurationException


    protected abstract String getAlternativeFolderLocation();
   
    @Override
    public void setLocation(Resource location) {
        throw new ConfigurationException("Use 'fileLocation' property instead");
    }
View Full Code Here


        throw new ConfigurationException("Use 'fileLocation' property instead");
    }

    @Override
    public void setLocations(Resource[] locations) {
        throw new ConfigurationException("Use 'fileLocations' property instead");
    }
View Full Code Here

  private String[] getModuleNames(Element root) {
    Element namesElement = DomUtils.getChildElementByTagName(root, ModuleElementNames.NAMES_ELEMENT);
   
    if (namesElement == null) {
      throw new ConfigurationException("Resource '" + getResource() + "' contains a non-empty '" + ModuleElementNames.NAMES_ELEMENT + "' element, which is illegal when using " + InternalModuleDefinitionSource.class.getSimpleName());
    }
   
    String value = namesElement.getTextContent();
    String[] moduleNames = StringUtils.tokenizeToStringArray(value, " ,\n\r", true, true);
    return moduleNames;
View Full Code Here

      String type = getType(definitionElement);
   
      Properties properties = moduleProperties.get(name);
   
      if (properties == null) {
        throw new ConfigurationException("Resource '" + getResource() + "' contains no new properties for module '" + name +
            "'. Has this module been declared in the '" + ModuleElementNames.NAMES_ELEMENT + "' element?");
      }
     
      TypeReader typeReader = typeReaderRegistry.getTypeReader(type);
      typeReader.readModuleDefinitionProperties(properties, name, definitionElement);
View Full Code Here

   
    /* ****************** protected methods ************** */
   
    protected ClassLoaderFactory getClassLoaderFactory() {
        if (classLoaderFactory == null) {
            throw new ConfigurationException("No " + ClassLoaderFactory.class.getName() + " set. Check your definition for " + this.getClass().getName());
        }
        return classLoaderFactory;
    }
View Full Code Here

  protected Document loadDocument(Resource resource) {
    try {
      return XMLDomUtils.loadDocument(resource);
    } catch (Exception e) {
      throw new ConfigurationException("Unable to load XML module definition document from resource " + resource, e);
    }
  }
View Full Code Here

    public TypeReader getTypeReader(String type) {
        TypeReader typeReader = super.getEntry(type, TypeReader.class, false);
       
        if (typeReader == null) {
            if (defaultTypeReader == null) {
                throw new ConfigurationException("No type reader available for module type '" + type + "', and no default module type reader has been set");
            }
            return defaultTypeReader;
        }
       
        return typeReader;
View Full Code Here

            StringPropertyValue allLocations = new StringPropertyValue(propertySource, CoreBootstrapProperties.GRAPH_BEAN_VISIBILITY_TYPE, CoreBootstrapProperties.GRAPH_BEAN_VISIBILITY_TYPE_DEFAULT);
            configSettings.addProperty(CoreBootstrapProperties.GRAPH_BEAN_VISIBILITY_TYPE, allLocations);
        } else if ("hierarchical".equalsIgnoreCase(value)) {
            //nothing to do here
        } else {
            throw new ConfigurationException("Invalid value for property 'classloader.type': " + value);
        }
    }
View Full Code Here

        if (pathname.isDirectory()) {
            return true;
        }

        if (rootCanonicalPath == null) {
            throw new ConfigurationException("root canonical path not set");
        }

        String canonicalPath = null;
        try {
            canonicalPath = pathname.getCanonicalPath();
View Full Code Here

                if (filterNames != null) {
                    List<FilterFactoryBean> filterFactories = new ArrayList<FilterFactoryBean>();
                    for (String filterName : filterNames) {
                        FilterFactoryBean filterFactoryBean = filtersByName.get(filterName);
                        if (filterFactoryBean == null) {
                            throw new ConfigurationException("Suffix '" + suffix + "' has mapping for filter '" + filterName + "' for which no named filter definition is present in the current module.");
                        }
                        filterFactories.add(filterFactoryBean);
                    }
                    suffixFiltersMapping.put(suffix, filterFactories);
                }
               
                String servletName = contributor.getServletName();
                if (servletName != null) {
                    ServletFactoryBean servletFactoryBean = servletsByName.get(servletName);
                    if (servletFactoryBean == null) {
                        throw new ConfigurationException("Suffix '" + suffix + "' has mapping for servlet '" + servletName + "' for which no named servlet definition is present in the current module.");
                    }
                    suffixServletMapping.put(suffix, servletFactoryBean);
                }
            }
        } else {     
            maybeDebug("Module '" + moduleName + "' has no contributions. Looking for servlet matching module name ...");
           
            //if no contributions, first look for servlet whose name is same as module name
            FilterFactoryBean filter = null;
            ServletFactoryBean servlet = servletsByName.get(this.moduleName);
           
            if (servlet == null) {

                maybeDebug("Looking for filter matching module name ...");

                //if not found, look for filter whose name is same as module name
                filter = filtersByName.get(this.moduleName);
                if (filter == null) {
                   
                    maybeDebug("Looking for single servlet definition ...");

                    //check that there is only one servlet, if > 1, throw exception
                    if (servletsByName.size() > 1) {
                        throw new ConfigurationException("Cannot determine default servlet for module '" + moduleName + "' as more than one servlet is registered for this module.");
                    }
                    if (servletsByName.size() == 1) {
                        servlet = ObjectMapUtils.getFirstValue(servletsByName);
                    }
                   
                    if (servlet == null) {
                       
                        maybeDebug("Looking for single filter definition ...");

                        //check that there is only one filter, if > 1, throw exception
                        if (filtersByName.size() > 1) {
                            throw new ConfigurationException("Cannot determine default filter for module '" + moduleName + "' as more than one filter is registered for this module.");
                        }
                        if (filtersByName.size() == 1) {
                            filter = ObjectMapUtils.getFirstValue(filtersByName);
                        }
                    }
View Full Code Here

TOP

Related Classes of org.impalaframework.exception.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.