title: My simple "Hello World" program is not running into Spring
body: <p>I'm trying to run my simple program, i added <code>spring framework jar files</code> and <code>common-logging jar files</code> too into my reference library.</p>
  
  <p>Here is my first program says <strong><em>HelloWorld.java</em></strong>:</p>
  
  <pre><code>package com.rajendra.lesson01;
  
  public class HelloWorld {
  
      private String message;
  
      public void setMessage(String message){
          this.message=message;
      }
  
      public void getMessage(){
          System.out.println("Messge: "+message);
      }
  }
  </code></pre>
  
  <p>Here is my another program says <strong><em>MainProgram.java</em></strong>:</p>
  
  <pre><code>package com.rajendra.lesson01;
  
  import org.springframework.context.ApplicationContext;
  import org.springframework.context.support.ClassPathXmlApplicationContext;
  
  public class MainProgram {
      public static void main(String[] args){
  
          ApplicationContext ac=new ClassPathXmlApplicationContext("bean.xml");
          HelloWorld hw=(HelloWorld) ac.getBean("helloWorld");
  
          hw.getMessage();
      }
  }
  </code></pre>
  
  <p>and here is my last one <strong><em>bean.xml</em></strong>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"&gt;
  
  &lt;bean id="helloWorld" class="com.rajendra.lesson01.HelloWorld"&gt;
      &lt;property name="message" value="My name is foo.." /&gt;
  &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>Everything goes fine according to tutorial but my <strong>Output</strong> says:</p>
  
  <pre><code>Oct 20, 2014 9:12:19 AM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
  INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1c12fb0: startup date [Mon Oct 20 09:12:19 IST 2014]; root of context hierarchy
  Oct 20, 2014 9:12:19 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
  INFO: Loading XML bean definitions from class path resource [bean.xml]
  Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [bean.xml]; nested exception is java.io.FileNotFoundException: class path resource [bean.xml] cannot be opened because it does not exist
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:343)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:251)
      at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
      at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
      at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
      at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:540)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:139)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:83)
      at com.rajendra.lesson01.MainProgram.main(MainProgram.java:9)
  Caused by: java.io.FileNotFoundException: class path resource [bean.xml] cannot be opened because it does not exist
      at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:329)
      ... 13 more
  </code></pre>
  
  <p><strong>What's happening here please help? and also tell me how do you guys find the errors?</strong></p>
  
  <p>Help Would be appreciated!</p>