title: Bean definition is abstract Error on a Standalone Java application
body: <p>Im trying to create a ParentDao that will handle all the connection details for my Standalone Java application.<br>
  When I run my program I get the Error below</p>
  
  <blockquote>
    <p>Exception in thread "main"
    org.springframework.beans.factory.BeanIsAbstractException: Error
    creating bean with name 'parentDao': Bean definition is abstract</p>
  </blockquote>
  
  <p>What am I doing wrong?
  I know its an abstract class I was just following this examples which also used abstract classes. <a href="http://nikojava.wordpress.com/2009/08/29/easy-jdbc-using-spring/#spring-jdbc-design-en" rel="nofollow">abstract ParentDao Class</a> and this one <a href="http://java.dzone.com/articles/dry-your-spring-beans" rel="nofollow">DRY your Spring Bean</a> Im totally lost specially on how to do it on a Standalone application.  And where do I initialize the ApplicationContext and how.  </p>
  
  <p>Below is my Connection Properties (bean.xml)</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="dataSource" destroy-method="close"
          class="org.apache.commons.dbcp.BasicDataSource"&gt;
          &lt;property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" /&gt;
          &lt;property name="url" value="jdbc:oracle:thin:@ipaddress:1521:habagat" /&gt;
          &lt;property name="username" value="username" /&gt;
          &lt;property name="password" value="password" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="parentDao" class="com.mercury.dao.ParentDAO" abstract="true"&gt;
          &lt;property name="dataSource" ref="dataSource" /&gt;
      &lt;/bean&gt;
      &lt;bean id="childDao" class="com.mercury.dao.ChildDAOImpl" parent="parentDao"/&gt;        
  &lt;/beans&gt;
  </code></pre>
  
  <p>BELOW IS MY MAIN METHOD</p>
  
  <pre><code>public static void main(String[] args) {
      ApplicationContext context = new ClassPathXmlApplicationContext(
          "beans.xml");
  ParentDAO parentDao = (ParentDAO) context.getBean("parentDao");
  }
  </code></pre>
  
  <p>AND MY PARENT DAO CLASS</p>
  
  <pre><code>   public abstract class ParentDAO&lt;T&gt; extends JdbcDaoSupport {
  
          public abstract void insert(T object) throws Exception;
  
          public abstract void delete(int id) throws Exception;
  
          public abstract void update(T object) throws Exception;
  
          public abstract T select(int id) throws Exception;
  }
  </code></pre>
  
  <p>MY SERVICE</p>
  
  <pre><code>public class myService {
  
      ChildDAO childDao;
  
      public String getChildrenCount() {
  
  
          return int totalCount = childDao.getRecordCount();
      }
  }
  </code></pre>