Reason
Because a bean will be destroyed and removed from the application listener beans held by the context,before the application failed event is fired.
The code(Spring Boot 1.5.8.RELEASE)
The bean is destroyed
SimpleApplicationEventMulticaster(AbstractApplicationEventMulticaster).removeApplicationListenerBean(String) line: 133
ApplicationListenerDetector.postProcessBeforeDestruction(Object, String) line: 99
DisposableBeanAdapter.destroy() line: 253
DefaultListableBeanFactory(DefaultSingletonBeanRegistry).destroyBean(String, DisposableBean) line: 578
DefaultListableBeanFactory(DefaultSingletonBeanRegistry).destroySingleton(String) line: 554
DefaultListableBeanFactory.destroySingleton(String) line: 961
DefaultListableBeanFactory(DefaultSingletonBeanRegistry).destroySingletons() line: 523
DefaultListableBeanFactory(FactoryBeanRegistrySupport).destroySingletons() line: 230
DefaultListableBeanFactory.destroySingletons() line: 968
AnnotationConfigApplicationContext(AbstractApplicationContext).destroyBeans() line: 1030
AnnotationConfigApplicationContext(AbstractApplicationContext).refresh() line: 556
SpringApplication.refresh(ApplicationContext) line: 693
SpringApplication.refreshContext(ConfigurableApplicationContext) line: 360
SpringApplication.run(String...) line: 303
SpringApplication.run(Object[], String[]) line: 1118
SpringApplication.run(Object, String...) line: 1107
ToolsApplication.main(String[]) line: 16
ApplicationFailedEvent is fired
ApplicationFailedEventListener.onApplicationEvent(ApplicationFailedEvent) line: 31
ApplicationFailedEventListener.onApplicationEvent(ApplicationEvent) line: 1
SimpleApplicationEventMulticaster.doInvokeListener(ApplicationListener, ApplicationEvent) line: 172
SimpleApplicationEventMulticaster.invokeListener(ApplicationListener<?>, ApplicationEvent) line: 158
SimpleApplicationEventMulticaster.multicastEvent(ApplicationEvent, ResolvableType) line: 139
SimpleApplicationEventMulticaster.multicastEvent(ApplicationEvent) line: 122
EventPublishingRunListener.finished(ConfigurableApplicationContext, Throwable) line: 115
SpringApplicationRunListeners.callFinishedListener(SpringApplicationRunListener, ConfigurableApplicationContext, Throwable) line: 79
SpringApplicationRunListeners.finished(ConfigurableApplicationContext, Throwable) line: 72
SpringApplication.handleRunFailure(ConfigurableApplicationContext, SpringApplicationRunListeners, FailureAnalyzers, Throwable) line: 745
SpringApplication.run(String...) line: 314
SpringApplication.run(Object[], String[]) line: 1118
SpringApplication.run(Object, String...) line: 1107
ToolsApplication.main(String[]) line: 16