ssh 开发中出现的异常_1

--------------------1----------------------

exception is org.springframework.beans.NotWritablePropertyException:
Invalid property 'sessionFactory' of bean class [com.actions.ProvinceAction]: Bean property
'sessionFactory' is not writable or has an invalid setter method. Does the para
meter type of the setter match the return type of the getter?:

------异常原因:一个bean 用到sessionFactory 属性,而该bean里面没有写sessionFactory 的
get/set方法。

--------------------2----------------------
2009-03-23 16:12:54.568::WARN: Nested in org.apache.jasper.JasperException: tag
'select', field 'list', name 'resume.province.id': The requested list key 'prov
inces' could not be resolved as a collection/array/map/enumeration/iterator type
. Example: people or people.{name} - [unknown location]:

-------一直头疼恶心的错误, action 中有provinces属性 这里却找不到。 原因:
如果从action 到struts标签都没错的话 就是在 get provinces属性 底层出现了异常。
而这里不打印异常栈
解决方法:异常打印不出来,而底层确实有出错的异常栈。我的解决方法是逐层分析。
感觉可能是哪部份出现的异常,先删除或者跳过那部分代码执行程序,如果没异常,说明
异常出现在该代码段。反之继续用此方法调试。

如 我的action中给provinces 属性赋值的方法是

public List<Province> getProvinces() {
if( provinces == null ){
provinces = provinceDao.getAllProvinces();
}
return provinces;
}

我先注释掉于底层打交道的代码 即
if( provinces == null ){
provinces = provinceDao.getAllProvinces();
}
然后new 一个List 看看是否还有异常。若没有异常 则取消注释 继续到getAllProvinces
方法中,同样利用此方法调试。

-----------------------

------如果没有spring 集成,hibernate 配置文件在sessionFactory = new Configuration().configure().buildSessionFactory(); 这句话时被读取。

-----------------------
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值