• Andy Wilkinson's avatar
    Make context available when handling refresh failure · 474aed05
    Andy Wilkinson authored
    Previously, if SpringApplication.run failed due to the refresh of the
    application context throwing an exception, the application context
    would not be available during run failure handling. This meant that
    null was passed to any SpringApplicationRunListeners, however the
    javadoc for the finished method does not indicate that it is possible
    for null to be passed in. In addition to the possibility of a
    NullPointerException, a side-effect of this behaviour was that the
    auto-configuration report was not produced when refresh fails, making
    it useless as a tool for diagnosing refresh failures.
    
    This commit updates SpringApplication to take a reference to the
    application context as early as possible and, crucially, before it
    has been refreshed. This means that refresh no longer has to succeed for
    the context to be passed to any SpringApplicationRunListeners and that
    they will now receive an inactive context, rather than a null context in
    the event of a refresh failure.
    
    Closes gh-5325
    474aed05
Name
Last commit
Last update
.mvn Loading commit data...
eclipse Loading commit data...
spring-boot Loading commit data...
spring-boot-actuator Loading commit data...
spring-boot-actuator-docs Loading commit data...
spring-boot-autoconfigure Loading commit data...
spring-boot-cli Loading commit data...
spring-boot-dependencies Loading commit data...
spring-boot-deployment-tests Loading commit data...
spring-boot-devtools Loading commit data...
spring-boot-docs Loading commit data...
spring-boot-full-build Loading commit data...
spring-boot-integration-tests Loading commit data...
spring-boot-parent Loading commit data...
spring-boot-samples Loading commit data...
spring-boot-starters Loading commit data...
spring-boot-test Loading commit data...
spring-boot-tools Loading commit data...
.gitignore Loading commit data...
.settings-template.xml Loading commit data...
.travis.yml Loading commit data...
CODE_OF_CONDUCT.adoc Loading commit data...
CONTRIBUTING.adoc Loading commit data...
LICENSE.txt Loading commit data...
README.adoc Loading commit data...
mvnw Loading commit data...
mvnw.cmd Loading commit data...
pom.xml Loading commit data...