Package org.apache.http

Examples of org.apache.http.NoHttpResponseException


        throws IOException, HttpException, ParseException {

        this.lineBuf.clear();
        int i = sessionBuffer.readLine(this.lineBuf);
        if (i == -1) {
            throw new NoHttpResponseException("The target server failed to respond");
        }
        //create the status line from the status string
        ParserCursor cursor = new ParserCursor(0, this.lineBuf.length());
        StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor);
        return this.responseFactory.newHttpResponse(statusline, null);
View Full Code Here


        int count = 0;
        do {
            int i = this.datareceiver.readLine(this.buffer);
            if (i == -1 && count == 0) {
                // The server just dropped connection on us
                throw new NoHttpResponseException("The server " +
                        this.targethost.getHostName() + " failed to respond");
            }
            if (startsWithHTTP(this.buffer)) {
                // Got one
                break;
View Full Code Here

        ParserCursor cursor = null;
        do {
            int i = sessionBuffer.readLine(this.lineBuf);
            if (i == -1 && count == 0) {
                // The server just dropped connection on us
                throw new NoHttpResponseException("The target server failed to respond");
            }
            cursor = new ParserCursor(0, this.lineBuf.length());
            if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) {
                // Got one
                break;
View Full Code Here

        ParserCursor cursor = null;
        do {
            int i = sessionBuffer.readLine(this.lineBuf);
            if (i == -1 && count == 0) {
                // The server just dropped connection on us
                throw new NoHttpResponseException("The target server failed to respond");
            }
            cursor = new ParserCursor(0, this.lineBuf.length());
            if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) {
                // Got one
                break;
View Full Code Here

                    if (this.log.isInfoEnabled()) {
                        this.log.info("Retrying request to " + route);
                    }
                } else {
                    if (ex instanceof NoHttpResponseException) {
                        final NoHttpResponseException updatedex = new NoHttpResponseException(
                                route.getTargetHost().toHostString() + " failed to respond");
                        updatedex.setStackTrace(ex.getStackTrace());
                        throw updatedex;
                    } else {
                        throw ex;
                    }
                }
View Full Code Here

  protected void validateResponse(HttpInvokerClientConfiguration config, HttpResponse response)
      throws IOException {

    StatusLine status = response.getStatusLine();
    if (status.getStatusCode() >= 300) {
      throw new NoHttpResponseException(
          "Did not receive successful HTTP response: status code = " + status.getStatusCode() +
          ", status message = [" + status.getReasonPhrase() + "]");
    }
  }
View Full Code Here

  protected void validateResponse(HttpInvokerClientConfiguration config, HttpResponse response)
      throws IOException {

    StatusLine status = response.getStatusLine();
    if (status.getStatusCode() >= 300) {
      throw new NoHttpResponseException(
          "Did not receive successful HTTP response: status code = " + status.getStatusCode() +
          ", status message = [" + status.getReasonPhrase() + "]");
    }
  }
View Full Code Here

        int count = 0;
        do {
            int i = this.datareceiver.readLine(this.buffer);
            if (i == -1 && count == 0) {
                // The server just dropped connection on us
                throw new NoHttpResponseException("The target server failed to respond");
            }
            if (startsWithHTTP(this.buffer)) {
                // Got one
                break;
            } else if (i == -1 || count >= maxGarbageLines) {
View Full Code Here

        int count = 0;
        do {
            int i = this.datareceiver.readLine(this.buffer);
            if (i == -1 && count == 0) {
                // The server just dropped connection on us
                throw new NoHttpResponseException("The server " +
                        this.targethost.getHostName() + " failed to respond");
            }
            if (startsWithHTTP(this.buffer)) {
                // Got one
                break;
View Full Code Here

        int count = 0;
        do {
            int i = this.datareceiver.readLine(this.buffer);
            if (i == -1 && count == 0) {
                // The server just dropped connection on us
                throw new NoHttpResponseException("The target server failed to respond");
            }
            if (startsWithHTTP(this.buffer)) {
                // Got one
                break;
            } else if (i == -1 || count >= this.maxGarbageLines) {
View Full Code Here

TOP

Related Classes of org.apache.http.NoHttpResponseException

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.