Skip to content
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-projects-issues opened this issue Nov 10, 2015 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues 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-projects-issues
Copy link
Collaborator Author

spring-projects-issues 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

@spring-projects-issues spring-projects-issues added type: bug A general bug status: backported An issue that has been backported to maintenance branches in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.2.3 milestone Jan 11, 2019
This was referenced Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants