Package javax.ws.rs

Examples of javax.ws.rs.InternalServerErrorException


            } else {
                return objectMapper.writeValueAsString(x);
            }
        } catch (JsonProcessingException e) {
            LOG.error("Error while generating JSON", e);
            throw new InternalServerErrorException(e);
        }
    }
View Full Code Here


        if (firstTry) {
            excResponse = JAXRSUtils.convertFaultToResponse(ex, message);
        }
        if (excResponse == null) {
            setResponseStatus(message, 500);
            throw new InternalServerErrorException(ex);
        } else {
            serializeMessage(pf, message, excResponse, null, false);
        }
           
    }
View Full Code Here

    public <T> T getResource(Class<T> cls) {
        T resource = null;
        try {
            resource = cls.newInstance();
        } catch (Throwable ex) {
            throw new InternalServerErrorException(ex);
        }
        return doInitResource(cls, resource);
    }
View Full Code Here

        return cls == null ? defaultExceptionType : cls;
    }
   
    public static InternalServerErrorException toInternalServerErrorException(Throwable cause, Response response) {
       
        return new InternalServerErrorException(checkResponse(response, 500), cause);
    }
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());
            }
           
            MediaType mt = context.getMediaType();
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

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

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

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

                    + ".json");
            return Response.created(location).
                    header(SyncopeConstants.REST_HEADER_ID, resource.getName()).
                    build();
        } catch (UnsupportedEncodingException e) {
            throw new InternalServerErrorException(e);
        }
    }
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.