title: Error creating bean with name 'clientsDaoImpl': Injection of autowired dependencies failed;
body: <p>This error is killing me, i searched a lot of similar topics here, but none of them helped me!
  So, i'm using spring MVC+hibernate. Please, just take a look, maybe you will find mistake which i missed!
  Here is my files:
  <strong>Clients</strong></p>
  
  <pre><code>package app.model;
  
  import javax.persistence.*;
  
  @Entity
  @Table(name = "clients")
  public class Clients {
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private int client_id;
      private String gender;
      private String first_name;
      private String last_name;
      private String country;
      private String city;
      private String birthdate;
      private String phone;
      private String email;
      private int orders;
      private double total_income;
  
      public Clients() {
      }
  
      public Clients(int client_id, String gender, String first_name,
              String last_name, String country, String city, String birthdate,
              String phone, String email, int orders, double total_income) {
          super();
          this.client_id = client_id;
          this.gender = gender;
          this.first_name = first_name;
          this.last_name = last_name;
          this.country = country;
          this.city = city;
          this.birthdate = birthdate;
          this.phone = phone;
          this.email = email;
          this.orders = orders;
          this.total_income = total_income;
      }
  
      public String getBirthdate() {
          return birthdate;
      }
  
      public void setBirthdate(String birthdate) {
          this.birthdate = birthdate;
      }
  
      public int getClient_id() {
          return client_id;
      }
  
      public void setClient_id(int client_id) {
          this.client_id = client_id;
      }
  
      public String getGender() {
          return gender;
      }
  
      public void setGender(String gender) {
          this.gender = gender;
      }
  
      public String getFirst_name() {
          return first_name;
      }
  
      public void setFirst_name(String first_name) {
          this.first_name = first_name;
      }
  
      public String getLast_name() {
          return last_name;
      }
  
      public void setLast_name(String last_name) {
          this.last_name = last_name;
      }
  
      public String getCountry() {
          return country;
      }
  
      public void setCountry(String country) {
          this.country = country;
      }
  
      public String getCity() {
          return city;
      }
  
      public void setCity(String city) {
          this.city = city;
      }
  
      public String getPhone() {
          return phone;
      }
  
      public void setPhone(String phone) {
          this.phone = phone;
      }
  
      public String getEmail() {
          return email;
      }
  
      public void setEmail(String email) {
          this.email = email;
      }
  
      public int getOrders() {
          return orders;
      }
  
      public void setOrders(int orders) {
          this.orders = orders;
      }
  
      public double getTotal_income() {
          return total_income;
      }
  
      public void setTotal_income(double total_income) {
          this.total_income = total_income;
      }
  
  }
  </code></pre>
  
  <p><strong>ClientsService</strong></p>
  
  <pre><code>package app.service;
  
  import java.text.ParseException;
  import java.util.List;
  
  import app.model.Clients;
  
  public interface ClientsService {
      public void addClient(Clients client);
      public void updateClient(Clients client) throws ParseException;
      public void deleteClient(Clients client) throws ParseException;
      public Clients getClient(int client_id);
      public List&lt;Clients&gt; getAllClients();
  }
  </code></pre>
  
  <p><strong>ClientsServiceImpl</strong></p>
  
  <pre><code>package app.service.impl;
  
  import java.text.ParseException;
  import java.util.List;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Service;
  import org.springframework.transaction.annotation.Transactional;
  
  import app.dao.ClientsDao;
  import app.model.Clients;
  import app.service.ClientsService;
  
  @Service
  public class ClientsServiceImpl implements ClientsService {
  
      @Autowired
      private ClientsDao clientsDao;
  
      public ClientsServiceImpl() {
      }
  
      public List&lt;Clients&gt; getAllClientsList() {
          return clientsDao.getAllClients();
      }
  
      @Transactional
      public void addClient(Clients client) {
          clientsDao.addClient(client);
      }
  
      @Transactional
      public void updateClient(Clients client) throws ParseException{ 
          clientsDao.updateClient(client);
      }
  
      @Transactional
      public void deleteClient(Clients client) throws ParseException{
          clientsDao.deleteClient(client);
      }
  
      @Transactional
      public Clients getClient(int client_id) {
          return clientsDao.getClient(client_id);
      }
  
      @Transactional
      public List&lt;Clients&gt; getAllClients() {
          return clientsDao.getAllClients();
      }
  }
  </code></pre>
  
  <p><strong>ClientsDao</strong></p>
  
  <pre><code>package app.dao;
  
  import java.text.ParseException;
  import java.util.List;
  
  import app.model.Clients;
  
  public interface ClientsDao {
      public void addClient(Clients client);
      public void updateClient(Clients client) throws ParseException;
      public void deleteClient(Clients client) throws ParseException;
      public Clients getClient(int client_id);
      public List&lt;Clients&gt; getAllClients();
  }
  </code></pre>
  
  <p><strong>ClientsDaoImpl</strong></p>
  
  <pre><code>package app.dao.impl;
  
  import java.text.ParseException;
  
  import org.hibernate.SessionFactory;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Repository;
  import org.springframework.transaction.annotation.Transactional;
  
  import app.model.Clients;
  import app.dao.ClientsDao;
  import app.logic.Similar;
  
  @Repository
  public class ClientsDaoImpl implements ClientsDao {
  
      @Autowired
      public SessionFactory session;
  
  
      public ClientsDaoImpl() {
      }
  
  
      @Transactional
      @SuppressWarnings("unchecked")
      public List&lt;Clients&gt; getAllClients() {
          return session.getCurrentSession().createQuery("from Clients").list();
      }
  
      @Transactional
      public void addClient(Clients client) { // add new client
          session.getCurrentSession().save(client);
      }
  
      @Transactional
      public void updateClient(Clients client) throws ParseException { // update client                                               
          session.getCurrentSession().update(client);
      }
  
      @Transactional
      public void deleteClient(Clients client) throws ParseException { // delete client if he\she doesnt have any orders
          session.getCurrentSession().delete(client);
      }
  
      @Transactional
      public Clients getClient(int client_id) {
          return (Clients)session.getCurrentSession().get(Clients.class, client_id);
      }
  
  }
  </code></pre>
  
  <p><strong>ClientsController</strong></p>
  
  <pre><code>package app.controller;
  
  import java.text.ParseException;
  import java.util.Map;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Controller;
  import org.springframework.validation.BindingResult;
  import org.springframework.web.bind.annotation.ModelAttribute;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.RequestParam;
  
  import app.model.Clients;
  import app.service.ClientsService;
  
  
  @Controller
  public class ClientsController {
  
      @Autowired
      public ClientsService clientsService;
  
  
      public ClientsController(){
  
      }
  
      @RequestMapping("/index")
      public String setupForm(Map&lt;String, Object&gt; map) {
          Clients client = new Clients();
          map.put("client", client);
          map.put("clientsList", clientsService.getAllClients());
          return "client";
      }
  
      @RequestMapping(value = "/client.do", method = RequestMethod.POST)
      public String doActions(@ModelAttribute Clients client,
              BindingResult result, @RequestParam String action,
              Map&lt;String, Object&gt; map) throws ParseException {
          Clients clientResult = new Clients();
  
          switch (action.toLowerCase()) {
          case "add":
              clientsService.addClient(client);
              clientResult = client;
              break;
          case "edit":
              clientsService.updateClient(client);
              clientResult = client;
              break;
          case "delete":
              clientsService.deleteClient(client);
              clientResult = new Clients();
              break;
          case "search":
              Clients searchedClient = clientsService.getClient(client.getClient_id());
              clientResult = searchedClient != null ? searchedClient : new Clients();
              break;
          }
          map.put("client", clientResult);
          map.put("clientsList", clientsService.getAllClients());
          return "client";
      }
  
  }
  </code></pre>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://java.sun.com/xml/ns/javaee"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
      id="WebApp_ID" version="3.0"&gt;
      &lt;display-name&gt;ProjectMVC&lt;/display-name&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
          &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
          &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
          &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
          &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
          &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>jdbc.properties</strong></p>
  
  <pre><code>jdbc.driverClassName=com.mysql.jdbc.Driver
  jdbc.dialect=org.hibernate.dialect.MySQLDialect
  jdbc.databaseurl=jdbc:mysql://localhost:3306/projectdb
  jdbc.username=root
  jdbc.password=root
  </code></pre>
  
  <p><strong>spring-servlet.xml</strong></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" xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:jee="http://www.springframework.org/schema/jee" xmlns:lang="http://www.springframework.org/schema/lang"
      xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
      xmlns:util="http://www.springframework.org/schema/util"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
          http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
          http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
          http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
          http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
          http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"&gt;
  
  
  
      &lt;context:annotation-config /&gt;
      &lt;context:component-scan base-package="app.*"&gt;
          &lt;context:exclude-filter type="annotation"
              expression="org.springframework.stereotype.Controller" /&gt;
      &lt;/context:component-scan&gt;
  
      &lt;context:spring-configured /&gt;
  
       &lt;bean
          class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor" /&gt;
  
      &lt;bean id="propertyConfigurer"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
          p:location="/WEB-INF/jdbc.properties" /&gt;
  
      &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
          destroy-method="close" p:driverClassName="${jdbc.driverClassName}"
          p:url="${jdbc.databaseurl}" p:username="${jdbc.username}" p:password="${jdbc.password}" /&gt;
      &lt;bean id="sessionFactory"
          class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="dataSource" /&gt;
          &lt;property name="configLocation"&gt;
              &lt;value&gt;classpath:hibernate.cfg.xml&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="configurationClass"&gt;
              &lt;value&gt;org.hibernate.cfg.AnnotationConfiguration&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="hibernateProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.dialect"&gt;${jdbc.dialect}&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
      &lt;bean id="viewResolver"
          class="org.springframework.web.servlet.view.UrlBasedViewResolver"&gt;
          &lt;property name="viewClass"
              value="org.springframework.web.servlet.view.JstlView" /&gt;
          &lt;property name="prefix" value="/WEB-INF/jsp/" /&gt;
          &lt;property name="suffix" value=".jsp" /&gt;
      &lt;/bean&gt;
      &lt;tx:annotation-driven /&gt;
  
      &lt;aop:config proxy-target-class="true"/&gt;
      &lt;bean id="transactionManager"
          class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
          &lt;property name="sessionFactory" ref="sessionFactory" /&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;Project&lt;/groupId&gt;
      &lt;artifactId&gt;Project&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
  
      &lt;properties&gt;
          &lt;org.springframework.version&gt;3.0.5.RELEASE&lt;/org.springframework.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Hibernate resources --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
              &lt;version&gt;3.6.7.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
              &lt;version&gt;4.3.0.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-commons-annotations&lt;/artifactId&gt;
              &lt;version&gt;3.3.0.ga&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-annotations&lt;/artifactId&gt;
              &lt;version&gt;3.3.1.GA&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;3.3.2.GA&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;taglibs&lt;/groupId&gt;
              &lt;artifactId&gt;standard&lt;/artifactId&gt;
              &lt;version&gt;1.1.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;1.1.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
              &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
              &lt;version&gt;20030825.184428&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-pool&lt;/groupId&gt;
              &lt;artifactId&gt;commons-pool&lt;/artifactId&gt;
              &lt;version&gt;20030825.183949&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- MySQL --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;5.1.6&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Log4j --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.14&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;eclipselink&lt;/artifactId&gt;
              &lt;version&gt;2.5.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;persistence-api&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
  
      &lt;build&gt;
          &lt;testSourceDirectory&gt;src/main/test&lt;/testSourceDirectory&gt;
          &lt;resources&gt;
              &lt;resource&gt;
                  &lt;directory&gt;src/main/resources&lt;/directory&gt;
                  &lt;excludes&gt;
                      &lt;exclude&gt;**/*.java&lt;/exclude&gt;
                  &lt;/excludes&gt;
              &lt;/resource&gt;
              &lt;resource&gt;
                  &lt;directory&gt;src/main/webapp&lt;/directory&gt;
                  &lt;excludes&gt;
                      &lt;exclude&gt;**/*.java&lt;/exclude&gt;
                  &lt;/excludes&gt;
              &lt;/resource&gt;
          &lt;/resources&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.7&lt;/source&gt;
                      &lt;target&gt;1.7&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>upd: <strong>forgot hibernate.cfg</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt; 
  
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;        
          &lt;mapping class="app.model.Clients" /&gt;
      &lt;/session-factory&gt;         
  &lt;/hibernate-configuration&gt;
  </code></pre>