Eclipse stuck for search dialog box

蓝咒 提交于 2019-12-23 17:43:53

问题


My project is named MyProject, and I got the following error popping up when I press Ctrl + H in eclipse to search my project:

Search Dialog Problem
  An error occurred while creating the search page "Java Search"
  Reason:
  MyProject does not exist

When I look at the log, I find the following:

!ENTRY org.eclipse.search 4 1 2013-09-03 14:58:19.272
!MESSAGE Internal Error
!STACK 1
Java Model Exception: Java Model Status [MyProject does not exist]
    at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:505)
    at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:246)
    at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:504)
    at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:240)
    at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:504)
    at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:240)
    at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:504)
    at org.eclipse.jdt.internal.core.CompilationUnit.openAncestors(CompilationUnit.java:1170)
    at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:240)
    at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:518)
    at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:255)
    at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:241)
    at scala.tools.eclipse.javaelements.LazyToplevelClass.mirror$lzycompute(ScalaElements.scala:302)
    at scala.tools.eclipse.javaelements.LazyToplevelClass.mirror(ScalaElements.scala:300)
    at scala.tools.eclipse.javaelements.LazyToplevelClass.exists(ScalaElements.scala:314)
    at org.eclipse.jdt.internal.ui.search.JavaSearchPage$SearchPatternData.create(JavaSearchPage.java:189)
    at org.eclipse.jdt.internal.ui.search.JavaSearchPage.readConfiguration(JavaSearchPage.java:1112)
    at org.eclipse.jdt.internal.ui.search.JavaSearchPage.createControl(JavaSearchPage.java:518)
    at org.eclipse.search.internal.ui.SearchDialog$9.run(SearchDialog.java:710)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.search.internal.ui.SearchDialog$8.run(SearchDialog.java:705)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.search.internal.ui.SearchDialog.createPageControl(SearchDialog.java:703)
    at org.eclipse.search.internal.ui.SearchDialog.createPageArea(SearchDialog.java:418)
    at org.eclipse.search.internal.ui.util.ExtendedDialogWindow.createDialogArea(ExtendedDialogWindow.java:140)
    at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:760)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
    at org.eclipse.search.internal.ui.SearchDialog.create(SearchDialog.java:281)
    at org.eclipse.jface.window.Window.open(Window.java:790)
    at org.eclipse.search.internal.ui.OpenSearchDialogAction.run(OpenSearchDialogAction.java:54)
    at org.eclipse.search.internal.ui.OpenSearchDialogAction.run(OpenSearchDialogAction.java:45)
    at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy.execute(ActionDelegateHandlerProxy.java:289)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
    at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
    at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
    at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
    at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
    at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
    at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
    at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
    at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1104)
    at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100)
    at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1509)
    at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4640)
    at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4528)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)
    at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2531)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    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:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
!SUBENTRY 1 org.eclipse.jdt.core 4 969 2013-09-03 14:58:19.272
!MESSAGE MyProject does not exist

Of course, I tried to delete my project on eclipse, then importing it again, but it did not solve the case. Even worse, all other projects have the same error, referring to that project, even if it is not in the workspace anymore.

Any idea where it comes from ?


回答1:


Eclipse got into this state when I performed git commands in the command-line. (Switching branches or pulling changes.) I think it's some interaction with Scala-IDE.

Usually the find dialog would just not appear. However if it did appear the Java panel would be blank, and when trying to close this modal dialog an exception fired from inside the event loop and the window refused to close.

The resolution for me was:

  1. Recreate the missing project mentioned in the error message.
  2. Try Find again, read the message. (Kill Eclipse if the Find dialog doesn't close.)
  3. Create an empty file in the place it was expecting it it step 2 (e.g. src/main/scala/com/example/MyFile.scala)

Then the problem went away and I could delete the dummy project again.



来源:https://stackoverflow.com/questions/18593141/eclipse-stuck-for-search-dialog-box

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!