я не могу создать hibernate.cfg.xml и не могу понять эту ошибку
потому что я установил базу данных диалекта оракула 10g
но я использую базу данных оракула 11 xe
Ошибка: вызвано: org.hibernate.HibernateException: доступ к
DialectResolutionInfo не может быть нулевым, если не задано значение hibernate.dialect
в
org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect (DialectFactoryImpl.java:100)
org.hibernate.service.spi.ServiceException: Невозможно создать запрошенную службу [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
в
org.hibernate.service.internal.AbstractServiceRegistryImpl.createService (AbstractServiceRegistryImpl.java:275)
в
org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService (AbstractServiceRegistryImpl.java:237)
в
org.hibernate.service.internal.AbstractServiceRegistryImpl.getService (AbstractServiceRegistryImpl.java:214)
в
org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices (DefaultIdentifierGeneratorFactory.java:152)
в
org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies (AbstractServiceRegistryImpl.java:286)
в
org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService (AbstractServiceRegistryImpl.java:243)
в
org.hibernate.service.internal.AbstractServiceRegistryImpl.getService (AbstractServiceRegistryImpl.java:214)
в
org.hibernate.boot.internal.InFlightMetadataCollectorImpl. (InFlightMetadataCollectorImpl.java:179)
в
org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete (MetadataBuildingProcess.java:119)
в
org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build (MetadataBuildingProcess.java:84)
в
org.hibernate.boot.internal.MetadataBuilderImpl.build (MetadataBuilderImpl.java:474)
в
org.hibernate.boot.internal.MetadataBuilderImpl.build (MetadataBuilderImpl.java:85)
в
org.hibernate.boot.MetadataSources.buildMetadata (MetadataSources.java:184)
в
org.jboss.tools.hibernate.runtime.v_5_3.internal.util.MetadataHelper.buildFromMetadataSources (MetadataHelper.java:49)
в
org.jboss.tools.hibernate.runtime.v_5_3.internal.util.MetadataHelper.getMetadata (MetadataHelper.java:21)
в
org.jboss.tools.hibernate.runtime.v_5_3.internal.ConfigurationFacadeImpl.getMetadata (ConfigurationFacadeImpl.java:174)
в
org.jboss.tools.hibernate.runtime.v_5_3.internal.util.ConfigurationMetadataDescriptor.createMetadata (ConfigurationMetadataDescriptor.java:20)
в
org.hibernate.tool.hbm2x.AbstractExporter.buildMetadata (AbstractExporter.java:207)
в
org.hibernate.tool.hbm2x.AbstractExporter.getMetadata (AbstractExporter.java:57)
в
org.hibernate.tool.hbm2x.AbstractExporter.setupContext (AbstractExporter.java:178)
в
org.hibernate.tool.hbm2x.AbstractExporter.start (AbstractExporter.java:105)
at sun.reflect.GeneratedMethodAccessor581.invoke (неизвестный источник) в
sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
в java.lang.reflect.Method.invoke (Method.java:498) в
org.jboss.tools.hibernate.runtime.common.Util.invokeMethod (Util.java:43)
в
org.jboss.tools.hibernate.runtime.common.AbstractExporterFacade.start (AbstractExporterFacade.java:72)
в
org.hibernate.eclipse.console.wizards.NewConfigurationWizard.openContentStream (NewConfigurationWizard.java:301)
в
org.hibernate.eclipse.console.wizards.NewConfigurationWizard.access $ 2 (NewConfigurationWizard.java:295)
в
org.hibernate.eclipse.console.wizards.NewConfigurationWizard $ 1.getInitialContents (NewConfigurationWizard.java:163)
в
org.eclipse.ui.dialogs.WizardNewFileCreationPage.createNewFile (WizardNewFileCreationPage.java:380)
вorg.hibernate.eclipse.console.wizards.NewConfigurationWizard.performFinish (NewConfigurationWizard.java:198)
в
org.eclipse.jface.wizard.WizardDialog.finishPressed (WizardDialog.java:772)
в
org.eclipse.jface.wizard.WizardDialog.buttonPressed (WizardDialog.java:411)
в org.eclipse.jface.dialogs.Dialog.lambda $ 0 (Dialog.java:619) в
org.eclipse.swt.events.SelectionListener $ 1.widgetSelected (SelectionListener.java:81)
в
org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:249)
в org.eclipse.swt.widgets.EventTable.sendEvent (EventTable.java:86)
в org.eclipse.swt.widgets.Display.sendEvent (Display.java:5686) в
org.eclipse.swt.widgets.Widget.sendEvent (Widget.java:1370) в
org.eclipse.swt.widgets.Display.runDeferredEvents (Display.java:4940)
в org.eclipse.swt.widgets.Display.readAndDispatch (Display.java:4518)
в org.eclipse.jface.window.Window.runEventLoop (Window.java:818) в
org.eclipse.jface.window.Window.open (Window.java:794) в
org.eclipse.ui.internal.actions.NewWizardShortcutAction.run (NewWizardShortcutAction.java:133)
в org.eclipse.jface.action.Action.runWithEvent (Action.java:473) в
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:565)
в
org.eclipse.jface.action.ActionContributionItem.lambda $ 4 (ActionContributionItem.java:397)
в org.eclipse.swt.widgets.EventTable.sendEvent (EventTable.java:86)
в org.eclipse.swt.widgets.Display.sendEvent (Display.java:5686) в
org.eclipse.swt.widgets.Widget.sendEvent (Widget.java:1370) в
org.eclipse.swt.widgets.Display.runDeferredEvents (Display.java:4940)
в org.eclipse.swt.widgets.Display.readAndDispatch (Display.java:4518)
в
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine $ 5.run (PartRenderingEngine.java:1170)
в
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:336)
в
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run (PartRenderingEngine.java:1059)
в
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI (E4Workbench.java:153)
в org.eclipse.ui.internal.Workbench.lambda $ 3 (Workbench.java:667) в
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:336)
в
org.eclipse.ui.internal.Workbench.createAndRunWorkbench (Workbench.java:597)
в
org.eclipse.ui.PlatformUI.createAndRunWorkbench (PlatformUI.java:148)
в
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:152)
в
org.eclipse.equinox.internal.app.EclipseAppHandle.run (EclipseAppHandle.java:196)
в
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication (EclipseAppLauncher.java:134)
в
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start (EclipseAppLauncher.java:104)
в
org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:388)
в
org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:243)
в sun.reflect.NativeMethodAccessorImpl.invoke0 (собственный метод) в
sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
в
sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
в java.lang.reflect.Method.invoke (Method.java:498) в
org.eclipse.equinox.launcher.Main.invokeFramework (Main.java:656) в
org.eclipse.equinox.launcher.Main.basicRun (Main.java:592) в
org.eclipse.equinox.launcher.Main.run (Main.java:1498) в
org.eclipse.equinox.launcher.Main.main (Main.java:1471) Причина:
org.hibernate.HibernateException: доступ к DialectResolutionInfo
не может быть нулевым, когда «hibernate.dialect» не установлен в
org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect (DialectFactoryImpl.java:100)
вorg.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect (DialectFactoryImpl.java:54)
в
org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService (JdbcEnvironmentInitiator.java:137)
в
org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService (JdbcEnvironmentInitiator.java:35)
в
org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService (StandardServiceRegistryImpl.java:94)
в
org.hibernate.service.internal.AbstractServiceRegistryImpl.createService (AbstractServiceRegistryImpl.java:263)
... еще 73
public class HibernateUtils {
private static SessionFactory sessionFactory;
static {
try {
StandardServiceRegistry standardRegistry =
new StandardServiceRegistryBuilder().configure("hibernate.cfg.xml").build();
Metadata metaData =
new MetadataSources(standardRegistry).getMetadataBuilder().build();
sessionFactory = metaData.getSessionFactoryBuilder().build();
} catch (Throwable th) {
System.err.println("Enitial SessionFactory creation failed" + th);
throw new ExceptionInInitializerError(th);
}
}
}