Package org.glassfish.jersey.server

Examples of org.glassfish.jersey.server.ContainerException


        String regex = (String) getConfiguration().getProperty(ServletProperties.FILTER_STATIC_CONTENT_REGEX);
        if (regex != null && regex.length() > 0) {
            try {
                staticContentPattern = Pattern.compile(regex);
            } catch (PatternSyntaxException ex) {
                throw new ContainerException(LocalizationMessages.INIT_PARAM_REGEX_SYNTAX_INVALID(
                        regex, ServletProperties.FILTER_STATIC_CONTENT_REGEX), ex);
            }
        }

        this.filterContextPath = filterConfig.getInitParameter(ServletProperties.FILTER_CONTEXT_PATH);
View Full Code Here


            return;
        }

        if (filterContextPath != null) {
            if (!servletPath.startsWith(filterContextPath)) {
                throw new ContainerException(LocalizationMessages.SERVLET_PATH_MISMATCH(servletPath, filterContextPath));
                //TODO:
//            } else if (servletPath.length() == filterContextPath.length()) {
//                // Path does not end in a slash, may need to redirect
//                if (webComponent.getResourceConfig().getFeature(ResourceConfig.FEATURE_REDIRECT)) {
//                    URI l = UriBuilder.fromUri(request.getRequestURL().toString()).
View Full Code Here

            return null;
        } else {
            try {
                return response.getOutputStream();
            } catch (IOException e) {
                throw new ContainerException(e);
            }
        }
    }
View Full Code Here

                            response.sendError(status);
                        } else {
                            response.sendError(status, reason);
                        }
                    } catch (IOException ex) {
                        throw new ContainerException("I/O exception occurred while sending [" + status + "] error response.", ex);
                    }
                }
            }
        } finally {
            asyncExt.complete();
View Full Code Here

                    response.sendError(500, "Request failed.");
                } catch (IllegalStateException ex) {
                    // a race condition externally committing the response can still occur...
                    LOGGER.log(Level.FINER, "Unable to reset failed response.", ex);
                } catch (IOException ex) {
                    throw new ContainerException("I/O exception occurred while sending 'Request failed.' error response.", ex);
                } finally {
                    asyncExt.complete();
                }
            }
        } finally {
View Full Code Here

     */
    private void rethrow(Throwable error) {
        if (error instanceof RuntimeException) {
            throw (RuntimeException) error;
        } else {
            throw new ContainerException(error);
        }
    }
View Full Code Here

    private ContainerResponse getResponseContext() {
        try {
            return responseContext.get();
        } catch (InterruptedException ex) {
            throw new ContainerException(ex);
        } catch (ExecutionException ex) {
            throw new ContainerException(ex);
        }
    }
View Full Code Here

        String regex = (String) getConfiguration().getProperty(ServletProperties.FILTER_STATIC_CONTENT_REGEX);
        if (regex != null && regex.length() > 0) {
            try {
                staticContentPattern = Pattern.compile(regex);
            } catch (PatternSyntaxException ex) {
                throw new ContainerException(LocalizationMessages.INIT_PARAM_REGEX_SYNTAX_INVALID(
                        regex, ServletProperties.FILTER_STATIC_CONTENT_REGEX), ex);
            }
        }

        this.filterContextPath = filterConfig.getInitParameter(ServletProperties.FILTER_CONTEXT_PATH);
View Full Code Here

            return;
        }

        if (filterContextPath != null) {
            if (!servletPath.startsWith(filterContextPath)) {
                throw new ContainerException(LocalizationMessages.SERVLET_PATH_MISMATCH(servletPath, filterContextPath));
                //TODO:
//            } else if (servletPath.length() == filterContextPath.length()) {
//                // Path does not end in a slash, may need to redirect
//                if (webComponent.getResourceConfig().getFeature(ResourceConfig.FEATURE_REDIRECT)) {
//                    URI l = UriBuilder.fromUri(request.getRequestURL().toString()).
View Full Code Here

        final Template template = configuration.getTemplate(templateReference);

        try {
            template.process(viewable.getModel(), new OutputStreamWriter(out));
        } catch (TemplateException te) {
            throw new ContainerException(te);
        }
    }
View Full Code Here

TOP

Related Classes of org.glassfish.jersey.server.ContainerException

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.