No setter found for property 'userDAO' in class 'com.ssh.service.impl.User1Service'
Posted on 2015-02-11 15:54 ╰★张志峰★╮ 阅读(5695) 评论(1) 编辑 收藏 举报造成此问题的原因是: 在applicationContext.xml中引用
<bean id="userService" class="com.ssh.service.impl.User1Service">
<property name="user1DAO">
<ref bean="User1DAO" />
</property>
</bean>
但是在User1Service中没有定义 成员变量的属性
private User1DAO user1DAO;
public User1DAO getUser1DAO() {
return user1DAO;
}
public void setUser1DAO(User1DAO user1dao) {
user1DAO = user1dao;
}
这样就可以了