title: Eclipse RCP cannot find applicationContext.xml
body: <p>I am facing some issues integrating Eclipse RCP and Spring IOC.</p>
  
  <p>Below is my approach to the process.</p>
  
  <p>Steps I've done </p>
  
  <ol>
  <li>Created a Bundle (Using plug-in from exisitng archives project type) which has all Spring jars.</li>
  <li>Created a Simple Hello RCP application with a view.</li>
  <li>Added the Bundle as a dependency to the RCP project(step2) </li>
  </ol>
  
  <p>Created a simple class in my RCP project whose object has to instantiated through applicationContext.xml.</p>
  
  <pre><code>public class Triangle {
              public void draw(){
                  System.out.println("Traingle drawn");
              }
         }
  </code></pre>
  
  <p>My applicationContext.xml code</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd"&gt;
  &lt;beans&gt;
     &lt;bean id="JGID" class="st.Triangle"/&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>A code snippet part of My view where I'm fetching applicationContext.xml is as below</p>
  
  <pre><code>ApplicationContext applicationContext = new FileSystemXmlApplicationContext("D:/applicationContext.xml");
  Triangle triangle = (Triangle) applicationContext.getBean("JGID");
  triangle.draw();
  </code></pre>
  
  <p>this throws error</p>
  
  <blockquote>
    <p>Cannot find class [st.Triangle] for bean with name 'JGID' defined in
    file [D:\applicationContext.xml]; nested exception is
    java.lang.ClassNotFoundException: st.Triangle</p>
  </blockquote>
  
  <p>How do I resolve this error ?    </p>
  
  <p>As a workaround I tried the other way, also I failed as in below i.e.., using ClassPathXmlApplicationContext</p>
  
  <pre><code>ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
  </code></pre>
  
  <p>Below is the error</p>
  
  <blockquote>
    <p>!MESSAGE Unable to create view ID st.view: IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource
    [applicationContext.xml] cannot be opened because it does not exist
         !STACK 0 java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened</p>
  </blockquote>
  
  <p>The above code line in my Eclipse RCP applcication, where does it check or look for the xml file. </p>
  
  <p>I tried the following ways.</p>
  
  <ul>
  <li>Placed applicationContext.xml in src folder.</li>
  <li>At the project folder. </li>
  <li>Inisde the package.</li>
  </ul>
  
  <p>In all the 3 cases, it says <code>FileNotFoundException</code>. Where should I place the <code>applicationContext.xml</code> file to make the <code>applicationContext</code> reference to find it?</p>