I try to autowired session factory to dao layer.I have error:java.lang.NoClassDefFoundError: I locked more configures but no one work for me. This is my dao:
  @Component
        public class UserDaoImpl implements UserDao{
    @Autowired 
   private SessionFactory sessionFactory;  
  @Override
      public void saveUser(User user) {
    sessionFactory.getCurrentSession().save(user);
   }
I have hibernate config file:
<hibernate-configuration>
   <session-factory>
  <property    name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306 /vezba2?zeroDateTimeBehavior=convertToNull</property>
<property name="hibernate.connection.username">root</property>
<mapping class="com.entiti.User"/>
<mapping class="com.entiti.Rezervacija"/>
   </session-factory>
</hibernate-configuration>
I create xml file with beans:
             <context:annotation-config/>
    <bean id="user" class="com.dao.UserDaoImpl">
     <property name="sessionFactory" ref="sessionFactory"></property>
      </bean>
     <bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
       <property name="configLocation">
      <value>classpath*:hibernate.cfg.xml</value>
      </property>
     </bean>  
Please help if someone know where is my fault.
 
    