今天报了一个org.hibernate.DuplicateMappingException: Duplicate collection role mapping xx.Account.cards,从来没见过的错误,有些怕怕了。不过看起来是重复映射了,应该是哪里粗心大意的问题,但是代码基本没什么改变啊,把那个cards 删除后 干脆就报 Duplicate class mapping Acount,晕倒。

于是乎只好找google老师解决问题,看到:
http://forum.hibernate.org/viewtopic.php?t=969123&sid=8797b20ef23e47745a5d196473194e27

says:

my problem was a change of package.
Specifically, i compile the project with the class in a a.b.c package. then i moved the class to the c.d.e package, but eclipse didn't clean the previous .class file generated.
i clean the project and all works fine now

俺也跟着clean一把,问题同样解决
缘由是我把project名改了一个...

用ant脚本重建数据库后竟然又报错了,终于发现真正的原因了,原来不是clean的问题,还以为是eclipse的问题呢,原来是自己把ant编译的class和eclipse编译的class放在了不同目录,但是都是eclipse的classpath,于是乎加载了两次。。
评论
javamanlcy007 2008-07-26
我今天也遇到这个问题,才搜到这个帖子~
还没有解决,等恢复哦
iceworld4143 2008-06-27
这个错误解决了,又抱了别的错误~
iceworld4143 2008-06-27
解释不太懂,我也遇到这个问题了,可是我没用ant。 等回复。
发表评论

您还没有登录,请登录后发表评论

eyejava
搜索本博客
我的相册
5882c820-4b57-4dfd-b8d1-046e88098b0f-thumb
Gmail
共 8 张
存档
最新评论