title: How to Debug Spring NoSuchBeanDefinitionException
body: <p>We have a (non-web app) Spring application that throws a NoSuchBeanDefinitionException when running tests on our CruiseControl continuous integration linux box. The test runs fine on Windows in Eclipse.</p>
  
  <p>The exception is thrown on the getBean() method:</p>
  
  <pre><code>ApplicationContext context = new ClassPathXmlApplicationContext(CONTEXT_FILE);
  
  MyBean bean = (MyBean)context.getBean("myBean");
  </code></pre>
  
  <p>The context file is rather large and complicated. The context file is in the classpath and Spring is finding it. I'd prefer it if Spring would throw an exception when trying to load the context file and build the dependencies so that we could have an idea as to where to start. Is there a way to force Spring to throw an exception at the time of creating the context?</p>