New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbstractApplicationContext.isRunning throws IllegalStateException when called too early [SPR-13667] #18242

Closed
spring-issuemaster opened this Issue Nov 10, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

spring-issuemaster commented Nov 10, 2015

David Hay opened SPR-13667 and commented

AbstractApplicationContext's implementation of isRunning() looks like this:

public boolean isRunning() {
     return this.getLifecycleProcessor().isRunning();
}

If this method is called before the lifecycle processor has been initialized, an IllegalStateException is thrown.

It seems like the correct behavior here would be to return "false" if the lifecycle processor hasn't been initialized. If the lifecycle processor is uninitialized, the answer to the question "are you running" is "no", not "illegal state".


Affects: 3.2.15, 4.1.7

Referenced from: commits 03585f2, 5d6aab3, e56c11c

Backported to: 4.1.9, 3.2.16

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Nov 10, 2015

Juergen Hoeller commented

Good point - fixed for 4.2.3 now, and to be backported to 4.1.9 and 3.2.16.

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment