复制内容到剪贴板 程序代码
net.sf.hibernate.PropertyNotFoundException:Could not find a getter for isAdmin in class order.vo.UserStatus
可能会有人纳闷这个Hibernate错误,我怎么会归类到Eclipse分类中,其实我今天遇到这个错误并不关hibernate什么事情,而是eclipse生成的getter/setter方法让hibernate不认,一般来说当值对象VO中有布尔类型变量,那么会把get方法取而代之为is.下面是ecplise自动生成的代码,也是hibernate报错的代码:
复制内容到剪贴板 程序代码
private boolean isAdmin;
public boolean isAdmin() {
return isAdmin;
}
public void setAdmin(boolean isAdmin) {
this.isAdmin = isAdmin;
public boolean isAdmin() {
return isAdmin;
}
public void setAdmin(boolean isAdmin) {
this.isAdmin = isAdmin;
放假在家实在闲得发慌,本不想在过年时碰代码(如果是上班的话,回到家代码肯定我是不看的),但人还是闲不住。想想还是写写吧,其实早有准备——放假前项目都copy到我U盘了。结果因为家里的机器很久没有写程序,数据库都得重装下。可是我的光驱不给面子,只好今天去买了个光驱……
家里的eclipse比较老古董,3.1的。将就了吧。。结果配置Web Server还老出错:
打消我积极向上的决心啊...虽然我英语很烂,不过一看就是没有指定Tomcat的JDK目录。解决!
接着,项目代码中报了很多错误,在单位写的时候可是全部通过的啊。
错误:仅当源级别为 5.0 时类型参数才可用
这个也好办:
家里的eclipse比较老古董,3.1的。将就了吧。。结果配置Web Server还老出错:
打消我积极向上的决心啊...虽然我英语很烂,不过一看就是没有指定Tomcat的JDK目录。解决!
接着,项目代码中报了很多错误,在单位写的时候可是全部通过的啊。
错误:仅当源级别为 5.0 时类型参数才可用
这个也好办:
引用内容
1、首选项-->Java-->编译器-->编译器一致性级别(选择5.0)
Tags: TOMCAT
Today, when I imported an existing project into eclipse's workspace, I got the following error:
Invalid project description.
D:/eclipse/workspace/report and D:/eclipse/workspace overlap
In the beginning, my project was located in D:/report instead of the workspace directory of eclipse, and its name was test. It worked well then. After googling on the internet, I found the root cause of the problem.
There are two kinds of places where projects can be located:
Invalid project description.
D:/eclipse/workspace/report and D:/eclipse/workspace overlap
In the beginning, my project was located in D:/report instead of the workspace directory of eclipse, and its name was test. It worked well then. After googling on the internet, I found the root cause of the problem.
There are two kinds of places where projects can be located:
Tags: invalid project description
E:\tools\eclipse-SDK-3.2\eclipse\eclipse.exe -vmargs -Xms512M -Xmx1024M -XX:PermSize=128M -XX:MaxPermSize=256M
MyEclipse中新建一个MessageBundle.properties文件,如果输入中文保存时就会提示错误:
Save could not be completed.
Reason:
some characters cannot be mapped using "ISO-8859-1" character encoding.
Either change the encoding or remove the characters which are not supported
by the "ISO-8859-1" character encoding.
Save could not be completed.
Reason:
some characters cannot be mapped using "ISO-8859-1" character encoding.
Either change the encoding or remove the characters which are not supported
by the "ISO-8859-1" character encoding.
引用内容
解决办法:
打开Eclipse的Preferences,选择General->Content Types,然后修改右面的Text下的Java Properites File的默认编码方式为UTF-8,点击Update就可以了!
打开Eclipse的Preferences,选择General->Content Types,然后修改右面的Text下的Java Properites File的默认编码方式为UTF-8,点击Update就可以了!