Eclipse:连接和配置休眠



我是日食的新手。我正在尝试与Hibernate合作。Java ee IDE版本Juno和Hibernate工具版本3.5.1。在 IDE 的数据库开发中,我创建了一个数据源,并测试了连接,它工作正常。然后我创建了一个休眠配置文件休眠.cfg.xml然后我创建了一个休眠控制台配置当我尝试刷新控制台配置或尝试创建逆向工程文件时,出现错误"期间发生内部错误:获取 TestHiber01 的子项。 插件 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)

休眠.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>

什么意思?为什么无法连接到数据库?

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

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

相关内容

  • 没有找到相关文章

最新更新