报错:
Bean property 'meatOutInfoBaseDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
代码:
beans-ibatis.xml:<bean id="meatOutInfoBaseDao" class="com.sunraw.kunming.dao.impl.MeatOutInfoBaseDaoImpl">
<property name="sqlMapClient">
<ref local="client" />
</property>
</bean>
<bean name="meatOutInfoBaseService"
class="com.sunraw.kunming.service.impl.MeatOutInfoBaseServiceImpl">
<property name="meatOutInfoBaseDao">
<ref bean="meatOutInfoBaseDao" />
</property>
</bean>
dao:
public interface MeatOutInfoBaseDao extends GenericDao<MeatOutInfoBase, String> {
}
dao.impl:
public class MeatOutInfoBaseDaoImpl extends GenericDaoImpl<MeatOutInfoBase, String> implements MeatOutInfoBaseDao {
}
service:
@WebService
public interface MeatOutInfoBaseService extends GenericService<MeatOutInfoBase,String> {
//public boolean Login(String userName, String password);
}
service.impl:
@WebService(endpointInterface = "com.sunraw.kunming.service.MeatOutInfoBaseService")
public class MeatOutInfoBaseServiceImpl extends GenericServiceImpl<MeatOutInfoBase, String> implements MeatOutInfoBaseService {
private MeatOutInfoBaseDao meatOutInfoBaseDao;
public void setUserDao(MeatOutInfoBaseDao meatOutInfoBaseDao) {
this.meatOutInfoBaseDao = meatOutInfoBaseDao;
}
public GenericDao<MeatOutInfoBase, String> getDao(){
return meatOutInfoBaseDao;
}
}
小弟刚原来做.net,现在由于项目需求做java
请问一下上面哪里出错了?
------解决方案--------------------------------------------------------
你MeatOutInfoBaseServiceImpl 里的setUserDao()错了,看看你上边定义的Dao,也就是说你的MeatOutInfoBaseDao 的对象没有set方法。。
------解决方案--------------------------------------------------------
'meatOutInfoBaseDao' 没有set方法。
------解决方案--------------------------------------------------------
service.impl中的
public void setUserDao(MeatOutInfoBaseDao meatOutInfoBaseDao) {
this.meatOutInfoBaseDao = meatOutInfoBaseDao;
}
出错,应该是
public void setMeatOutInfoBaseDao(MeatOutInfoBaseDao meatOutInfoBaseDao) {
this.meatOutInfoBaseDao = meatOutInfoBaseDao;
}