使用hibernate工具创建映射文件时出现NullPointerException

时间:2014-12-24 02:17:29

标签: eclipse hibernate hibernate-tools

我正在使用hibernate工具创建映射文件,但是一旦我选择了类,当我进入下一步时,我在eclipse中收到此错误

  

从插件调用代码时出现问题:   “org.eclipse.jface”。

     

栈跟踪

java.lang.NullPointerException
    at org.hibernate.eclipse.jdt.ui.wizards.ConfigurationActor.getService(ConfigurationActor.java:127)
    at org.hibernate.eclipse.jdt.ui.wizards.ConfigurationActor.createConfiguration(ConfigurationActor.java:134)
    at org.hibernate.eclipse.jdt.ui.wizards.ConfigurationActor.createConfigurations(ConfigurationActor.java:117)
    at org.hibernate.eclipse.jdt.ui.wizards.NewHibernateMappingFileWizard.createConfigurations(NewHibernateMappingFileWizard.java:573)
    at org.hibernate.eclipse.jdt.ui.wizards.NewHibernateMappingFileWizard.getPlaces2Gen(NewHibernateMappingFileWizard.java:330)
    at org.hibernate.eclipse.jdt.ui.wizards.NewHibernateMappingFileWizard.handlePageChanging(NewHibernateMappingFileWizard.java:171)
    at org.eclipse.jface.wizard.WizardDialog$10.run(WizardDialog.java:1643)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:178)
    at org.eclipse.jface.wizard.WizardDialog.firePageChanging(WizardDialog.java:1640)
    at org.eclipse.jface.wizard.WizardDialog.doPageChanging(WizardDialog.java:956)
    at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:1246)
    at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:942)
    at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:434)
    at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:619)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:832)
    at org.eclipse.jface.window.Window.open(Window.java:808)
    at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:136)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:519)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
    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:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    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:648)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
  

会话数据

eclipse.buildId=4.4.1.M20140925-0400
java.version=1.7.0_72
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US

1 个答案:

答案 0 :(得分:0)

使用Luna和JBoss Tools 4.2时,我遇到了同样的问题。我想这是JBoss Tools 4.2中的一个错误。因此有两种解决方案:

  1. 使用Eclipse Kepler及其相应的JBoss Tools。
  2. 使用Luna和JBoss Tools 4.1。
  3. 要么工作。