title: Spring framework bean error
body: <p>I am trying to learn Spring in java. I am stuck at the beginning when i run the fist program.
  <strong>i am trying to call the <code>draw</code> method of the Triangle class</strong> . 
  But i am seeing many errors. </p>
  
  <p>In the <code>DrawingApp.java</code> class eclipse is showing some warning - ( <code>The type XmlBeanFactory is deprecated</code> ). </p>
  
  <p>I am providing my implementation along with errors below.</p>
  
  <p><strong>Triangle.java</strong></p>
  
  <pre><code>package org.hemant.spring;
  
  public class Triangle {
  
  public void draw(){
      System.out.println("Triangle drawn");   
   }
  }
  </code></pre>
  
  <p><strong>DrawingApp.java</strong></p>
  
  <pre><code>package org.hemant.spring;
  
  import org.springframework.beans.factory.BeanFactory;
  import org.springframework.beans.factory.xml.XmlBeanFactory;
  import org.springframework.core.io.FileSystemResource;
  
  public class DrawingApp {
  
   /**
   * @param args
   */
   public static void main(String[] args) {
  
      BeanFactory factory = new XmlBeanFactory(new   FileSystemResource("spring.xml"));
  
      Triangle triangle = (Triangle)factory.getBean("Triangle.class");
      triangle.draw();
      }
  
  }
  </code></pre>
  
  <p><strong>spring.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;!DOCTYPE bean PUBLIC "-//SPRING//DTD BEAN 2.0//EN"     "http://www.springframework.org/dtd/spring-bean-2.0.dtd"&gt;
  
  &lt;bean&gt;
    &lt;bean id="triangle" class="org.hemant.spring.Triangle"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p><strong>Errors</strong></p>
  
  <pre><code>     Apr 16, 2016 12:33:45 PM     org.springframework.beans.factory.xml.XmlBeanDefinitionReader    loadBeanDefinitions
      INFO: Loading XML bean definitions from file  [C:\Users\hemant001\workspace_mars_eclipse\spring tutorial\spring.xml]
  Exception in thread "main"   org.springframework.beans.factory.BeanDefinitionStoreException: IOException  parsing XML document from file [C:\Users\hemant001\workspace_mars_eclipse\spring  tutorial\spring.xml]; nested exception is java.io.FileNotFoundException:  http://www.springframework.org/dtd/spring-bean-2.0.dtd
  at  org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefiniti ons(XmlBeanDefinitionReader.java:408)
  at  org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
  at org.springframework.beans.factory.xml.XmlBeanFactory.&lt;init&gt; (XmlBeanFactory.java:78)
  at org.springframework.beans.factory.xml.XmlBeanFactory.&lt;init&gt; (XmlBeanFactory.java:66)
  at org.hemant.spring.DrawingApp.main(DrawingApp.java:17)
      Caused by: java.io.FileNotFoundException: http://www.springframework.org/dtd/spring-bean-2.0.dtd
  at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
  at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
  at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
  at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(Unknown Source)
  at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(Unknown Source)
  at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(Unknown Source)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(Unknown Source)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
  at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
  at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
  at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
  at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
  ... 5 more
  </code></pre>