During the Spring and Hibernate integration when it came to this issue, the problem described below.
Cause of the problem? Errors Spring's XML configuration file Bean
Solution: correct configuration XML file, for example, the following code
<bean id="userService" class="com.bj186.crm.service.impl.UserServiceImpl" > <!--在注入的时候,userDao中必须要有userDao的Setter方法--> <property name="userDao" ref="userDao"> </property> </bean> <bean id="userDao" class="com.bj186.crm.dao.impl.UserDaoImpl"> <property name="session" ref="session"> </property> </bean> <!--配置Hibernate的SessionFactory--> <bean id="session" class="com.bj186.crm.factory.HibernateUtil" factory-method="getSession"> </bean>