Package net.sourceforge.stripes.exception

Examples of net.sourceforge.stripes.exception.StripesRuntimeException


        try {
            TypeConverterFactory factory = StripesFilter.getConfiguration().getTypeConverterFactory();
            return factory.getTypeConverter(targetType, this.locale);
        }
        catch (Exception e) {
            throw new StripesRuntimeException(
                    "You are using the OneToManyTypeConverter to convert a String to a List of " +
                            "items for which there is no registered converter! Please check that the " +
                            "TypeConverterFactory knows how to make a converter for: " +
                            targetType, e
            );
View Full Code Here


     * Default constructor that checks to make sure this class can work, and if not throws
     * an exception.
     */
    public CommonsElExpressionExecutor() {
        if (getEvaluator() == null) {
            throw new StripesRuntimeException("Apache commons EL does not appear to be available.");
        }
    }
View Full Code Here

                this.validatePattern = globToPattern(getValidatedProperties(beanClass));
            }
        }
        catch (Exception e) {
            log.error(e, "%%% Failure instantiating ", getClass().getName());
            StripesRuntimeException sre = new StripesRuntimeException(e.getMessage(), e);
            sre.setStackTrace(e.getStackTrace());
            throw sre;
        }
    }
View Full Code Here

                String eventName = getHandledEvent(method);

                // look for duplicate event names within the current class
                if (classMappings.containsKey(eventName)
                        && clazz.equals(classMappings.get(eventName).getDeclaringClass())) {
                    throw new StripesRuntimeException("The ActionBean " + clazz
                            + " declares multiple event handlers for event '" + eventName + "'");
                }

                DefaultHandler defaultMapping = method.getAnnotation(DefaultHandler.class);
                if (eventName != null) {
                    classMappings.put(eventName, method);
                }
                if (defaultMapping != null) {
                    // look for multiple default handlers within the current class
                    if (classMappings.containsKey(DEFAULT_HANDLER_KEY)
                            && clazz.equals(classMappings.get(DEFAULT_HANDLER_KEY).getDeclaringClass())) {
                        throw new StripesRuntimeException("The ActionBean " + clazz
                                + " declares multiple default event handlers");
                    }

                    // Makes sure we catch the default handler
                    classMappings.put(DEFAULT_HANDLER_KEY, method);
View Full Code Here

        }
        else if (eventParams.size() == 1) {
            return eventParams.get(0);
        }
        else {
            throw new StripesRuntimeException("Multiple event parameters " + eventParams
                    + " are present in this request. Only one event parameter may be specified "
                    + "per request. Otherwise, Stripes would be unable to determine which event "
                    + "to execute.");
        }
    }
View Full Code Here

                      "ActionBean, using the configuration parameter '", PACKAGES,  "'.");
        }

        String packages = bootstrap.getProperty(PACKAGES);
        if (packages == null) {
            throw new StripesRuntimeException(
                "You must supply a value for the configuration parameter '" + PACKAGES + "'. The " +
                "value should be a list of one or more package roots (comma separated) that are " +
                "to be scanned for ActionBean implementations. The packages specified and all " +
                "subpackages are examined for implementations of ActionBean."
            );
View Full Code Here

                    log.warn("Error closing input stream", e);
                }
            }
        }
        else {
            throw new StripesRuntimeException("A StreamingResolution was constructed without " +
                    "supplying a Reader or InputStream, but stream() was not overridden. Please " +
                    "either supply a source of streaming data, or override the stream() method.");
        }
    }
View Full Code Here

            return wrapper;
        }
        catch (IOException ioe) { throw ioe; }
        catch (FileUploadLimitExceededException fulee) { throw fulee; }
        catch (Exception e) {
            throw new StripesRuntimeException
                    ("Could not construct a MultipartWrapper for the current request.", e);
        }
    }
View Full Code Here

                ValidationMetadata validate = getValidationMetadata();
                if (validate != null && validate.encrypted())
                    formatted = CryptoUtil.encrypt(formatted);
            }
            catch (JspException e) {
                throw new StripesRuntimeException(e);
            }
        }

        return formatted;
    }
View Full Code Here

            }
            else if (lcFormatType.equals("time")) {
                format = DateFormat.getTimeInstance(namedPatterns.get(lcFormatString), locale);
            }
            else {
                throw new StripesRuntimeException("Invalid formatType for Date: " + formatType +
                ". Allowed types are 'date', 'time' and 'datetime'.");
            }
        }
        else {
            format = new SimpleDateFormat(formatPattern, locale);
View Full Code Here

TOP

Related Classes of net.sourceforge.stripes.exception.StripesRuntimeException

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.