title: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.Class]
body: <p>I created a simple web app using hibernate and spring and i want to implement an abstract class that contains the crud operations  but I have this error :</p>
  <pre><code>    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clientService' defined in class path resource [applicationContext.xml]: 
  Cannot resolve reference to bean 'clientDao' while setting bean property 'clientDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: 
  Error creating bean with name 'clientDao' defined in class path resource [applicationContext.xml]: 
  Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.Class]: 
  </code></pre>
  <p>GenericDao</p>
  <pre><code>public interface GenericDao&lt;T, ID extends Serializable&gt; {
      
      T save(T entity);
      T update(T entity);
      void delete(T entity);
      T findById(ID id);
      List&lt;T&gt; findAll();
      void flush();
  </code></pre>
  <p>}</p>
  <p>GenericDaoImpl</p>
  <pre><code>@Transactional
  public  class GenericDaoImpl&lt;T, ID extends Serializable&gt; implements GenericDao&lt;T, ID&gt; {
      
      @Autowired
      SessionFactory sessionFactory ;
      
   private Class&lt;T&gt; persistentClass;
       
       
      
      public GenericDaoImpl() {
      super();
  }
  
      public GenericDaoImpl(Class&lt;T&gt; persistentClass) {
      super();
      this.persistentClass = persistentClass;
  }
  
      @Transactional
      public T save(T entity) {
          this.sessionFactory.getCurrentSession().save(entity);
          return null;
      }
  
      @Transactional
      public T update(T entity) {
          this.sessionFactory.getCurrentSession().update(entity);
          return null;
      }
  
      @Transactional
      public void delete(T entity) {
          this.sessionFactory.getCurrentSession().delete(entity);
          
      }
  
      @SuppressWarnings(&quot;unchecked&quot;)
      @Transactional
      public T findById(ID id) {
          return  (T) this.sessionFactory.getCurrentSession().load(this.getPersistentClass(), id);
          
      }
      @SuppressWarnings(&quot;unchecked&quot;)
      @Transactional
      public List&lt;T&gt; findAll() {
          return   this.sessionFactory.getCurrentSession().createQuery(&quot;* from&quot;+this.getPersistentClass().getSimpleName()).list();
      }
  
      @Transactional
      public void flush() {
          this.sessionFactory.getCurrentSession().flush();
          
      }
  
      public SessionFactory getSessionFactory() {
          return sessionFactory;
      }
  
      public void setSessionFactory(SessionFactory sessionFactory) {
          this.sessionFactory = sessionFactory;
      }
  
      public Class&lt;T&gt; getPersistentClass() {
          return persistentClass;
      }
  
      public void setPersistentClass(Class&lt;T&gt; persistentClass) {
          this.persistentClass = persistentClass;
      }
      
      
  
  }
  </code></pre>
  <p>ClientDao</p>
  <pre><code>public interface ClientDao  extends GenericDao&lt;Client,Integer&gt;  {
  
  
  
  }
  </code></pre>
  <p>ClientDaoImpl</p>
  <pre><code>@Transactional
  @Repository(&quot;clientDao&quot;)
  public class ClientDaoImpl extends GenericDaoImpl&lt;Client,Integer&gt;  implements ClientDao {
      
      
      
  
      
      
      public ClientDaoImpl(Class&lt;Client&gt; persistentClass) {
          super(persistentClass);
          
      }
  </code></pre>
  <p>application context.xml</p>
  <pre><code>&lt;bean id=&quot;client&quot; class=&quot;com.webapp.model.Client&quot;/&gt;
  
    &lt;bean id=&quot;genericDao&quot; class=&quot;com.webapp.dao.GenericDaoImpl&quot;&gt;
          &lt;property name=&quot;sessionFactory&quot; ref=&quot;sessionFactory&quot; /&gt;
      &lt;/bean&gt;
      &lt;bean id=&quot;clientDao&quot; class=&quot;com.webapp.dao.ClientDaoImpl&quot; parent=&quot;genericDao&quot;&gt;
      &lt;constructor-arg ref=&quot;client&quot; /&gt;
     &lt;/bean&gt;
  
   &lt;bean id=&quot;clientService&quot; class=&quot;com.webapp.service.ClientServiceImpl&quot;&gt;
          &lt;property name=&quot;clientDao&quot; ref=&quot;clientDao&quot; /&gt;
      &lt;/bean&gt;
  </code></pre>