Package org.impalaframework.exception

Examples of org.impalaframework.exception.ConfigurationException


    try {
      // this will throw an IOException if the stream cannot be opened
      inputStream = encodedResource.getResource().getInputStream();
    }
    catch (IOException e) {
      throw new ConfigurationException(
          "Could not load module definition, as unable to obtain input stream for resource "
              + encodedResource.getResource(), e);
    }

    Document document = null;

    DefaultDocumentLoader loader = new DefaultDocumentLoader();
    try {
      InputSource inputSource = new InputSource(inputStream);
      inputSource.setEncoding(encodedResource.getEncoding());
      document = loader.loadDocument(inputSource, null, new SimpleSaxErrorHandler(logger),
          XmlBeanDefinitionReader.VALIDATION_NONE, false);
    }
    catch (Exception e) {
      throw new ConfigurationException("Unable to load XML module definition document from resource "
          + encodedResource.getResource(), e);
    }
    finally {
      try {
        if (inputStream != null)
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

        return resources;
    }

    protected void checkResource(Resource resource, String location, ModuleDefinition moduleDefinition) {
        if (resource == null || !resource.exists())
            throw new ConfigurationException("Unable to load resource from location '" + location
                    + "' for module definition '" + moduleDefinition.getName() + "'");
    }
View Full Code Here

        if (beanVisibilityType.equals(GRAPH_ORDERED)) {
            GraphModuleStateHolder graphModuleStateHolder = ObjectUtils.cast(moduleStateHolder, 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

        //go through and check that all modules have children but not parents
        for (String moduleName : children.keySet()) {
           
            if (!parents.containsKey(moduleName)) {
                if (!loadDependendentModules) {
                    throw new ConfigurationException("Module '" + moduleName + "' has not been explicitly mentioned, but loadDependentModules has been set to false");
                }
                missing.add(moduleName);
            }
        }
        return missing.toArray(new String[0]);
View Full Code Here

        }
    }

    void checkParent(String parent, String moduleName) {
        if (moduleName.equals(parent)){
            throw new ConfigurationException("Module '" + moduleName + "' illegally declares itself as parent in " + MODULE_PROPERTIES);
        }
    }
View Full Code Here

            logger.error("Problem location 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 (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

        String workspace = getWorkspaceRoot();
        if (workspace != null) {
            File candidate = new File(workspace);

            if (!candidate.exists()) {
                throw new ConfigurationException("'workspace.root' (" + workspace + ") does not exist");
            }
            if (!candidate.isDirectory()) {
                throw new ConfigurationException("'workspace.root' (" + workspace + ") is not a directory");
            }
            return new FileSystemResource(candidate);
        }
        return new FileSystemResource("../");
    }
View Full Code Here

     */
    protected String getRootDirectoryPath() {
        Resource rootDirectory = getRootDirectory();
       
        if (rootDirectory == null) {
            throw new ConfigurationException("Unable to determine application's root directory. Has the property 'workspace.root' been set?");
        }
       
        String absolutePath = null;
        try {
            absolutePath = rootDirectory.getFile().getAbsolutePath();
        }
        catch (IOException e) {
            throw new ConfigurationException("Unable to obtain path for root directory: " + rootDirectory);
        }
        return StringUtils.cleanPath(absolutePath);
    }
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.