借助工具生成Hibernate的POJO和xml文件报如下错误:
1、
An internal error occurred during: "Generating Artifacts".
Path must include project and resource name: /
解决方法如下:
找到工程下的 .myhibernatedata
修改为:
#
#Fri Dec 16 13:39:20 CST 2011
genBasicCompId=true
sessionFactoryName=com.pengpeng.model.domain.HibernateSessionFactory
profile=
daoSFId=
version=3.2
jndiPath=
detectM2M=false
reStrategyClass=
springDaoFile=
useJavaTypes=true
keyGenerator=
libInstallFolder=lib
addLibs2Project=true
genVersionTag=false
sessionFactoryId=
basePersistenceClass=
reSettingsFile=
configFile=/model/trunk/src/hibernate.cfg.xml
createConfigFile=true
addLibs2Classpath=true
baseDaoClass=BaseHibernateDAO
除了configFile目录自己写以外,其他的完全可以复制粘贴;
甚至configFile的路径不做更改也可以,我的工程下就没有/model/trunk/src/hibernate.cfg.xml
2、如下报错:
“This wizard generates Hibernate 3.0.OR mapping(*.hbm.xml).
the project you selected is a Hibernate 2 project.Execution of
this wizard may produce incompatible mapping files "
解决:将version改成你自己的版本好就ok