!MESSAGE An internal error occurred during: "Generating Artifacts".
!STACK 0
org.hibernate.tool.hbm2x.ExporterException: Error while processing template the second time
at com.genuitec.eclipse.hibernate.tool.hbm2x.VelocityProducer.secondPass(VelocityProducer.java:57)
at com.genuitec.eclipse.hibernate.tool.hbm2x.VelocityProducer.produce(VelocityProducer.java:33)
at com.genuitec.eclipse.hibernate.tool.hbm2x.VelocityProducer.produce(VelocityProducer.java:120)
at com.genuitec.eclipse.hibernate.wizards.MEHibernateMappingExporter.exportPOJO(MEHibernateMappingExporter.java:83)
at com.genuitec.eclipse.hibernate.tool.hbm2x.VGenericExporter.exportPersistentClass(VGenericExporter.java:73)
at com.genuitec.eclipse.hibernate.tool.hbm2x.VGenericExporter.exportClasses(VGenericExporter.java:56)
at com.genuitec.eclipse.hibernate.tool.hbm2x.VGenericExporter.doStart(VGenericExporter.java:41)
at com.genuitec.eclipse.hibernate.tool.hbm2x.VHibernateMappingExporter.doStart(VHibernateMappingExporter.java:36)
at com.genuitec.eclipse.hibernate.tool.hbm2x.VAbstractExporter.start(VAbstractExporter.java:97)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$3.execute(GenerateArtifactsJob.java:412)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:388)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Caused by: java.io.FileNotFoundException: D:\LiyqWorksSpace\virtuaSwitchl\src\com\srt\vas\bll\unitarycall\model\TabLtDepart.hbm.xml (鎷掔粷璁块棶銆??)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at com.genuitec.eclipse.hibernate.wizards.MEHibernateMappingExporter$1.getWriter(MEHibernateMappingExporter.java:75)
at com.genuitec.eclipse.hibernate.tool.hbm2x.VelocityProducer.secondPass(VelocityProducer.java:52)
... 13 more
不能生成映射文件,但是可以通过eclipse查询修改数据库表。

解决方案 »

  1.   

    D:\LiyqWorksSpace\virtuaSwitchl\src\com\srt\vas\bll\unitarycall\model\TabLtDepart.hbm.xml
    应该是这里的问题  看看有没有配置错误的地方
      

  2.   

    TabLtDepart.hbm.xml这个配置文件没有找到,肯定是没有配置,所以报错了
      

  3.   

    看看映射文件错没的. Caused by: java.io.FileNotFoundException: D:\LiyqWorksSpace\virtuaSwitchl\src\com\srt\vas\bll\unitarycall\model\TabLtDepart.hbm.xml (鎷掔粷璁块棶銆??) 
    这个是不是没有找到呀..才出现了FileNotFoundException呀
      

  4.   

    在 Eclipse 重新启动了之后,再次用同样的方法生成映射文件成功了,查看一下重启前配置了 Oralce 驱动是用的上面第 10 个包。再次使用那个有问题的 Oracle 驱动 classes111.jar 不重启 Eclipse,来生成映射文件也是顺利的,所以一定要记得在重新配置了 MyEclipse 的 Database Explorer 驱动之后要使用新的驱动来生成映射文件前重启一下你的 Eclipse,虽然连接的时候能够立即使用刚刚配置的驱动,但生成映射文件时却有些顽固,这大约也是 MyEclipse 的一个 Bug 吧。应该使用上面列出的任意一个驱动都是可行的,只侧重点不同而已,也不知道先前哪个 classese111.jar 是哪来的,困扰我这么久。看网上介绍说 Oracle 官方更推荐用 ojdbc12.jar 驱动。
      

  5.   

    根本原因是用了hibernate3.0版本hbm.xml文件运行在hibernate2.1系统上,虽然也可以运行但时不时有问题。
    谢谢大家