使用Myeclipse完成Hibernate的逆向工程问题

xinxiwu 发布于 2014/03/25 20:08
阅读 2K+
收藏 0

使用win7 64位系统   myeclipse10,  mysql :mysql-5.5.34-winx64.msi ,  jdk1.7    初学hibernate

jdbc驱动:mysql-connector-java-5.1.22-bin.jar  使用myeclipse
完成hibernate reverse engineering  使用hibernate 4.1 时出现.

G:\myeclipse10\.metadata\.log文件内容为

!ENTRY com.genuitec.org.hibernate.eclipse 1 0 2014-03-25 18:07:09.509
!MESSAGE Resolving from catalog : http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd

!ENTRY org.eclipse.core.jobs 4 2 2014-03-25 18:07:09.875
!MESSAGE An internal error occurred during: "Generating Artifacts".
!STACK 0
java.util.NoSuchElementException
    at java.util.HashMap$HashIterator.nextEntry(HashMap.java:929)
    at java.util.HashMap$ValueIterator.next(HashMap.java:954)
    at com.genuitec.eclipse.hibernate.tool.MESingleClassExporter.doStart(MESingleClassExporter.java:59)
    at com.genuitec.eclipse.hibernate.tool.hbm2x.VAbstractExporter.start(VAbstractExporter.java:97)
    at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$3.execute(GenerateArtifactsJob.java:553)
    at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:64)
    at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:95)
    at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:418)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

一下是Error log  Message


一下是myeclipse.ini内容

#utf8 (do not remove)
#utf8 (do not remove)
-startup
../Common/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
../Common/plugins/org.eclipse.equinox.launcher.i18n.win32.win32.x86_64_4.2.0.v201201111650
-install
E:\myeclipse10\MyEclipse 10
-vm
D:\Java\bin\javaw.exe
-configuration
E:\myeclipse10\MyEclipse 10\configuration
-vmargs
-Xmx512m
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=128m
-Dosgi.nls.warnings=ignore

一下是hibernate.cfg.xml内容

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration>

    <session-factory>
        <property name="dialect">
            org.hibernate.dialect.MySQLDialect
        </property>
        <property name="connection.url">
            jdbc:mysql://localhost:3306/db2014?useUnicode=true&amp;characterEncoding=utf8
        </property>
        <property name="connection.username">root</property>
        <property name="connection.password">MYSQL3wu</property>
        <property name="connection.driver_class">
            com.mysql.jdbc.Driver
        </property>
        <property name="myeclipse.connection.profile">db2</property>

    </session-factory>

</hibernate-configuration>

什么映射文件也没有生成,jdk换成myeclipse 自带的jdk1.6也是这个结果.

查了几天 不知道是什么问题 jdbc驱动? 哪里没有配置好, 还是我就手动写....

 请大家给出建议    谢谢  大家

加载中
0
x
xinxiwu

问题解决 ,,原来是在DB-BROWER联接数据库的时候 schema datails没有设置为dispaly all schema....


返回顶部
顶部