title: org.springframework.beans.factory.parsing.BeanDefinitionParsingException, Unexpected failure during bean definition parsing exception
body: <p>Trying to run  Simple Spring Application and getting exception.</p>
  
  <p>Car.java</p>
  
  <pre><code>public class Car {
  
      private String carname;
      private Engine engine;
      public Car() {
          System.out.println("Car Class..");
      }
  
      public void setCarname(String carname) {
          this.carname = carname;
      }
      public void setEngine(Engine engine) {
          this.engine = engine;
      }
  
      public void printCarData(){
          System.out.println("Car Name : "+carname);
          System.out.println("Model Year : "+engine.getModelyear());
      }
  }
  </code></pre>
  
  <p>Engine .java</p>
  
  <pre><code>public class Engine {
  
      private String modelyear;
      public Engine() {
          System.out.println("Engine Class..");
      }
  
      public String getModelyear() {
          return modelyear;
      }
  
      public void setModelyear(String modelyear) {
          this.modelyear = modelyear;
      }
  
  }
  </code></pre>
  
  <p>employee.xml    </p>
  
  <pre><code>&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="e"  name="beans.Engine" class="beans.Engine"&gt;
          &lt;property name="modelyear" value="2015"  /&gt;
  
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>car.xml</p>
  
  <pre><code>&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="c" name="beans.Car" class="beans.Car"&gt;
  
          &lt;property name="carname" value="Acura"&gt;&lt;/property&gt;
          &lt;property name="engine" value="e"&gt;&lt;/property&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>Client.java</p>
  
  <pre><code>public class client {
  
      public static void main(String[] args) {
  
          String files[] = new String[]{"resources/car.xml","resources/engine.xml"};
          //Resource resource = new ClassPathResource(files);
          ApplicationContext app = new ClassPathXmlApplicationContext(files);//eager container
  
      }
  
  }
  </code></pre>
  
  <hr>
  
  <p>Error......</p>
  
  <pre><code>Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unexpected failure during bean definition parsing
  Offending resource: class path resource [resources/car.xml]
  Bean 'c'; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: &lt;constructor-arg&gt; element must specify a ref or value
  Offending resource: class path resource [resources/car.xml]
  Bean 'c'
      -&gt; Constructor-arg
      at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
      at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:291)
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:497)
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:396)
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:365)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.processBeanDefinition(DefaultBeanDefinitionDocumentReader.java:259)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:154)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
      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.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
      at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:126)
      at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92)
      at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
      at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:139)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:93)
      at test.client.main(client.java:14)
  Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: &lt;constructor-arg&gt; element must specify a ref or value
  Offending resource: class path resource [resources/car.xml]
  Bean 'c'
      -&gt; Constructor-arg
      at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
      at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
      at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:284)
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parsePropertyValue(BeanDefinitionParserDelegate.java:938)
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseConstructorArgElement(BeanDefinitionParserDelegate.java:800)
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseConstructorArgElements(BeanDefinitionParserDelegate.java:684)
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:481)
      ... 22 more
  </code></pre>