Example usage for org.springframework.boot.web.embedded.tomcat TomcatStarter getStartUpException

List of usage examples for org.springframework.boot.web.embedded.tomcat TomcatStarter getStartUpException

Introduction

In this page you can find the example usage for org.springframework.boot.web.embedded.tomcat TomcatStarter getStartUpException.

Prototype

Exception getStartUpException() 

Source Link

Usage

From source file:org.springframework.boot.web.embedded.tomcat.TomcatWebServer.java

private void rethrowDeferredStartupExceptions() throws Exception {
    Container[] children = this.tomcat.getHost().findChildren();
    for (Container container : children) {
        if (container instanceof TomcatEmbeddedContext) {
            TomcatStarter tomcatStarter = ((TomcatEmbeddedContext) container).getStarter();
            if (tomcatStarter != null) {
                Exception exception = tomcatStarter.getStartUpException();
                if (exception != null) {
                    throw exception;
                }/*w w  w  . ja  v a 2 s.  co m*/
            }
        }
        if (!LifecycleState.STARTED.equals(container.getState())) {
            throw new IllegalStateException(container + " failed to start");
        }
    }
}