2017-03-06 323 views
1

我剛開始開發可以使用libreoffice擴展與libreoffice進行通信的桌面應用程序。未處理的事件循環異常和編輯器無法在LibreOffice擴展Java Eclipse項目中初始化

我試圖運行Github LibreOffice Extension Code Sample。 它顯示錯誤「編輯器無法初始化」並記錄在下面。

java.lang.NullPointerException 
at org.openoffice.ide.eclipse.core.editors.RegDocumentProvider.createDocument(RegDocumentProvider.java:98) 
at org.eclipse.ui.editors.text.FileDocumentProvider.createElementInfo(FileDocumentProvider.java:721) 
at org.eclipse.ui.texteditor.AbstractDocumentProvider.connect(AbstractDocumentProvider.java:392) 
at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4178) 
at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:229) 
at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetInput(AbstractDecoratedTextEditor.java:1466) 
at org.eclipse.ui.editors.text.TextEditor.doSetInput(TextEditor.java:150) 
at org.eclipse.ui.texteditor.AbstractTextEditor$5.run(AbstractTextEditor.java:3154) 
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:437) 
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:353) 
at org.eclipse.ui.internal.WorkbenchWindow$14.run(WorkbenchWindow.java:2184) 
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) 
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2180) 

它也顯示了一些U字母上的項目文件夾和D字母下面的藍色colors.rdb文件。那是什麼意思?

enter image description here

在運行低於這個項目它的示值誤差「未處理的事件循環異常」和錯誤日誌。

java.lang.NullPointerException 
at org.libreoffice.ide.eclipse.core.launch.office.OfficeLaunchShortcut.createDefaultLaunchConfiguration(Unknown Source) 
at org.libreoffice.ide.eclipse.core.launch.office.OfficeLaunchShortcut.launch(Unknown Source) 
at org.libreoffice.ide.eclipse.core.launch.office.OfficeLaunchShortcut.launch(Unknown Source) 
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:431) 
at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.runInternal(LaunchShortcutAction.java:85) 
at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.runWithEvent(LaunchShortcutAction.java:135) 
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:565) 
at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:397) 
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) 
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5227) 
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1340) 
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1366) 
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1349) 
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1134) 
at org.eclipse.jface.action.ActionContributionItem.lambda$8(ActionContributionItem.java:1258) 
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) 
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5227) 
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1340) 
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4561) 
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4151) 
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121) 
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) 
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022) 
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150) 
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693) 
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) 
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610) 
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148) 
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138) 
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(NativeMethodAccessorImpl.java:62) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:498) 
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673) 
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610) 
at org.eclipse.equinox.launcher.Main.run(Main.java:1519) 
at org.eclipse.equinox.launcher.Main.main(Main.java:1492) 

我嘗試使用File-> New-> Project-> OpenOffice-> Extension Project創建一些示例項目。下面仍然會收到相同的錯誤。 enter image description here

此外,我嘗試thisthis但仍然沒有積極的結果。

任何幫助將不勝感激。

謝謝

回答

1

錯誤是由於項目運行爲LibreOffice Extension。

爲了解決這個問題,我創建了一個名稱爲LibreOffice Application(而不是擴展名)的新配置。它現在順利運行。