`
rigger21
  • 浏览: 127773 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

ibatis的一些错误码解释以及解决方法、一些使用心得

阅读更多
<script>function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}</script>

Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=641217

1. --- Cause: java.sql.SQLException: 无效的列类型; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
原因:

某个字段的插入值为空

解决方法:

将该字段的数值添加进去,或者将格式转化为动态的sql

2.

com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/kompakar/queue/transfusion/dao/ibatis/map/HisInfo.xml.
--- The error occurred while applying a parameter map.
--- Check the getPatientInfoByClinicNo-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: java.sql.SQLException: ORA-01002: 读取违反顺序
ORA-02063: 紧接着line(源于DBLINKFGHIS)

Caused by: java.sql.SQLException: ORA-01002: 读取违反顺序
ORA-02063: 紧接着line(源于DBLINKFGHIS)

原因:

在不应该提交事务的地方,主动提交了事务。用DBLINK方式连接另一个数据库,在IBATIS中必须声明为事务。

解决方法:

将这个方法声明为事务。

3.

错误码:

com.ibatis.common.beans.ProbeException: There is no READABLE property named 'tAlarmlogId' in class 'com.kompakar.queue.transfusion.bo.TAlarmLogBO'

错误原因:

BO文件中定义的变量,中间有大写的,所以在匹配中出错。--准确的说,是ibatis中的第二个字母不能大写

解决方法:

将BO文件中的所有变量名都修改为小写。

4.org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mraServiceTarget' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'patientMedicalAlertDAO' of bean class [com.kompakar.ehealth.service.impl.mra.MRAService]: Bean property 'patientMedicalAlertDAO' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
org.springframework.beans.NotWritablePropertyException: Invalid property 'patientMedicalAlertDAO' of bean class [com.kompakar.ehealth.service.impl.mra.MRAService]: Bean property 'patientMedicalAlertDAO' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:831)

原因:在service中配置了property,但是在具体的service实现类中,却没有声明该property,以及没有实现相应的set和get方法(bean的方法)。

解决方案:

在service的实现类中,增加该属性字段的声明和set、get方法

5、17:12:14,796 ERROR eHealthActionServlet:68 - class com.kompakar.ehealth.common.frame.communicate.eHealthActionServlet Exception occured in performing process(HttpServletRequest request, HttpServletResponse response).
javax.servlet.ServletException: There is no statement named WardMstr-getAllwardList in this SqlMap.
at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at com.kompakar.ehealth.common.frame.communicate.eHealthActionServlet.process(eHealthActionServlet.java:64)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

可能原因:
A、在相应的sqlmap配置文件真的没有 “WardMstr-getAllwardList ”
B、在sqlmap配置文件中, 没有引用对应表的配置xml文件。
解决方法:
修改sqlmap相应的配置文件。

6、在sqlmap中,特殊字符需要用 <![CDATA[ ]]>符号将特殊字符括起来

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics