2013-10-23 74 views
1

首先,我在GitHub中創建了一個項目,使用Egit將其導入到Eclipse(kepler)中,並將其作爲JavaScript項目(使用標準JavaScript插件)。我在這個項目中工作沒有問題。我將完整的項目(包括.project文件等)推送到GitHub中。Eclipse:創建新的JavaScript文件錯誤

現在,當我將該項目導入另一臺計算機時,事情變得很奇怪。我用Egit從GitHub倉庫導入它。然後我使用導入作爲現有的項目,因爲我上傳了所有的項目文件。現在,這工作很好,所有,直到我想創建一個新的JavaScript文件。

當我這樣做時,新建一個新的JavaScript文件。窗口apears,但是當我輸入一個名稱時,完成按鈕保持禁用狀態。此外,當我點擊父文件夾我得到一個空指針異常的一個:

enter image description here

誰能告訴我,我做錯了什麼嗎?這是一個錯誤?我不能只在其他PC上導入其他項目嗎?或者是git出了問題?

以下是錯誤日誌:「org.eclipse.jface」:從插件調用代碼時發生

問題。

java.lang.NullPointerException 
    at org.eclipse.wst.jsdt.internal.ui.wizards.NewJSFileWizardPage.validatePage(NewJSFileWizardPage.java:122) 
    at org.eclipse.ui.dialogs.WizardNewFileCreationPage.handleEvent(WizardNewFileCreationPage.java:676) 
    at org.eclipse.ui.internal.ide.misc.ResourceAndContainerGroup.handleEvent(ResourceAndContainerGroup.java:367) 
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) 
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057) 
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1081) 
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062) 
    at org.eclipse.swt.widgets.Text.wmCommandChild(Text.java:2974) 
    at org.eclipse.swt.widgets.Control.WM_COMMAND(Control.java:4752) 
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4614) 
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4977) 
    at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method) 
    at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2443) 
    at org.eclipse.swt.widgets.Text.callWindowProc(Text.java:260) 
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706) 
    at org.eclipse.swt.widgets.Text.windowProc(Text.java:2597) 
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4977) 
    at org.eclipse.swt.internal.win32.OS.SetWindowTextW(Native Method) 
    at org.eclipse.swt.internal.win32.OS.SetWindowText(OS.java:3473) 
    at org.eclipse.swt.widgets.Text.setText(Text.java:2252) 
    at org.eclipse.ui.internal.ide.misc.ContainerSelectionGroup.containerSelectionChanged(ContainerSelectionGroup.java:190) 
    at org.eclipse.ui.internal.ide.misc.ContainerSelectionGroup$1.selectionChanged(ContainerSelectionGroup.java:276) 
    at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:164) 
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) 
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) 
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) 
    at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:162) 
    at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2188) 
    at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1211) 
    at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1241) 
    at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:239) 
    at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:233) 
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:403) 
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) 
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057) 
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170) 
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) 
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:826) 
    at org.eclipse.jface.window.Window.open(Window.java:802) 
    at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:135) 
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) 
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) 
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) 
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) 
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) 
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057) 
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170) 
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) 
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113) 
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) 
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997) 
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138) 
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610) 
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) 
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567) 
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) 
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124) 
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) 
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181) 
    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:636) 
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591) 
    at org.eclipse.equinox.launcher.Main.run(Main.java:1450) 
    at org.eclipse.equinox.launcher.Main.main(Main.java:1426) 
+0

查看工作區.metadata目錄中的.log文件以獲取有關錯誤的更多詳細信息(或嘗試錯誤日誌視圖)。 –

+0

- 將日誌文件編輯到問題中。不幸的是幾乎不可讀。 – David

+0

啊,新的信息已經被髮​​現:如果我從一個現有的源代碼創建一個Javascript項目(所以沒有任何github/git的東西)。我也有同樣的問題 – David

回答

0

當我採取的下一步驟不會發生此問題:

  • 進口使用Git項目(項目文件除外)
  • 添加項目作爲一般項目
  • 轉換它到一個JavaScript項目。

這已經解決了我的問題,但我仍然想回答有關我的其他方法做錯了什麼。

Greets,David