Package javax.ws.rs

Examples of javax.ws.rs.InternalServerErrorException


    protected static void handleExceptionEnd(Throwable t, String message, boolean read) {
        Response.Status status = read
            ? Response.Status.BAD_REQUEST : Response.Status.INTERNAL_SERVER_ERROR;
        Response r = Response.status(status)
            .type(MediaType.TEXT_PLAIN).entity(message).build();
        throw read ? new BadRequestException(r, t) : new InternalServerErrorException(r, t);
    }
View Full Code Here


                    int elementLevel = elementLevelStr != null ? Integer.valueOf(elementLevelStr) : -1;
                    int innerElementCount = innerElementCountStr != null
                        ? Integer.valueOf(innerElementCountStr) : -1;
                    return new DocumentDepthProperties(totalElementCount, elementLevel, innerElementCount);
                } catch (Exception ex) {
                    throw new InternalServerErrorException(ex);
                }
            }
        }
        return null;
    }
View Full Code Here

        Response excResponse = JAXRSUtils.convertFaultToResponse(ex, message);
        if (excResponse == null) {
            ProviderFactory.getInstance(message).clearThreadLocalProxies();
            message.getExchange().put(Message.PROPOGATE_EXCEPTION,
                                      JAXRSUtils.propogateException(message));
            throw ex instanceof RuntimeException ? (RuntimeException)ex : new InternalServerErrorException(ex);
        }
        message.getExchange().put(Response.class, excResponse);
    }
View Full Code Here

            reportServerError("METHOD_ACCESS_FAILURE", method.getName());
        } catch (InvocationTargetException ex) {
            Response r = JAXRSUtils.convertFaultToResponse(ex.getCause(), inMessage);
            if (r != null) {
                inMessage.getExchange().put(Response.class, r);
                throw new InternalServerErrorException();
            }
            reportServerError("METHOD_ACCESS_FAILURE", method.getName());
        } catch (Exception ex) {
            reportServerError("METHOD_INJECTION_FAILURE", method.getName());
        }
View Full Code Here

                                                   parameter);
        LOG.severe(errorMessage.toString());
        Response r = Response.status(Response.Status.INTERNAL_SERVER_ERROR)
                         .type(MediaType.TEXT_PLAIN_TYPE)
                         .entity(errorMessage.toString()).build();
        throw new InternalServerErrorException(r);
    }
View Full Code Here

                    + " due to InvocationTargetException";
                throw new WebApplicationException(Response.serverError().entity(msg).build());
            } catch (IllegalAccessException ex) {
                String msg = "Method " + method.getName() + " can not be invoked"
                    + " due to IllegalAccessException";
                throw new InternalServerErrorException(Response.serverError().entity(msg).build());
            }
        }
    }
View Full Code Here

            return entity;
        }
        try {
            return DOMUtils.readXml(new StringReader(entity));
        } catch (Exception ex) {
            throw new InternalServerErrorException(ex);
        }
    }
View Full Code Here

                            return Response.ok().type(mt).entity(new DOMSource(appEl)).build();
                        }

                    }
                } catch (Exception ex) {
                    throw new InternalServerErrorException(ex);
                }
            }
        }
        return null;
    }
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

            reportServerError("METHOD_ACCESS_FAILURE", method.getName());
        } catch (InvocationTargetException ex) {
            Response r = JAXRSUtils.convertFaultToResponse(ex.getCause(), inMessage);
            if (r != null) {
                inMessage.getExchange().put(Response.class, r);
                throw new InternalServerErrorException();
            }
            reportServerError("METHOD_ACCESS_FAILURE", method.getName());
        } catch (Exception ex) {
            reportServerError("METHOD_INJECTION_FAILURE", method.getName());
        }
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.