Package javax.ws.rs

Examples of javax.ws.rs.InternalServerErrorException


            org.apache.cxf.common.i18n.Message message =
                new org.apache.cxf.common.i18n.Message("NO_MSG_WRITER",
                                                   BUNDLE,
                                                   cls);
            LOG.severe(message.toString());
            throw new InternalServerErrorException();
        }
       
        return new MessageBodyWriterDataHandler<T>(r, obj, cls, genericType, anns, mt);
    }
View Full Code Here


        public void writeTo(OutputStream os) {
            try {
                writer.writeTo(obj, cls, genericType, anns, contentType,
                               new MetadataMap<String, Object>(), os);
            } catch (IOException ex) {
                throw new InternalServerErrorException(ex);
            }
        }
View Full Code Here

            String path = ui.getPath(false);
            if ("wrongpath".equals(path)) {
                context.setRequestUri(URI.create("/bookstore/bookheaders/simple"));
            } else if ("throwException".equals(path)) {
                context.setProperty("filterexception", "prematch");
                throw new InternalServerErrorException(
                    Response.status(500).type("text/plain")
                        .entity("Prematch filter error").build());
            }
        }
View Full Code Here

        private UriInfo ui;
        @Override
        public void filter(ContainerRequestContext context) throws IOException {
            if (ui.getQueryParameters().getFirst("throwException") != null) {
                context.setProperty("filterexception", "postmatch");
                throw new InternalServerErrorException(
                    Response.status(500).type("text/plain")
                        .entity("Postmatch filter error").build());
            }
            String value = context.getHeaders().getFirst("Book");
            if (value != null) {
View Full Code Here

                }
            }
        }
       
        if (name == null) {
            throw new InternalServerErrorException();
        }
       
        return "{\"" + name + "\":";
    }
View Full Code Here

        } catch (JAXBException e) {
            handleJAXBException(e, false);
        } catch (XMLStreamException e) {
            handleXMLStreamException(e, false);
        } catch (Exception e) {
            throw new InternalServerErrorException(e);
        } finally {
            StaxUtils.close(writer);
        }
    }
View Full Code Here

        private UriInfo ui;
        @Override
        public void filter(ContainerRequestContext context) throws IOException {
            if (ui.getQueryParameters().getFirst("throwException") != null) {
                context.setProperty("filterexception", "postmatch");
                throw new InternalServerErrorException(
                    Response.status(500).type("text/plain")
                        .entity("Postmatch filter error").build());
            }
            String value = context.getHeaders().getFirst("Book");
            if (value != null) {
View Full Code Here

            String path = ui.getPath(false);
            if ("wrongpath".equals(path)) {
                context.setRequestUri(URI.create("/bookstore/bookheaders/simple"));
            } else if ("throwException".equals(path)) {
                context.setProperty("filterexception", "prematch");
                throw new InternalServerErrorException(
                    Response.status(500).type("text/plain")
                        .entity("Prematch filter error").build());
            }
        }
View Full Code Here

        if (bmi == null) {
            // we could've started introspecting now but the fact no bean info
            // is available indicates that the one created at start up has been
            // lost and hence it is 500
            LOG.warning("Bean parameter info is not available");
            throw new InternalServerErrorException();
        }
        Object instance;
        try {
            instance = ClassLoaderUtils.loadClass(clazz.getName(), JAXRSUtils.class).newInstance();
        } catch (Throwable t) {
            throw new InternalServerErrorException(t);
        }
        JAXRSUtils.injectParameters(ori, bmi, instance, m);
       
        InjectionUtils.injectContexts(instance, bmi, m);
       
View Full Code Here

            for (ProviderInfo<ContainerRequestFilter> filter : containerFilters) {
                try {
                    InjectionUtils.injectContexts(filter.getProvider(), filter, m);
                    filter.getProvider().filter(context);
                } catch (IOException ex) {
                    throw new InternalServerErrorException(ex);
                }
                Response response = m.getExchange().get(Response.class);
                if (response != null) {
                    setMessageContentType(m, response);
                    return true;
View Full Code Here

TOP

Related Classes of javax.ws.rs.InternalServerErrorException

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.