title: How to prevent a Java EE app from starting when Spring DI fails
body: <p>(I'm not sure if this question applies to Java EE apps in general or is Websphere-specific.)</p>
  
  <p>When we get a Spring DI failure on apps we've deployed to WebSphere (a JNDI lookup failure, for example) the application still appears to have started successfully.</p>
  
  <pre><code>[15/02/11 17:21:22:495 GMT] 00000037 ContextLoader E org.springframework.web.context.ContextLoader initWebApplicationContext Context initialization failed
                                   org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mybean' defined in
     ...big stack trace...
  [15/02/11 17:21:22:526 GMT] 00000037 ApplicationMg A   WSVR0221I: Application started: myapp
  </code></pre>
  
  <p>How can I make the application fail to start if exceptions are thrown during the spring initialisation?</p>