Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 374483 - [Compatibility] NPE while Debug is trying to switch perspectives with a dead perspective around
Summary: [Compatibility] NPE while Debug is trying to switch perspectives with a dead ...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: 4.2 M7   Edit
Assignee: Oleg Besedin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-16 08:34 EDT by Remy Suen CLA
Modified: 2012-05-01 13:44 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2012-03-16 08:34:32 EDT
I opened a workspace that seemed to have a perspective from another plug-in so it could not be rendered correctly. It was not the one I currently had opened and when I tried to debug something, Debug tried to switch perspectives for me but it failed with an NPE. Manually going 'Window > Open Perspective > Debug' worked though.

java.lang.NullPointerException
	at org.eclipse.ui.internal.Workbench.activate(Workbench.java:2535)
	at org.eclipse.ui.internal.Workbench.showPerspective(Workbench.java:2563)
	at org.eclipse.ui.internal.Workbench.showPerspective(Workbench.java:2528)
	at org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager.switchToPerspective(PerspectiveManager.java:316)
	at org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager$4.runInUIThread(PerspectiveManager.java:395)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95)
Comment 1 Remy Suen CLA 2012-03-16 13:47:44 EDT
The array returned by WorkbenchPage's getOpenedPerspectives() may contain null entries.
Comment 2 Claudio Nieder CLA 2012-03-18 18:12:02 EDT
The same happened to me, but I had the regular Java perspective open. Then started an application to be debugged (Debug As...) and got also an NPE.

eclipse.buildId=I20120315-1300
java.version=1.6.0_29
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -keyring /Users/claudio/.eclipse_keyring -showlocation
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -keyring /Users/claudio/.eclipse_keyring -showlocation

Error
Sun Mar 18 22:54:33 CET 2012
An internal error has occurred.

java.lang.NullPointerException
	at org.eclipse.ui.internal.Workbench.activate(Workbench.java:2535)
	at org.eclipse.ui.internal.Workbench.showPerspective(Workbench.java:2563)
	at org.eclipse.ui.internal.Workbench.showPerspective(Workbench.java:2528)
	at org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager.switchToPerspective(PerspectiveManager.java:316)
	at org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager$4.runInUIThread(PerspectiveManager.java:395)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3940)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3617)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1015)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:909)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:85)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:580)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:535)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	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:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	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:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
Comment 3 Eric Moffatt CLA 2012-04-04 11:13:20 EDT
Claudio, what did you debug your application 'as' ?

I'm just trying to figure out how to reproduce this (I've never seen it but I just launch regular configurations..
Comment 4 Remy Suen CLA 2012-04-04 11:16:56 EDT
You need to have a dead perspective from another plug-in that's no longer in your Eclipse installation.
Comment 5 Claudio Nieder CLA 2012-04-04 12:26:18 EDT
> Claudio, what did you debug your application 'as' ?

Must have been "Java Application".
Comment 6 Remy Suen CLA 2012-04-05 08:25:11 EDT
Kai mentioned this problem at the Eclipse 4 BOF at EclipseCon North America 2012. It's probably this bug.
Comment 8 Oleg Besedin CLA 2012-05-01 13:44:11 EDT
Verified using I20120430-1800.