Search in sources :

Example 1 with MultiException

use of org.apache.hbase.thirdparty.org.eclipse.jetty.util.MultiException in project hbase by apache.

the class HttpServer method stop.

/**
 * stop the server
 */
public void stop() throws Exception {
    MultiException exception = null;
    for (ListenerInfo li : listeners) {
        if (!li.isManaged) {
            continue;
        }
        try {
            li.listener.close();
        } catch (Exception e) {
            LOG.error("Error while stopping listener for webapp" + webAppContext.getDisplayName(), e);
            exception = addMultiException(exception, e);
        }
    }
    try {
        // clear & stop webAppContext attributes to avoid memory leaks.
        webAppContext.clearAttributes();
        webAppContext.stop();
    } catch (Exception e) {
        LOG.error("Error while stopping web app context for webapp " + webAppContext.getDisplayName(), e);
        exception = addMultiException(exception, e);
    }
    try {
        webServer.stop();
    } catch (Exception e) {
        LOG.error("Error while stopping web server for webapp " + webAppContext.getDisplayName(), e);
        exception = addMultiException(exception, e);
    }
    if (exception != null) {
        exception.ifExceptionThrow();
    }
}
Also used : MultiException(org.apache.hbase.thirdparty.org.eclipse.jetty.util.MultiException) ServletException(javax.servlet.ServletException) URISyntaxException(java.net.URISyntaxException) MultiException(org.apache.hbase.thirdparty.org.eclipse.jetty.util.MultiException) FileNotFoundException(java.io.FileNotFoundException) BindException(java.net.BindException) InterruptedIOException(java.io.InterruptedIOException) HadoopIllegalArgumentException(org.apache.hadoop.HadoopIllegalArgumentException) IOException(java.io.IOException)

Example 2 with MultiException

use of org.apache.hbase.thirdparty.org.eclipse.jetty.util.MultiException in project hbase by apache.

the class HttpServer method start.

/**
 * Start the server. Does not wait for the server to start.
 */
public void start() throws IOException {
    try {
        try {
            openListeners();
            webServer.start();
        } catch (IOException ex) {
            LOG.info("HttpServer.start() threw a non Bind IOException", ex);
            throw ex;
        } catch (MultiException ex) {
            LOG.info("HttpServer.start() threw a MultiException", ex);
            throw ex;
        }
        // Make sure there is no handler failures.
        Handler[] handlers = webServer.getHandlers();
        for (int i = 0; i < handlers.length; i++) {
            if (handlers[i].isFailed()) {
                throw new IOException("Problem in starting http server. Server handlers failed");
            }
        }
        // Make sure there are no errors initializing the context.
        Throwable unavailableException = webAppContext.getUnavailableException();
        if (unavailableException != null) {
            // Have to stop the webserver, or else its non-daemon threads
            // will hang forever.
            webServer.stop();
            throw new IOException("Unable to initialize WebAppContext", unavailableException);
        }
    } catch (IOException e) {
        throw e;
    } catch (InterruptedException e) {
        throw (IOException) new InterruptedIOException("Interrupted while starting HTTP server").initCause(e);
    } catch (Exception e) {
        throw new IOException("Problem starting http server", e);
    }
}
Also used : InterruptedIOException(java.io.InterruptedIOException) Handler(org.apache.hbase.thirdparty.org.eclipse.jetty.server.Handler) GzipHandler(org.apache.hbase.thirdparty.org.eclipse.jetty.server.handler.gzip.GzipHandler) ServletContextHandler(org.apache.hbase.thirdparty.org.eclipse.jetty.servlet.ServletContextHandler) RequestLogHandler(org.apache.hbase.thirdparty.org.eclipse.jetty.server.handler.RequestLogHandler) InterruptedIOException(java.io.InterruptedIOException) IOException(java.io.IOException) MultiException(org.apache.hbase.thirdparty.org.eclipse.jetty.util.MultiException) ServletException(javax.servlet.ServletException) URISyntaxException(java.net.URISyntaxException) MultiException(org.apache.hbase.thirdparty.org.eclipse.jetty.util.MultiException) FileNotFoundException(java.io.FileNotFoundException) BindException(java.net.BindException) InterruptedIOException(java.io.InterruptedIOException) HadoopIllegalArgumentException(org.apache.hadoop.HadoopIllegalArgumentException) IOException(java.io.IOException)

Aggregations

FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 InterruptedIOException (java.io.InterruptedIOException)2 BindException (java.net.BindException)2 URISyntaxException (java.net.URISyntaxException)2 ServletException (javax.servlet.ServletException)2 HadoopIllegalArgumentException (org.apache.hadoop.HadoopIllegalArgumentException)2 MultiException (org.apache.hbase.thirdparty.org.eclipse.jetty.util.MultiException)2 Handler (org.apache.hbase.thirdparty.org.eclipse.jetty.server.Handler)1 RequestLogHandler (org.apache.hbase.thirdparty.org.eclipse.jetty.server.handler.RequestLogHandler)1 GzipHandler (org.apache.hbase.thirdparty.org.eclipse.jetty.server.handler.gzip.GzipHandler)1 ServletContextHandler (org.apache.hbase.thirdparty.org.eclipse.jetty.servlet.ServletContextHandler)1