Package org.impalaframework.exception

Examples of org.impalaframework.exception.ExecutionException


            Resource xsdResource) {
       
        Assert.notNull(xsdResource, "xsdResource cannot be null");
       
        if (!xsdResource.exists()) {
            throw new ExecutionException("Cannot validate document as xsdResource '" + xsdResource + "' does not exist");
        } else {
            System.out.println("Validating using schema resource " + xsdResource.getDescription());
            logger.debug("Validating using schema resource " + xsdResource.getDescription());
        }
       
        SchemaFactory factory =
            SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
   
        try {
            InputStream inputStream = xsdResource.getInputStream();
            Source source = new StreamSource(inputStream);
   
            Schema schema = factory.newSchema(source);
            Validator validator = schema.newValidator();
            validator.validate(new DOMSource(document));
        }
        catch (SAXParseException e) {
            throw new ExecutionException("Error on " + e.getLineNumber() + ", column " + e.getColumnNumber() + " in " + description + ": " + e.getMessage(), e);
        }
        catch (SAXException e) {
            throw new ExecutionException("Error parsing " + description + ": " + e.getMessage(), e);
        }
        catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here


        ContextLoader contextLoader = null;
        try {
            contextLoader = (ContextLoader) contextLoaderClass.newInstance();
        }
        catch (Exception e) {
            throw new ExecutionException("Error instantiating context loader class " + contextLoaderClassName + ": " + e.getMessage(), e);
        }
       
        return contextLoader;
    }
View Full Code Here

            Resource resource = resources.get(i);
            try {
                urls[i] = resource.getURL();
            }
            catch (IOException e) {
                throw new ExecutionException("Unable to convert resource " + resource.getDescription() + " to URL", e);
            }
        }
        return urls;
    }
View Full Code Here

           
            try {
                return ClassUtils.forName(factoryClass, ClassUtils.getDefaultClassLoader());
            }
            catch (Throwable e) {
                throw new ExecutionException("Unable to load class: " + factoryClass + ": " + e.getMessage(), e);
            }
        }
        Class<?> beanClass = guessBeanClass(element);
        if (beanClass != null) {
            return beanClass;
View Full Code Here

        try {
            Properties props = (Properties) factoryBean.getObject();
            properties = props;
        } catch (IOException e) {
            if (properties != null) {
                throw new ExecutionException("Unable to load properties from " + factoryBean, e);
            }
        }
    }
View Full Code Here

            throw e;
        }
        catch (Throwable e) {
            servletContext.removeAttribute(applicationContextAttributeName);
            servletContext.removeAttribute(servletContextAttributeName);
            throw new ExecutionException(e.getMessage(), e);
        }
    }
View Full Code Here

        }
        return null;
    }

    private static ExecutionException rethrowMethodException(Exception e, String methodName, Object... args) {
        return new ExecutionException("Unable to execute method: " + methodName + ", args: " + Arrays.toString(args), e);
    }
View Full Code Here

    private static ExecutionException rethrowMethodException(Exception e, String methodName, Object... args) {
        return new ExecutionException("Unable to execute method: " + methodName + ", args: " + Arrays.toString(args), e);
    }

    private static ExecutionException rethrowConstructorException(Exception e, Constructor<?> constructor, Object... args) {
        return new ExecutionException("Unable to instantiate object using constructor '" + constructor + "', args: " + Arrays.toString(args), e);
    }
View Full Code Here

     * interface
     */
    static BeanFactory getRootBeanFactory(BeanFactory beanFactory) {

        if (!(beanFactory instanceof HierarchicalBeanFactory)) {
            throw new ExecutionException(BeanFactory.class.getSimpleName()
                    + " " + beanFactory + " is of type "
                    + beanFactory.getClass().getName()
                    + ", which is not an instance of "
                    + HierarchicalBeanFactory.class.getName());
        }
View Full Code Here

            Resource resource = resources.get(i);
            try {
                urls[i] = resource.getURL();
            }
            catch (IOException e) {
                throw new ExecutionException("Unable to convert resource " + resource.getDescription() + " to URL", e);
            }
        }
        return urls;
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.exception.ExecutionException

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.