title: Spring Application Context configuration: class not found exception
body: <p>When I start my web application, I get from init():</p>
  
  <pre><code>    java.lang.ClassNotFoundException:org.springframework.context.ApplicationContext
  </code></pre>
  
  <p>maybe I miss something I my configuration files.</p>
  
  <p>In pom.xml I have this 2 spring dependencies:</p>
  
  <pre><code>[...]
      &lt;dependency&gt;
    &lt;groupId&gt;org.springframework&lt;/groupId&gt;
    &lt;artifactId&gt;spring&lt;/artifactId&gt;
    &lt;version&gt;2.5.6.SEC03&lt;/version&gt;
  &lt;/dependency&gt;
      &lt;dependency&gt;
    &lt;groupId&gt;org.springframework&lt;/groupId&gt;
    &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
    &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
  [...]
  </code></pre>
  
  <p>and in Datasource.xml I have beans and listener declared:</p>
  
  <pre><code>&lt;bean id="dataSource" destroy-method="close"
      class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
  &lt;property name="driverClassName" value="com.mysql.jdbc.Driver" /&gt;
  &lt;property name="url" value="jdbc:mysql://localhost/Rubrica" /&gt;
  &lt;property name="username" value="user" /&gt;
  &lt;property name="password" value="pass" /&gt;
    &lt;/bean&gt;
  
    &lt;bean id="JDBC_Spring_EntryDAO" class="net.tirasa.jdbc_spring_addressbook.JDBC_Spring_EntryDAO"&gt;  
  &lt;property name="JDBC_Spring_EntryDAO" ref="JDBC_Spring_EntryDAO" /&gt;
  &lt;property name="dataSource" ref="dataSource" /&gt;
    &lt;/bean&gt;
  
  &lt;/beans&gt;
  
  &lt;listener&gt;
    &lt;listenerclass&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  </code></pre>
  
  <p>The log message switched misteriously to </p>
  
  <pre><code>class path resource [Spring-Datasource.xml] cannot be opened because it does not exist
  </code></pre>
  
  <p>That is good to me, since it looks like I have to put the Spring-Datasource.xml file into the right path, or I have to specify the right path in the command line </p>
  
  <pre><code>    ApplicationContext context = new ClassPathXmlApplicationContext("Spring-Datasource.xml");
      dataSource = (DataSource) context.getBean("JDBC_Spring_EntryDAO");
  </code></pre>