0

我是日食的新手。我正在尝试使用 Hibernate。Java ee IDE 版本 Juno 和 Hibernate Tools 版本 3.5.1。在 IDE 的数据库开发中,我创建了一个数据源,并测试了连接,它工作正常。然后我创建了一个 Hibernate 配置文件 hibernate.cfg.xml 然后我创建了一个 Hibernate 控制台配置 当我尝试刷新控制台配置或尝试创建逆向工程文件时,出现错误“期间发生内部错误:获取 TestHiber01.plugin org.eclipse.core.jobs 的子项。所有错误日志为:

eclipse.buildId=M20120914-1800
java.version=1.6.0_25
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=it_IT
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product

Error
Fri Oct 05 16:03:24 CEST 2012
An internal error occurred during: "Fetching children of TestHiber01".

java.lang.NoSuchMethodError: org.eclipse.jpt.jpa.core.JptJpaCorePlugin.getJpaProjectManager()Lorg/eclipse/jpt/jpa/core/JpaProjectManager;
    at org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin$1.revalidateProjects(HibernateJptPlugin.java:108)
    at org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin$1.configurationBuilt(HibernateJptPlugin.java:127)
    at org.hibernate.console.KnownConfigurations$1$3.notify(KnownConfigurations.java:94)
    at org.hibernate.console.KnownConfigurations$Notification.run(KnownConfigurations.java:123)
    at org.hibernate.console.KnownConfigurations.fireNotification(KnownConfigurations.java:259)
    at org.hibernate.console.KnownConfigurations.access$0(KnownConfigurations.java:253)
    at org.hibernate.console.KnownConfigurations$1.configurationBuilt(KnownConfigurations.java:92)
    at org.hibernate.console.ConsoleConfiguration.fireConfigurationBuilt(ConsoleConfiguration.java:320)
    at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:190)
    at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleCon

figurationWorkbenchAdapter.java:42)     at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:100)    at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106)  at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:235)    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

hibernate.cfg 文件是:

<session-factory>
    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="hibernate.connection.password">XXXXX</property>
    <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/mydb</property>
    <property name="hibernate.connection.username">root</property>
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
</session-factory>

这是什么意思?为什么连接不上数据库?

4

1 回答 1

4

Hibernate Tools 3.5.1 依赖于 Eclipse Indigo。您遇到了兼容性问题。

当我使用JBoss Juno 更新站点时,我看到这个版本的 Hibernate Tools 可供安装:Hibernate Tools 3.6.0.Alpha1-v20120910-1507-H32。这是相应的JBoss 问题

于 2012-10-08T18:02:38.730 回答