Package org.impalaframework.exception

Examples of org.impalaframework.exception.ConfigurationException


            else if (delegatingLoader != null) {
                if (logger.isDebugEnabled()) logger.debug("Loading module " + definition + " using DelegatingContextLoader " + moduleLoader);
                context = delegatingLoader.loadApplicationContext(parent, definition);
            }
            else {
                throw new ConfigurationException("No " + ModuleLoader.class.getName() + " or "
                        + DelegatingContextLoader.class.getName() + " specified for module definition type " + definition.getType());
            }

        }
        finally {
View Full Code Here


            logger.error("Problem locating resources for module: " + moduleName + ". Locations being searched are " + (classLocations.isEmpty() ? "empty": "listed next:"));
            for (Resource classLocation : classLocations) {
                logger.error(classLocation.getDescription() + (classLocation.exists() ? ": is present on file system": " cannot be found"));
            }
           
            throw new ConfigurationException("Application is using internally defined module structure, but no "
                    + MODULE_PROPERTIES +
                    " file is present on the classpath for module '" + moduleName
                    + "'. It must exist in one of the following locations: " + classLocations);
        }
        return resource;
View Full Code Here

        if (beanVisibilityType.equals(GRAPH_ORDERED)) {
            GraphModuleStateHolder graphModuleStateHolder = ObjectUtils.cast(getModuleStateHolder(), GraphModuleStateHolder.class);
            return new GraphOrderedBeanInheritanceStrategy().getParentApplicationContext(graphModuleStateHolder, parentApplicationContext, definition);
        }
   
        throw new ConfigurationException("Invalid value for property " + CoreBootstrapProperties.GRAPH_BEAN_VISIBILITY_TYPE + ". Permissible values are " + Arrays.asList(NONE, PARENT_ONLY, PARENT_FIRST, GRAPH_ORDERED));
    }
View Full Code Here

    }

    String determineRootDefinition() { 
       
        if (getOrphans().isEmpty()) {
            throw new ConfigurationException("Module hierarchy does not have a root module. At least one module with no parent needs to be specified");
        }
       
        String firstModule = getOrphans().iterator().next();
        if (getOrphans().size() == 1) {
            return firstModule;
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 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 static final Log logger = LogFactory.getLog(ImpalaServletUtils.class);

    public static WebApplicationContext checkIsWebApplicationContext(String servletName, ApplicationContext applicationContext) {
        if (!(applicationContext instanceof WebApplicationContext)) {
            throw new ConfigurationException("Servlet '" + servletName + "' is not backed by an application context of type " + WebApplicationContext.class.getName() + ": " + applicationContext);
        }
        return (WebApplicationContext) applicationContext;
    }
View Full Code Here

    public static ModuleManagementFacade getModuleManagementFacade(ServletContext servletContext) {
        ModuleManagementFacade facade = WebServletUtils.getModuleManagementFacade(servletContext);
   
        if (facade == null) {
            throw new ConfigurationException("Unable to load " + FrameworkServletContextCreator.class.getName()
                    + " as no attribute '" + WebConstants.IMPALA_FACTORY_ATTRIBUTE
                    + "' has been set up. Have you set up your Impala ContextLoader correctly?");
        }
        return facade;
    }
View Full Code Here

    if (context != null) {
      if (context instanceof WebApplicationContext) {
        return (WebApplicationContext) context;
      }
      else {
        throw new ConfigurationException("Module registered under name of servlet '" + servletName
            + "' needs to be an instance of " + WebApplicationContext.class.getName());
      }
    }
    else {
      throw new ConfigurationException("No module registered under the name of servlet '" + servletName + "'");
    }
  }
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.