本文介绍了Eclipse重构失败->不断抛出异常!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Eclipse Helios,对于跨越多个文件的每次重构,它显然都会失败!没发生什么事.在检查日志时,这是我看到的错误:

I'm using Eclipse Helios and for every refactoring that spans multiple files it plainly fails! Nothing happens. On examining the logs here's the error that I see:

!ENTRY org.eclipse.ltk.ui.refactoring 4 10000 2011-03-13 14:15:31.842
!MESSAGE Internal Error
!STACK 0

java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:330)
at org.eclipse.ltk.ui.refactoring.RefactoringWizard.internalPerformFinish(RefactoringWizard.java:573)
at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.performFinish(UserInputWizardPage.java:153)
at org.eclipse.jdt.internal.ui.refactoring.reorg.RenameTypeWizardInputPage.performFinish(RenameTypeWizardInputPage.java:144)
at org.eclipse.ltk.ui.refactoring.RefactoringWizard.performFinish(RefactoringWizard.java:646)
at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.okPressed(RefactoringWizardDialog2.java:454)
at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:472)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:180)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:192)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:115)
at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:38)
at org.eclipse.jdt.internal.ui.refactoring.UserInterfaceStarter.activate(UserInterfaceStarter.java:62)
at org.eclipse.jdt.internal.ui.refactoring.reorg.RenameUserInterfaceStarter.activate(RenameUserInterfaceStarter.java:31)
at org.eclipse.jdt.ui.refactoring.RenameSupport.openDialog(RenameSupport.java:159)
at org.eclipse.jdt.ui.refactoring.RenameSupport.openDialog(RenameSupport.java:116)
at org.eclipse.jdt.internal.corext.refactoring.RefactoringExecutionStarter.startRenameRefactoring(RefactoringExecutionStarter.java:438)
at org.eclipse.jdt.internal.ui.refactoring.actions.RenameJavaElementAction.run(RenameJavaElementAction.java:203)
at org.eclipse.jdt.internal.ui.refactoring.actions.RenameJavaElementAction.run(RenameJavaElementAction.java:101)
at org.eclipse.jdt.ui.actions.RenameAction.run(RenameAction.java:108)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
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:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
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:369)
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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jst/jsp/core/internal/java/search/JSPIndexManager
at org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport.searchRunnable(JSPSearchSupport.java:424)
at org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport.searchRunnable(JSPSearchSupport.java:349)
at org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant.createChangesFor(JSPRenameParticipant.java:215)
at org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant.createChange(JSPRenameParticipant.java:153)
at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.createChange(ProcessorBasedRefactoring.java:308)
at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:124)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:209)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Root exception:
java.lang.NoClassDefFoundError: org/eclipse/jst/jsp/core/internal/java/search/JSPIndexManager
at org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport.searchRunnable(JSPSearchSupport.java:424)
at org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport.searchRunnable(JSPSearchSupport.java:349)
at org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant.createChangesFor(JSPRenameParticipant.java:215)
at org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant.createChange(JSPRenameParticipant.java:153)
at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.createChange(ProcessorBasedRefactoring.java:308)
at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:124)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:209)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

对于我来说,能够浏览甚至尝试"修复此错误对我来说意义不大.对于文件/方法本地"的重构,它似乎可以正常工作.我试过弄清楚这个,但真是吓死了!我倾向于使用重构功能A LOT.我正在使用J2EE + Glassfish v3.在构建路径上,我有用于freemarker,restlet和DBUtils的JAR.

This error doesn't make much sense for me to be able to navigate around and even 'try' fixing it. For refactorings that are 'local' to the file/methods it seems to work fine. I've tried figuring this one out but just aghast! I tend to use the refactor feature A LOT. I'm working with J2EE + Glassfish v3. I have JARs for freemarker, restlet and that for DBUtils on the build path.

有什么想法吗?有没有人遇到(并解决过:)这个问题?

Any ideas? Has anyone encountered (and fixed :) this problem??

提前谢谢!

推荐答案

由于我只有2个插件,因此很容易找出问题所在.看来JBoss和Glassfish插件之间存在依赖冲突(例如更新之类).删除JBoss插件(帮助> Eclipse MarketPlace>已安装-选择一个插件,单击卸载",然后选择其中的所有组件,然后单击下一步/完成).

Since I only had 2 plugins it was easy to figure out the problem. It seems there is a dependency conflict between JBoss and Glassfish Plugins (says so on update). Removing the JBoss Plugin (Help > Eclipse MarketPlace > Installed - select a plugin, click 'uninstall' and select all the components in it and click Next/Finish).

这似乎可以解决重构问题,而无需重新安装.感谢user654801指出它是一个插件问题.否则很难确定它!

That seemed to fix the refactoring without reinstalling. Thanks to user654801 for pointing it out as a plug-in issue. It'd have been difficult to nail it down otherwise!

这篇关于Eclipse重构失败->不断抛出异常!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 07:38