Package org.impalaframework.exception

Examples of org.impalaframework.exception.ConfigurationException


        if (defaultValueString != null && defaultValue == null) {
            try {
                defaultValue = new SimpleDateFormat(pattern).parse(defaultValueString);
            }
            catch (ParseException e) {
                throw new ConfigurationException("Default value '" + defaultValueString + "' does not convert to a date using pattern: " + pattern, e);
            }
        }
    }
View Full Code Here


    protected void initServletProperties(HttpServlet servlet) {
        super.initServletProperties(servlet);
        Assert.notNull(delegateServlet, "delegateServlet cannot be null");
       
        if (!(servlet instanceof InternalFrameworkIntegrationServlet)) {
            throw new ConfigurationException(servlet + " must be an instanceof " + InternalFrameworkIntegrationServlet.class.getName());
        }
       
        InternalFrameworkIntegrationServlet integrationServlet = (InternalFrameworkIntegrationServlet) servlet;
        integrationServlet.setDelegateServlet(delegateServlet);
    }
View Full Code Here

                String expression = trim.substring(constantPrefix.length(), trim.length() - constantSuffix.length()).trim();
               
                int lastDotIndex = expression.lastIndexOf('.');
               
                if (lastDotIndex < 0) {
                    throw new ConfigurationException("Invalid expression '" + expression + "' in expression '" + strVal + "'. Must evaluate to constant (e.g. 'constant:[org.impalframework.constants.LocationConstant.MODULE_CLASS_DIR_PROPERTY]'");
                }
               
                String className = expression.substring(0, lastDotIndex);
                String fieldName = expression.substring(lastDotIndex + 1);
               
                try {
                    Class<?> clazz = Class.forName(className, true, classLoader);
                    try {
                        Field field = clazz.getField(fieldName);
                        Object value = field.get(null);
                        if (value != null) {
                            return value.toString();
                        } else {
                            throw new ConfigurationException("Field '" + fieldName + "' in class " + className + " in expression '" + strVal + "' cannot evaluate to null");
                        }
                    }
                    catch (ConfigurationException e) {
                        throw e;
                    }
                    catch (Exception e) {
                        throw new ConfigurationException("Field '" + fieldName + "' in class " + className + " in expression '" + strVal + "' could not be evaluated. Could not evaluate constant in bean '" + beanName +"'", e);
                    }
                }
                catch (ClassNotFoundException e) {
                    throw new ConfigurationException("Class '" + className + "' in expression '" + strVal + "' could not be found. Could not evaluate constant in bean '" + beanName +"'" );
                }
            }
           
            return strVal;
        }
View Full Code Here

            //make sure that the delegate servlet is available
            HttpServlet delegateServlet = ObjectUtils.cast(wac.getBean(delegateServletBeanName),
                    HttpServlet.class);
           
            if (delegateServlet == null) {
                throw new ConfigurationException("No Servlet registered under name " + delegateServletBeanName);
            }
            this.invoker = getInvoker(wac, delegateServlet, this.frameworkLockHolder, this.setThreadContextClassLoader);
            return wac;
           
        }
View Full Code Here

                final Object bean = beanFactory.getBean(key);
                if (bean != null) {
                    try {
                        registry.addItem(registrationKey, bean);
                    } catch (ClassCastException e) {
                        throw new ConfigurationException("Bean '" + key + "' is not type compatible with " +
                                "registry bean '" + registryBeanName + "'");
                    }
                }
        }
    }
View Full Code Here

       
        if (exportNames == null) {
            exportNames = beanNames;
        } else {
            if (exportNames.length != beanNames.length) {
                throw new ConfigurationException("beanNames array length [" + beanNames.length + "] is not the same length as exportNames array [" + exportNames.length + "]");
            }
        }
       
        for (int i = 0; i < beanNames.length; i++) {
            String beanName = beanNames[i];
View Full Code Here

        }
        return moduleNames;
    }

    private void invalidChar(char[] chars, int i) {
        throw new ConfigurationException("Invalid definition string " + definitionString + ". Invalid character '" + chars[i]
                + "' at column " + (i + 1));
    }
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

    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

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.