title: No qualifying bean of type org.springframework.jdbc.core.JdbcTemplate
body: <p>I know this such Exception is not strange while doing J2EE, but I cant figure out how my app going wrong at this step. My Code is quite long, so I will post only what I think is relevant. For the full source code, please go to: <a href="http://code.google.com/p/eagleit/" rel="nofollow">http://code.google.com/p/eagleit/</a></p>
  
  <p>Please note there are some redundant files in Google codes, so stick with this hierachy only: <a href="https://onedrive.live.com/?cid=1c1da117b58476bc&amp;id=1C1DA117B58476BC!36077&amp;v=3&amp;ithint=photo,PNG&amp;authkey=!AKiwJkrdzzw4tKs" rel="nofollow">https://onedrive.live.com/?cid=1c1da117b58476bc&amp;id=1C1DA117B58476BC!36077&amp;v=3&amp;ithint=photo,PNG&amp;authkey=!AKiwJkrdzzw4tKs</a></p>
  
  <p>So my problem is: I set <code>@Autowired</code> for a <code>JdbcTemplate</code> Object in <code>IssueDAOImpl.java</code>, but Tomcat throws the Exception:</p>
  
  <pre><code>org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.jdbc.core.JdbcTemplate] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=IssueJDBCTemplate)}
  </code></pre>
  
  <p>This is strange as I defined a <code>JdbcTemplate</code> bean in <code>applicationContext.xml</code> already, I believe this is Spring-compliant.</p>
  
  <p>Below are the 2 files I mentioned:</p>
  
  <p><strong>IssueDAOImpl.java</strong></p>
  
  <pre><code>package eit.service;
  
  import eit.model.Issue;
  import eit.service.dao.IssueDAO;
  import java.util.ArrayList;
  import javax.sql.DataSource;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.beans.factory.annotation.Qualifier;
  import org.springframework.context.ApplicationContext;
  import org.springframework.context.annotation.ImportResource;
  import org.springframework.context.support.ClassPathXmlApplicationContext;
  import org.springframework.jdbc.core.JdbcTemplate;
  import org.springframework.stereotype.Component;
  
  /**
   *
   * @author acoustic
   */
  
  @Component
  @ImportResource("classpath:/WEB-INF/applicationContext.xml")
  public class IssueDAOImpl implements IssueDAO
  {
          private DataSource AppDataSource ;
  
          @Autowired
          @Qualifier("IssueJDBCTemplate")
          private JdbcTemplate IssueJDBCTemplate ;
  
          public IssueDAOImpl()
          {
                  //.setJdbcTemplate(IssueJDBCTemplate);
          }
  
  
          public void setDataSource(DataSource _DataSource) 
          {
                  //this.AppDataSource = _DataSource ;
                  this.IssueJDBCTemplate.setDataSource(_DataSource);
          }
  
  
          public void setJdbcTemplate(JdbcTemplate _JdbcTemplate)
          {
                  this.IssueJDBCTemplate = _JdbcTemplate ;
          }
  
          @Override
          public void insert(Issue _Item)
          {
                  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
          }
  
          @Override
          public void update(Issue _Item)
          {
                  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
          }
  
          @Override
          public void delete(Issue _Item)
          {
                  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
          }
  
          @Override
          public Issue get(int _ID)
          {
                  String SQLQuery = 
                                  "SELECT I.ID, I.Title, I.Description, I.CategoryID, I.Type, C.ProjectID "
                                  + "FROM issue I "
                                  + "INNER JOIN category C ON I.CategoryID = C.ID "
                                  + "WHERE I.ID = ?" ;
  
                  Issue ReturnIssue = 
                                  (Issue) this.IssueJDBCTemplate.queryForObject(SQLQuery, new Object[]{_ID}, new IssueRowMapper()) ;
  
                  //ReturnIssue.setProjectID(this.getProjectIDByCategory(ReturnIssue.getCategoryID()));
  
                  //ReturnIssue.setTagIDs(this.GetTagListByIssue(ReturnIssue.getID()));
  
                  return ReturnIssue;
          }
  
          @Override
          public ArrayList&lt;Issue&gt; getList()
          {
                  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
          }
  
  
  }
  </code></pre>
  
  <p><strong>applicationContext.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!-- was: &lt;?xml version="1.0" encoding="UTF-8"?&gt; --&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:p="http://www.springframework.org/schema/p"
         xmlns:aop="http://www.springframework.org/schema/aop"
         xmlns:tx="http://www.springframework.org/schema/tx"
             xmlns:context="http://www.springframework.org/schema/context"
         xsi:schemaLocation="
                  http://www.springframework.org/schema/beans 
                  http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
                  http://www.springframework.org/schema/aop
                  http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
                  http://www.springframework.org/schema/tx
                  http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
                  http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
  
          &lt;bean id="dataSource" 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/eagleit"/&gt;
                  &lt;property name="username" value="root"/&gt;
                  &lt;property name="password" value=""/&gt;
          &lt;/bean&gt;
  
          &lt;!--bean id="AppJDBCTemplate" class="EIT.EITDAO.AppJDBCTemplate"&gt;
                  &lt;property name="dataSource"  ref="dataSource" /&gt;
          &lt;/bean--&gt;
  
          &lt;bean id="IssueJDBCTemplate" class="org.springframework.jdbc.core.JdbcTemplate"&gt;
                  &lt;property name="dataSource"  ref="dataSource" /&gt;
          &lt;/bean&gt;
  
  
  
  
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>A part of Stack Trace (bottom part):</strong></p>
  
  <pre><code>root cause
  org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.jdbc.core.JdbcTemplate] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=IssueJDBCTemplate)}
      org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1100)
      org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:960)
      org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:855)
      org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:480)
      org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
      org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
      org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
      org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
      org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
      org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
      org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1014)
      org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:957)
      org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:855)
      org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:480)
      org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
      org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
      org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
      org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
      org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
      org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
      org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1014)
      org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:957)
      org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:855)
      org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:480)
      org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
      org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
      org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
      org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
      org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
      org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
      org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700)
      org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
      org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
      org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658)
      org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:624)
      org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:672)
      org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:543)
      org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484)
      org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
      javax.servlet.GenericServlet.init(GenericServlet.java:158)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
      org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652)
      org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
      java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      java.lang.Thread.run(Thread.java:744)
  note The full stack trace of the root cause is available in the Apache Tomcat/8.0.3 logs.
  Apache Tomcat/8.0.3
  </code></pre>