title: AnnotationConfigApplicationContext has not been refreshed yet
body: <p>I am developing a spring MVC application. When I try to use AnnotationConfigApplicationContext in my controller class I am getting the following error. I have no idea what this statement exactly means. </p>
  
  <pre><code>@RequestMapping(value = "/generate", method = RequestMethod.POST)
  public ModelAndView generateMappingFile(@ModelAttribute Mapping mapping) 
  {
      AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
      MappingFileGenerator mfg = ctx.getBean(MappingFileGenerator.class);
  }
  </code></pre>
  
  <p>Error Message  --> </p>
  
  <pre><code>java.lang.IllegalStateException:org.springframework.context.annotation.AnnotationConfigApplicationContext@116b3c0 has not been refreshed yet
  </code></pre>
  
  <p>Can someone explain me what went wrong here ? I am using Spring 4.0.1.. I am new to spring mvc. </p>