No constructor with 1 argument defined in class 'UserDaoImpl' [config set: myProject/web-context]
<p>Error Message: No constructor with 1 argument defined in class 'UserDaoImpl' [config set: myProject/web-context]</p>

<p>After reading few other similar questions, verified that in the class all the constructors are named with the same class name, were of type public access modifier and there is no return type in the constructor. </p>

<p>Still this error message was shown in the hibernate.cfg.xml</p>

<pre><code>&lt;bean id="userDaoImpl" class="com.company.users.dao.UserDaoImpl"&gt;
    &lt;property name="sessionFactory" ref="sessionFactory"&gt;&lt;/property&gt;        
&lt;/bean&gt;
</code></pre>

<p>And, here is the constructor code in UserDaoImpl class. </p>

<pre><code>public UserDaoImpl(SessionFactory sessionFactory) {
    super();
    this.sessionFactory = sessionFactory;
}
</code></pre>

<p>@Gusman [Addition]</p>

<p>Hibernate session factory</p>

<pre><code>&lt;bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
    &lt;property name="dataSource"&gt;
        &lt;ref bean="dataSource"/&gt;
    &lt;/property&gt;
    &lt;property name="mappingResources"&gt;
        &lt;list&gt;
            &lt;value&gt;/resources/hibernate/User.hbm.xml&lt;/value&gt;
            &lt;value&gt;/resources/hibernate/UserRole.hbm.xml&lt;/value&gt;
        &lt;/list&gt;
    &lt;/property&gt;
    &lt;property name="hibernateProperties"&gt;
        &lt;props&gt;
            &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.MySQL5Dialect&lt;/prop&gt;
            &lt;prop key="hibernate.format_sql"&gt;true&lt;/prop&gt;
            &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
            &lt;prop key="hibernate.hbm2ddl.auto"&gt;create&lt;/prop&gt;
        &lt;/props&gt;
    &lt;/property&gt;
&lt;/bean&gt;
</code></pre>

<p>@hooknc [Addition]</p>

<p>This is the setter code in UserDaoImpl file. </p>

<pre><code>private SessionFactory sessionFactory;

public SessionFactory getSessionFactory() {
    return sessionFactory;
}
public void setSessionFactory(SessionFactory sessionFactory) {
    this.sessionFactory = sessionFactory;
}
</code></pre>