Why doesn't spring's download app come out gracefully?

I am running the spring boot application using the bootRun task in Intellij (13.1.5 on linux) and I am trying to disable the listener thread in the lifecycle callback, however when I stop the application in Intellij, I find that the listener thread is still running and registering.

  • In the console:

    "Disconnected from the target virtual machine, address: ..., transport: 'socket' 6:39:22 AM: External task completed with 'bootRun'.

  • Then I made ps grep and killed the process, only then console prints:

    "2016-03-28 06: 39: 59.606 INFO 7740 --- [Thread-1] ationConfigEmbeddedWebApplicationContext: Closing org.springframework.boot .context.embedded.AnnotationConfigEmbeddedWebApplicationContext @ 657617e6: ... 2016-03-28 06: 39: 59.611 INFO 7740 --- [Thread-1] osjeaAnnotationMBeanExporter: Unregister JMX beans at shutdown

My questions:

  • Why stop the application in Intellij without closing the application context?
  • Accodring to Doc, the spring web application automatically logs stop hooks. But I tried @PreDestroy, destroMethod and implements LifeCycle, why are none of them called?
+4
source share

All Articles