Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-13667

AbstractApplicationContext.isRunning throws IllegalStateException when called too early

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Complete
    • 3.2.15, 4.1.7
    • 3.2.16, 4.1.9, 4.2.3
    • Core
    • None
    • true

    Description

      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".

      Attachments

        Activity

          People

            juergen.hoeller Juergen Hoeller
            dhay David Hay
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              3 years, 47 weeks, 2 days ago