今天在做修改数据库的时候报了一个错,错误如下:
Servlet.service() for servlet [SpringMVC] in context with path [/cms] threw exception [Request processing failed; nested exception is com.yum.cms.exception.UnkownException: Error occurred in application.] with root cause
com.yum.cms.exception.UnkownException: Error occurred in application.
一开始在后台设置了断点,结果断点都没用进去,以为是服务器的问题,但最后在百度上找到了类似的问题。http://zhidao.baidu.com/link?url=dmPScW5iyip4_xd_Jss34PiZ4jn6BJdTd0u7Mt8kDlRmTZ6SK-k1WqJOqMxE8zdLBAbRlATQVO20yzpgyqvlV_ZRtqSQoA6HVs16FQpkf3W
百度上指出是sql文的错误,我便仔细看了下我的sql的XML文件:
<update id="updataCzymanage" parameterType="com.yum.cms.acp.entity.listBeans">
<![CDATA[update czymanage set proname=#{name},pronumber=#{number},prodist=#{dist},procaegory=#{caegory} where proid=#{id}]]>
</update>
最终发现是id写错了,我的调用方法如下
public void updateCzymanage(listBeans listbeans) {
dao.update("productMapper.updateCzymanage",listbeans);
}
将id=”updataCzymanage” 改成id=”updateCzymanage” ,问题解决。