There is no WRITEABLE property named 'outboxsize' in class 怎么回事
javabean代码:package com.webapp.mail.outbox.domain;
import java.util.List;
public class Outbox
{
private int id;
private String title;
private String content;
private String addresser;//发件人
private long senddate;
private String failnews;
private int outboxsize;
private List addressees;
private List annexs;
public int getOutboxsize() {
return outboxsize;
}
public void setOutboxsize(int outboxsize) {
this.outboxsize = outboxsize;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getAddresser() {
return addresser;
}
public void setAddresser(String addresser) {
this.addresser = addresser;
}
public long getSenddate() {
return senddate;
}
public void setSenddate(long senddate) {
this.senddate = senddate;
}
public String getFailnews() {
return failnews;
}
public void setFailnews(String failnews) {
this.failnews = failnews;
}
public List getAddressees() {
return addressees;
}
public void setAddressees(List addressees) {
this.addressees = addressees;
}
public List getAnnexs() {
return annexs;
}
public void setAnnexs(List annexs) {
this.annexs = annexs;
}
}
配置文件代码:
<resultMap class="Outbox" id="OutboxResult">
<result property="id" column="id"/>
<result property="title" column="title"/>
<result property="content" column="content"/>
<result property="addresser" column="addresser"/>
<result property="senddate" column="senddate"/>
<result property="failnews" column="failnews"/>
<result property="outboxsize" column="outboxsize"/>
</resultMap>
所报的异常:
Caused by: com.ibatis.common.beans.ProbeException: There is no WRITEABLE property named 'outboxsize' in class 'com.webapp.mail.outbox.domain.Outbox'
at com.ibatis.common.beans.ClassInfo.getSetterType(ClassInfo.java:405)
at com.ibatis.common.beans.GenericProbe.getClassPropertyTypeForSetter(GenericProbe.java:251)
at com.ibatis.common.beans.GenericProbe.getPropertyTypeForSetter(GenericProbe.java:135)
at com.ibatis.sqlmap.engine.config.SqlMapConfiguration.resolveTypeHandler(SqlMapConfiguration.java:195)
at com.ibatis.sqlmap.engine.config.ResultMapConfig.addResultMapping(ResultMapConfig.java:116)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser$14.process(SqlMapParser.java:279)
at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121)
... 52 more
------解决方案--------------------这样的异常很奇怪,应该是配置文件对属性配置的问题,楼主还是仔细检查一下配置文件吧。
------解决方案--------------------1、检查你的配置文件与数据库字段的对应是否一致
2、检查model里的属性的get和set方法,如果你用eclipse,用自动生成get和set方法,这样可以保证你不会错