title: Spring autowiring gives null bean for Abstract class
body: <p>I'm trying to Inject(Autowire) JDBCTemplate into my Dao Class which is an "Abstract class", This is not working and as spring is giving null bean for JDBCTemplate.</p>
  
  <pre><code>public abstract class SSODaoImpl extends NamedParameterJdbcDaoSupport implements  SSODao{
  
      public SSODaoImpl(){
  
      }
      @Autowired //giving null jdbcTemplate
      public SSODaoImpl(JdbcTemplate jdbcTemplate){
      super.setJdbcTemplate(jdbcTemplate);
      }
  }
  </code></pre>
  
  <p>SSODaoImpl is extended my many other DAOs' like the one below</p>
  
  <pre><code>@Repository("askBenefitsDAO")
  public class AskBenefitsSSODaoImpl extends SSODaoImpl{
  }
  </code></pre>
  
  <p>I have created the bean in a file JDBCContext.xml and referenced it in web.xml</p>
  
  <pre><code>&lt;bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
       &lt;property name="jndiName" value="java:comp/env/jndi/hpdb_hrdb"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"&gt;
  &lt;constructor-arg ref="dataSource"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Web.xml</p>
  
  <pre><code>&lt;context-param&gt;
      &lt;param-name&gt; /WEB-INF/spring/JDBCTemplate/JDBCContext.xml&lt;/param-value&gt;       
  &lt;/context-param&gt; 
  </code></pre>
  
  <hr>
  
  <p>Error message from spring while starting the application</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'askBenefitsDAO' defined in file [AskBenefitsSSODaoImpl.class]: 
  Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: 'dataSource' or 'jdbcTemplate' is required
  </code></pre>
  
  <p>The above setup is working for an "Non Abstract class" set up. Please help me with this and let me know what I'm doing wrong</p>