Announcement Announcement Module

JavaConfig forum decommissioned in favor of Core Container

As described at

key features of the Spring JavaConfig project have been migrated into the core Spring Framework as of version 3.0.

Please see the Spring 3.0 documentation on @Configuration and @Bean support:

For any questions related to @Configuration classes and @Bean methods in Spring 3.0, please post in the dedicated 'Core Container' forum at
See more
See less
How to stop Spring container mid-way in its start programmatically Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to stop Spring container mid-way in its start programmatically

    I may want to programmatically shut down the spring container e.g. mid-way, if a certain condition is raised. I do not want code as System.exit(1) as it will terminate the entire JVM and more than 1 applivation is running in the JVM. My goal is to shut down only one application (among more than one) that is running in the same shared JVM.

    I was thinking that throwing a RuntimeException will stop the Spring based application from starting. But that is not true. The runtime exception was thrown, but that did not stop the application from starting.

    Is there a way to stop the application from starting, if a certain condition is raised?

    Again, not coding as System.exit(1) that would trigger shutdownhook.

    Would like to find a solution for both stand-alone and web-based application.

    I am using WebSphere 6.1 as application server.
    Last edited by sunfun; Dec 4th, 2009, 05:51 PM. Reason: more info