当调试命中断点时,Eclipse Luna给出NullPointerException [英] Eclipse Luna gives NullPointerException when debugging hits a breakpoint

查看:479
本文介绍了当调试命中断点时,Eclipse Luna给出NullPointerException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我在我的代码中点击一个断点时,我会看到一个讨厌的对话框,通知我透视切换工作遇到问题,其细节只是说NullPointerException。错误日志显示此堆栈跟踪:

Whenever I hit a breakpoint in my code, I see an obnoxious dialog informing me that "Perspective switch job has encountered a problem", the details of which simply say "NullPointerException". The error log shows this stack trace:

java.lang.NullPointerException
    at org.eclipse.ui.internal.WorkbenchPage.showPart(WorkbenchPage.java:1298)
    at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1269)
    at org.eclipse.ui.internal.WorkbenchPage$13.run(WorkbenchPage.java:4144)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:4140)
    at org.eclipse.debug.internal.ui.views.ViewContextService.showViewQuiet(ViewContextService.java:1168)
    at org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager$4.runInUIThread(PerspectiveManager.java:528)
    at org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager$MyUIJob$1.run(PerspectiveManager.java:229)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764)
    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:382)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
    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)

我通过将调试视图设置为无,通过选项/运行/调试/透视图尝试禁用透视切换(我不想要)

I've tried disabling perspective switching (which I don't want anyway) via Options / Run/Debug / Perspectives by setting the "Debug" perspective to "None", but it keeps getting reset to "Debug", and does not change this behavior.

这是非常烦人的,使调试几乎不可用。

This is extremely annoying, making debugging nearly unusable.

我尝试添加-clean到eclipse.ini,如这里所建议的 Myeclipse在调试服务器时会抛出一些错误,但是也没有影响。

I tried adding -clean to eclipse.ini, as suggested here Myeclipse is throwing some error when i debug server ... but that had no impact, either.

想法?

推荐答案

我在Eclipse Mars中遇到了同样的问题(这可能是一个错误)。达到的每个断点都会打开您所描述的错误对话框。

I have encountered the same problem (which is likely a bug) in Eclipse Mars. Every breakpoint reached opens the error dialog you described.

我可以通过更新以下首选项(也存在于Luna中)来防止错误:

I was able to prevent the error by updating the following preferences (which are also present in Luna):


  1. 转到窗口> 首选项

  2. 左,转到运行/调试> 透视

  3. 在应用程序类型/启动器列表中,选择您正在调试的应用程序类型。

  4. 模式/透视图的右侧,确保选择了

  1. Go to Window > Preferences
  2. On the left, go to Run/Debug > Perspectives
  3. In the Application Types/Launchers list, select the type of application that you are debugging.
  4. On the right under Modes/Perspectives, make sure that None is selected for the Debug dropdown.

注意:我无法找到任何设置完全禁用所有应用程序类型的透视切换,因此您必须为调试的每种类型执行此操作。

Note: I was unable to find any setting that completely disables the perspective switch for all application types, so you'll have to do this for each type you debug.

这篇关于当调试命中断点时,Eclipse Luna给出NullPointerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆