title: Loading application-context.xml
body: <pre><code>XmlBeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource(
                  "application-context.xml"));
  </code></pre>
  
  <p>My application-context.xml resides inside <code>com.myname.mysubpackage.spring.application-context.xml</code></p>
  
  <p>How to get it loading... </p>
  
  <pre><code>INFO  - XmlBeanDefinitionReader    - Loading XML bean definitions from class path resource [application-context.xml]
  Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [application-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [application-context.xml] cannot be opened because it does not exist
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
      at org.springframework.beans.factory.xml.XmlBeanFactory.&lt;init&gt;(XmlBeanFactory.java:73)
      at org.springframework.beans.factory.xml.XmlBeanFactory.&lt;init&gt;(XmlBeanFactory.java:61)
      at com.mysticcoders.mysticpaste.services.CrudService.main(CrudService.java:9)
  Caused by: java.io.FileNotFoundException: class path resource [application-context.xml] cannot be opened because it does not exist
      at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:141)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
      ... 4 more
  </code></pre>
  
  <p>I get this error.</p>