Package javax.ws.rs

Examples of javax.ws.rs.ClientErrorException


       
        if (response == null) {
            throw new WebApplicationException(cause);
        }
        throw response.getStatus() >= 500 ? new ServerErrorException(response, cause)
            : new ClientErrorException(response, cause);
    }
View Full Code Here


       
        if (response == null) {
            throw new WebApplicationException(cause);
        }
        throw response.getStatus() >= 500 ? new ServerErrorException(response, cause)
            : new ClientErrorException(response, cause);
    }
View Full Code Here

  @Test
  public void testNotAllowedJaxRsException() throws Exception {
    // prepare
    String message = "The request dispatcher does not allow the HTTP method used for the request.";
    Exception exception =
        new ClientErrorException(Response.status(Response.Status.METHOD_NOT_ALLOWED).header(HttpHeaders.ALLOW, "GET")
            .build());

    // execute
    Response response = exceptionMapper.toResponse(exception);
View Full Code Here

        if (!"OPTIONS".equalsIgnoreCase(httpMethod) && logNow) {
            LOG.warning(errorMsg.toString());
        }
        Response response =
            createResponse(resource, message, errorMsg.toString(), status, methodMatched == 0);
        throw new ClientErrorException(response);
       
    }   
View Full Code Here

        if (!"OPTIONS".equalsIgnoreCase(httpMethod) && logNow) {
            LOG.warning(errorMsg.toString());
        }
        Response response =
            createResponse(resource, message, errorMsg.toString(), status, methodMatched == 0);
        throw new ClientErrorException(response);
       
    }   
View Full Code Here

            result = createFromParameterHandler(value, cls, message);
            if (result == null) {
                LOG.severe(new org.apache.cxf.common.i18n.Message("CLASS_CONSTRUCTOR_FAILURE",
                                                                   BUNDLE,
                                                                   pClass.getName()).toString());
                throw new ClientErrorException(HttpUtils.getParameterFailureStatus(pType), ex);
            }
        }
        if (result == null) {
            // check for valueOf(String) static methods
            String[] methodNames = cls.isEnum()
View Full Code Here

        if (!"OPTIONS".equalsIgnoreCase(httpMethod) && logNow) {
            LOG.warning(errorMsg.toString());
        }
        Response response =
            createResponse(resource, message, errorMsg.toString(), status, methodMatched == 0);
        throw new ClientErrorException(response);
       
    }   
View Full Code Here

            result = createFromParameterHandler(value, cls, message);
            if (result == null) {
                LOG.severe(new org.apache.cxf.common.i18n.Message("CLASS_CONSTRUCTOR_FAILURE",
                                                                   BUNDLE,
                                                                   pClass.getName()).toString());
                throw new ClientErrorException(HttpUtils.getParameterFailureStatus(pType), ex);
            }
        }
        if (result == null) {
            // check for valueOf(String) static methods
            String[] methodNames = cls.isEnum()
View Full Code Here

            result = createFromParameterHandler(value, cls, message);
            if (result == null) {
                LOG.severe(new org.apache.cxf.common.i18n.Message("CLASS_CONSTRUCTOR_FAILURE",
                                                                   BUNDLE,
                                                                   pClass.getName()).toString());
                throw new ClientErrorException(HttpUtils.getParameterFailureStatus(pType), ex);
            }
        }
        if (result == null) {
            // check for valueOf(String) static methods
            String[] methodNames = cls.isEnum()
View Full Code Here

        switch (statusFamily) {
            case REDIRECTION:
                webAppException = new RedirectionException(response);
                break;
            case CLIENT_ERROR:
                webAppException = new ClientErrorException(response);
                break;
            case SERVER_ERROR:
                webAppException = new ServerErrorException(response);
                break;
            default:
View Full Code Here

TOP

Related Classes of javax.ws.rs.ClientErrorException

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.