Examples of InternalServerErrorException


Examples of javax.ws.rs.InternalServerErrorException

        return cls == null ? defaultExceptionType : cls;
    }
   
    public static InternalServerErrorException toInternalServerErrorException(Throwable cause, Response response) {
       
        return new InternalServerErrorException(checkResponse(response, 500), cause);
    }
View Full Code Here

Examples of javax.ws.rs.InternalServerErrorException

            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());
            }
           
            MediaType mt = context.getMediaType();
View Full Code Here

Examples of javax.ws.rs.InternalServerErrorException

        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

Examples of javax.ws.rs.InternalServerErrorException

    }
   
    @GET
    @Path("/books/webex2")
    public Books getBookWebEx2() {
        throw new InternalServerErrorException(new RuntimeException("Book web exception"));
    }
View Full Code Here

Examples of javax.ws.rs.InternalServerErrorException

                    + ".json");
            return Response.created(location)
                    .header(SyncopeConstants.REST_HEADER_ID, created.getKey())
                    .build();
        } catch (UnsupportedEncodingException e) {
            throw new InternalServerErrorException(e);
        }
    }
View Full Code Here

Examples of javax.ws.rs.InternalServerErrorException

                    + ".json");
            return Response.created(location)
                    .header(SyncopeConstants.REST_HEADER_ID, schema.getName())
                    .build();
        } catch (UnsupportedEncodingException e) {
            throw new InternalServerErrorException(e);
        }
    }
View Full Code Here

Examples of javax.ws.rs.InternalServerErrorException

                    + ".json");
            return Response.created(location).
                    header(SyncopeConstants.REST_HEADER_ID, resource.getName()).
                    build();
        } catch (UnsupportedEncodingException e) {
            throw new InternalServerErrorException(e);
        }
    }
View Full Code Here

Examples of javax.ws.rs.InternalServerErrorException

                        build();
            }

            return response;
        } catch (IOException e) {
            throw new InternalServerErrorException(e);
        }
    }
View Full Code Here

Examples of javax.ws.rs.InternalServerErrorException

        return cls == null ? defaultExceptionType : cls;
    }
   
    public static InternalServerErrorException toInternalServerErrorException(Throwable cause, Response response) {
       
        return new InternalServerErrorException(checkResponse(response, 500), cause);
    }
View Full Code Here

Examples of javax.ws.rs.InternalServerErrorException

        Class<?> actualCls = InjectionUtils.getActualType(t);
        @SuppressWarnings("unchecked")
        MessageBodyWriter<T> writer =
            (MessageBodyWriter<T>)providers.getMessageBodyWriter(actualCls, actualCls, anns, mt);
        if (writer == null) {
            throw new InternalServerErrorException();
        }
        //TODO: review the possibility of caching the providers
        StreamingResponseWriter thewriter =
            new StreamingResponseWriter(writer, actualCls, anns, mt, headers, os);
        p.writeTo(thewriter);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.