Generating Artifacts问题解决
Generating Artifacts问题解决
在myeclipse中使用hibernate进行“Hibernate Reverse Engineering”报如下错:
!ENTRY org.eclipse.core.jobs 4 2 2010-12-27 14:20:11.625
!MESSAGE An internal error occurred during: "Generating Artifacts".
!STACK 0
java.lang.IllegalArgumentException: Path must include project and resource name: /
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:62)
at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:1631)
at org.eclipse.core.internal.resources.Container.getFile(Container.java:123)
at com.genuitec.eclipse.hibernate.util.HibernateUtils.getConfigFile(HibernateUtils.java:510)
at com.genuitec.eclipse.hibernate.util.HTUtils.getConsoleConfigurationPreferences(HTUtils.java:184)
at com.genuitec.eclipse.hibernate.util.HTUtils.getConsoleConfiguration(HTUtils.java:175)
at com.genuitec.eclipse.hibernate.util.HTUtils.getConsoleConfiguration(HTUtils.java:165)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:361)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
解决方案:
修改.myhibernatedata(工程下)文件里面的configFile属性
指定applicationContext.xml路径。格式是/项目名称/路径/applicationContext.xml
.myhibernatedata文件
#
#Sat Sep 19 15:30:33 CST 2009
genBasicCompId=true
sessionFactoryName=liss.samples.myssh2.domain.HibernateSessionFactory
profile=
daoSFId=
version=3.3
jndiPath=
springDaoFile=
useJavaTypes=true
keyGenerator=increment
libInstallFolder=
addLibs2Project=false
genVersionTag=true
sessionFactoryId=
basePersistenceClass=
reSettingsFile=/myssh2/hibernate.reveng.xml
configFile=/myssh2/conf/applicationContext.xml
createConfigFile=false
addLibs2Classpath=false
baseDaoClass=BaseHibernateDAO