Package javax.ws.rs

Examples of javax.ws.rs.InternalServerErrorException


                        build();
            }

            return response;
        } catch (IOException e) {
            throw new InternalServerErrorException(e);
        }
    }
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

        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

        try {
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            IOUtils.copy(is, bos, 1024);
            return new String(bos.toByteArray(), encoding);
        } catch (Exception ex) {
            throw new InternalServerErrorException(ex);
        }
    }
View Full Code Here

                params.add(HttpUtils.urlDecode(name),
                           decode ? HttpUtils.urlDecode(value) : value);
            } catch (IllegalArgumentException ex) {
                LOG.warning("Illegal URL-encoded characters, make sure that no "
                    + "@FormParam and @Multipart annotations are mixed up");
                throw new InternalServerErrorException();
            } catch (IOException ex) {
                throw new BadRequestException();
            }
        }
    }
View Full Code Here

            int maxPartsCount = Integer.valueOf(maxPartsCountProp);
            if (maxPartsCount != -1 && numberOfParts >= maxPartsCount) {
                throw new WebApplicationException(413);
            }
        } catch (NumberFormatException ex) {
            throw new InternalServerErrorException();
        }
    }
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

            logRedirection(path, attributeName, o);
            rd.forward(servletRequest, mc.getHttpServletResponse());
        } catch (Throwable ex) {
            mc.put(AbstractHTTPDestination.REQUEST_REDIRECTED, Boolean.FALSE);
            ex.printStackTrace();
            throw new InternalServerErrorException(ex);
        }
    }
View Full Code Here

            if (sc == null) {
                String message =
                    new org.apache.cxf.common.i18n.Message("RESOURCE_DISPATCH_NOT_FOUND",
                                                           BUNDLE, servletContextPath).toString();
                LOG.severe(message);
                throw new InternalServerErrorException();
            }
        }
        return sc;
    }
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.