今天发布程序时,总是因为一个字段取值为null,程序无法进行乡镇配置。
他们确认一下ServiceItem.xml的配置文件无误情况下,
他们说是不是tomcat的老毛病又犯了。
后来在两位同事提出问题的核心细心指教下,我开始对程序监察,取出ServiceItem 对象首先的关卡数据库层,调试对象ss的depCode的属性。
public ServiceItem getServiceItemDetail(Integer id) throws DAOException {
try {
//executeForObjectList
ServiceItem ss=((ServiceItem) smcTemplate.queryForObject(
"ServiceItem.getServiceItemDetail", id));
return ss;
} catch (Exception ex) {
logger.error("执行:ServiceItemDaoImpl.getServiceItemDetail()方法出错!");
logger.error(ex.getMessage());
throw new DAOException();
}
}
呵呵,果然,是depCode的属性为null.也就是说ServiceItem.xml的配置文件映射时就有问题,可是经过同事们印证真的“没问题”啊!
同事让我看了发布下的xml文件,奇怪
<!--
<result property="deptCode" column="deptCode" />
<result property="deptType" column="deptType" />
-->
这两个字段的确被注释了。
难道真的是发布没有成功,我郁闷!可是一而再发布重启服务器,问题依旧,我更郁闷。
突然,我脑子里有个想法:是不是有两个配置文件,我修改的是副本。
呵呵,果然是啊,晕,真是冤枉了tomcat拉!
我的技术还没有那么牛,岂是tomcat错误!...(很垃圾滴)
:arrow:
在编程生涯中,我需要更多考虑的是自己技术问题和非技术问题(比如粗心),而不是开源的“过错”!
他们确认一下ServiceItem.xml的配置文件无误情况下,
他们说是不是tomcat的老毛病又犯了。
后来在两位同事提出问题的核心细心指教下,我开始对程序监察,取出ServiceItem 对象首先的关卡数据库层,调试对象ss的depCode的属性。
public ServiceItem getServiceItemDetail(Integer id) throws DAOException {
try {
//executeForObjectList
ServiceItem ss=((ServiceItem) smcTemplate.queryForObject(
"ServiceItem.getServiceItemDetail", id));
return ss;
} catch (Exception ex) {
logger.error("执行:ServiceItemDaoImpl.getServiceItemDetail()方法出错!");
logger.error(ex.getMessage());
throw new DAOException();
}
}
呵呵,果然,是depCode的属性为null.也就是说ServiceItem.xml的配置文件映射时就有问题,可是经过同事们印证真的“没问题”啊!
同事让我看了发布下的xml文件,奇怪
<!--
<result property="deptCode" column="deptCode" />
<result property="deptType" column="deptType" />
-->
这两个字段的确被注释了。
难道真的是发布没有成功,我郁闷!可是一而再发布重启服务器,问题依旧,我更郁闷。
突然,我脑子里有个想法:是不是有两个配置文件,我修改的是副本。
呵呵,果然是啊,晕,真是冤枉了tomcat拉!
我的技术还没有那么牛,岂是tomcat错误!...(很垃圾滴)
:arrow:
在编程生涯中,我需要更多考虑的是自己技术问题和非技术问题(比如粗心),而不是开源的“过错”!