我是日食的新手。我正在尝试使用 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>
这是什么意思?为什么连接不上数据库?