title: No qualifying bean of type [javax.sql.DataSource] found
body: <p>I am struggling in understanding why this error is happening.  I am porting a tutorial over to the latest version of Spring, Hibernate, and WildFly.  I am running from the commandline building and testing the application using Maven.  I am getting the below error:</p>
  
  <blockquote>
    <p>Jul 10, 2015 2:18:03 PM org.springframework.test.context.TestContextManager prepareTestInstance
    SEVERE: Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@523884b2] to prepare test instance [com.russ.home.test.dao.CompanyDaoTest@131774fe]
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.russ.home.test.dao.CompanyDaoTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests.setDataSource(javax.sql.DataSource); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}</p>
  </blockquote>
  
  <p>This is my <strong>testing application context</strong> file:</p>
  
  <pre><code>&lt;bean id="propertyConfigurer"
               class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
               p:location="classpath:jdbc.properties" /&gt;
  
         &lt;bean id="tttDataSource"
               class="org.springframework.jdbc.datasource.DriverManagerDataSource"
               p:driverClassName="${jdbc.driverClassName}"
               p:url="${jdbc.url}"
               p:username="${jdbc.username}"
               p:password="${jdbc.password}"
                 /&gt;
  
  
         &lt;bean id="jpaVendorAdapter"
               class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
               p:showSql="true"
               p:databasePlatform="org.hibernate.dialect.MySQLDialect" /&gt;
  
         &lt;bean id="entityManagerFactory"
               class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
               p:persistenceUnitName="ttt-jpa"
               p:dataSource-ref="tttDataSource"
               p:jpaVendorAdapter-ref="jpaVendorAdapter"
               p:persistenceXmlLocation="classpath*:META-INF/test-persistence.xml"
                 /&gt;
  
         &lt;!-- Transaction manager for a single JPA EntityManagerFactory (alternative to JTA) --&gt;
         &lt;bean id="transactionManager"
               class="org.springframework.orm.jpa.JpaTransactionManager"
               p:dataSource-ref="tttDataSource"
               p:entityManagerFactory-ref="entityManagerFactory"/&gt;
  
         &lt;!-- checks for annotated configured beans --&gt;
         &lt;context:annotation-config/&gt;
  </code></pre>
  
  <p>This is the <strong>Abstract Test Class</strong></p>
  
  <pre><code>@WebAppConfiguration
  @ContextConfiguration
          ({
                  "classpath*: /testingContext.xml",
  
  
          })
  public abstract class AbstractDaoForTesting extends AbstractTransactionalJUnit4SpringContextTests {
  
      protected final Logger logger = LoggerFactory.getLogger(this.getClass());
  
  
      @Autowired(required = true)
      protected CompanyDao companyDao;
      @Autowired(required = true)
      protected ProjectDao projectDao;
      @Autowired(required = true)
      protected TaskDao taskDao;
      @Autowired(required = true)
      protected UserDao userDao;
      @Autowired(required = true)
      protected TaskLogDao taskLogDao;
  
  
  }
  </code></pre>
  
  <p>This is the <strong>CompanyDAOTest</strong> Class.</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  public class CompanyDaoTest extends AbstractDaoForTesting {
  
      public CompanyDaoTest(){}
  
      /**
       * Test case for the find(id) method of the CompanyDao implementation
       * @throws Exception
       */
      @Test
      public void testFind() throws Exception {
  
          logger.debug("\nSTARTED testFind()\n");
          List&lt;Company&gt; allItems = companyDao.findAll();
  
          assertTrue(allItems.size() &gt; 0);
  
          // get the first item in the list
          Company c1 = allItems.get(0);
  
          int id = c1.getId();
  
          Company c2 = companyDao.find(id);
  
          assertTrue(c1.equals(c2));
          logger.debug("\nFINISHED testFind()\n");
      }
  </code></pre>
  
  <p>Any suggestions would be greatly appreciated.</p>
  
  <p>Russ</p>