title: Spring bean constructor-arg rejects the object i want to pass in (implements myInterface), constructor param is of type myInterface
body: <p>I'm attempting to generate a bean of type AuthenticationController.  The constructor for Authentication controller has one parameter of type DataSource, called securityDataSource.  In my security context xml I declare the bean using the following code.</p>
  
  <p>Excerpt from webSecurityConfig.xml:</p>
  
  <pre><code>&lt;bean id="authoritiesConroller" 
         class="honors.uh.edu.security.AuthoritiesController"&gt;
          &lt;constructor-arg ref="securityDataSource"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Here is the definition of the bean securityDataSource:</p>
  
  <pre><code>&lt;bean name="securityDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
          &lt;property name="driverClassName" value="com.mysql.jdbc.Driver" /&gt;
          &lt;property name="url" value="jdbc:mysql://localhost:3306/test" /&gt;
          &lt;property name="username" value="root" /&gt;
          &lt;property name="password" value="" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>AuthoritiesController.java</p>
  
  <pre><code>package honors.uh.edu.security;
  
  import honors.uh.edu.pojo.User;
  
  import java.sql.Types;
  
  import javax.sql.DataSource;
  
  import org.springframework.jdbc.core.SqlParameter;
  import org.springframework.jdbc.core.support.JdbcDaoSupport;
  import org.springframework.jdbc.object.SqlUpdate;
  public class AuthoritiesController  extends JdbcDaoSupport {
  
  
      private InsertAuthority insertAuthority;
  
      public AuthoritiesController(DataSource securityDataSource) {
          super();
          insertAuthority = new InsertAuthority(securityDataSource);
  
  
      }
  
      public void create(User user, String authority) {
          insertAuthority.insert(user, authority);
      }
  
      /********* Inner Classes  ************/
      protected class InsertAuthority extends SqlUpdate {
          protected InsertAuthority(DataSource ds) {
              super(ds, "INSERT INTO authorities VALUES (?, ?)");
              declareParameter(new SqlParameter(Types.VARCHAR));
              declareParameter(new SqlParameter(Types.VARCHAR));
              compile();
          }
  
          protected void insert(User user, String authority) {
              Object[] objs = new Object[] { user.getUsername(), authority };
              super.update(objs);
          }
  
      }
  }
  </code></pre>
  
  <p>The error I get in return is <code>Caused by: java.lang.IllegalArgumentException: 'dataSource' or 'jdbcTemplate' is required</code>.  Why would it now allow this? DriverManagerDataSource is an implementation of DataSource so shouldn't I be allowed to pass it as a parameter?</p>
  
  <p>EDIT: Here is the full error-</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authoritiesConroller' defined in class path resource [spring/webSecurityConfig.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: 'dataSource' or 'jdbcTemplate' is required
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553) ~[spring-beans-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) ~[spring-beans-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) ~[spring-beans-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) ~[spring-beans-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) ~[spring-beans-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703) ~[spring-beans-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) ~[spring-context-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) ~[spring-context-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) ~[spring-web-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) ~[spring-web-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [spring-web-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939) [catalina.jar:7.0.42]
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) [catalina.jar:7.0.42]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.42]
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) [catalina.jar:7.0.42]
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) [catalina.jar:7.0.42]
      at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_05]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_05]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_05]
      at java.lang.Thread.run(Thread.java:745) [na:1.8.0_05]
  Caused by: java.lang.IllegalArgumentException: 'dataSource' or 'jdbcTemplate' is required
      at org.springframework.jdbc.core.support.JdbcDaoSupport.checkDaoConfig(JdbcDaoSupport.java:112) ~[spring-jdbc-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44) ~[spring-tx-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612) ~[spring-beans-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549) ~[spring-beans-4.0.3.RELEASE.jar:4.0.3.RELEASE]
      ... 21 common frames omitted
  </code></pre>