Skip to content

Commit 5d6aab3

Browse files
committed
Reduced warn log entry without stacktrace for startup exceptions
Also, AbstractApplicationContext.isRunning avoids IllegalStateException now. Issue: SPR-13663 Issue: SPR-13667
1 parent 90a2885 commit 5d6aab3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,10 @@ public void refresh() throws BeansException, IllegalStateException {
484484
}
485485

486486
catch (BeansException ex) {
487-
logger.warn("Exception encountered during context initialization - cancelling refresh attempt", ex);
487+
if (logger.isWarnEnabled()) {
488+
logger.warn("Exception encountered during context initialization - " +
489+
"cancelling refresh attempt: " + ex);
490+
}
488491

489492
// Destroy already created singletons to avoid dangling resources.
490493
destroyBeans();
@@ -1182,7 +1185,7 @@ public void stop() {
11821185

11831186
@Override
11841187
public boolean isRunning() {
1185-
return getLifecycleProcessor().isRunning();
1188+
return (this.lifecycleProcessor != null && this.lifecycleProcessor.isRunning());
11861189
}
11871190

11881191

0 commit comments

Comments
 (0)