我在Eclipse Oxygen中使用Hibernate Tools收到“未处理的事件循环异常”。当我尝试“完成”以下“休眠配置向导”时,会出现此错误。请注意,我已经尝试了此页面上条目的多种组合,并且全部导致该异常。
1)我该如何解决?
2)Hibernate工具值得为解决这个问题付出努力吗?
如果这些工具可行的话,看起来可能很酷。
org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:270)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:232)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:209)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51)
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:241)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:209)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:356)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:112)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:84)
at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:470)
at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:91)
at org.hibernate.boot.MetadataSources.buildMetadata(MetadataSources.java:183)
at org.jboss.tools.hibernate.runtime.v_5_3.internal.util.MetadataHelper.buildFromMetadataSources(MetadataHelper.java:49)
at org.jboss.tools.hibernate.runtime.v_5_3.internal.util.MetadataHelper.getMetadata(MetadataHelper.java:21)
at org.jboss.tools.hibernate.runtime.v_5_3.internal.ConfigurationFacadeImpl.getMetadata(ConfigurationFacadeImpl.java:174)
at org.jboss.tools.hibernate.runtime.v_5_3.internal.util.ConfigurationMetadataDescriptor.createMetadata(ConfigurationMetadataDescriptor.java:20)
at org.hibernate.tool.hbm2x.AbstractExporter.buildMetadata(AbstractExporter.java:207)
at org.hibernate.tool.hbm2x.AbstractExporter.getMetadata(AbstractExporter.java:57)
at org.hibernate.tool.hbm2x.AbstractExporter.setupContext(AbstractExporter.java:178)
at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:105)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.tools.hibernate.runtime.common.Util.invokeMethod(Util.java:43)
at org.jboss.tools.hibernate.runtime.common.AbstractExporterFacade.start(AbstractExporterFacade.java:72)
at org.hibernate.eclipse.console.wizards.NewConfigurationWizard.openContentStream(NewConfigurationWizard.java:301)
at org.hibernate.eclipse.console.wizards.NewConfigurationWizard.access$2(NewConfigurationWizard.java:295)
at org.hibernate.eclipse.console.wizards.NewConfigurationWizard$1.getInitialContents(NewConfigurationWizard.java:163)
at org.eclipse.ui.dialogs.WizardNewFileCreationPage.createNewFile(WizardNewFileCreationPage.java:380)
at org.hibernate.eclipse.console.wizards.NewConfigurationWizard.performFinish(NewConfigurationWizard.java:198)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:778)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:417)
at org.eclipse.jface.dialogs.Dialog.lambda$0(Dialog.java:619)
at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:81)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:818)
at org.eclipse.jface.window.Window.open(Window.java:794)
at org.hibernate.eclipse.launch.ConsoleConfigurationMainTab.handleConfigurationFileCreate(ConsoleConfigurationMainTab.java:400)
at org.hibernate.eclipse.launch.ConsoleConfigurationMainTab.handleConfigurationFileSetup(ConsoleConfigurationMainTab.java:362)
at org.hibernate.eclipse.launch.ConsoleConfigurationMainTab.access$2(ConsoleConfigurationMainTab.java:354)
at org.hibernate.eclipse.launch.ConsoleConfigurationMainTab$4.widgetSelected(ConsoleConfigurationMainTab.java:178)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:818)
at org.eclipse.jface.window.Window.open(Window.java:794)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.open(LaunchConfigurationsDialog.java:1203)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog.open(LaunchConfigurationPropertiesDialog.java:213)
at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationPropertiesDialog(DebugUITools.java:679)
at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationPropertiesDialog(DebugUITools.java:656)
at org.hibernate.eclipse.console.actions.EditConsoleConfiguration.edit(EditConsoleConfiguration.java:87)
at org.hibernate.eclipse.console.actions.EditConsoleConfiguration.doRun(EditConsoleConfiguration.java:75)
at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:64)
at org.hibernate.eclipse.console.views.KnownConfigurationsView$4.run(KnownConfigurationsView.java:177)
at org.hibernate.eclipse.console.views.KnownConfigurationsView$2.doubleClick(KnownConfigurationsView.java:123)
at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:831)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:44)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:828)
at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1459)
at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1258)
at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:249)
at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:247)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:306)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:100)
at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:54)
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:137)
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:258)
... 100 more
答案 0 :(得分:5)
我有同样的问题。如果将“休眠版本”值更改为5.1,则可以“完成”向导。
答案 1 :(得分:0)
如果您仍然遇到问题,请使用@halfpad解决方案来更新Java版本。