Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 335099

Summary: [tests] NPE at the end of the JUnit tests when running headless
Product: [Tools] CDT Reporter: Marc Khouzam <marc.khouzam>
Component: cdt-debug-dsf-gdbAssignee: Marc Khouzam <marc.khouzam>
Status: RESOLVED FIXED QA Contact: Marc Khouzam <marc.khouzam>
Severity: normal    
Priority: P3 CC: cdtdoug, pawel.1.piech
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Fix marc.khouzam: iplog-

Description Marc Khouzam CLA 2011-01-22 22:08:12 EST
Created attachment 187376 [details]
Fix

Once the JUnit tests are all run for DSF-GDB, I see the below exception.  I believe this is because I'm running the test as a headless application.

The attached patch checks for null.

org.osgi.framework.BundleException: Exception in org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin.stop() of bundle org.eclipse.cdt.dsf.gdb.ui.
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:791)
	at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:507)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.suspend(AbstractBundle.java:553)
	at org.eclipse.osgi.framework.internal.core.Framework.suspendBundle(Framework.java:1141)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.decFWSL(StartLevelManager.java:595)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:257)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.shutdown(StartLevelManager.java:215)
	at org.eclipse.osgi.framework.internal.core.InternalSystemBundle.suspend(InternalSystemBundle.java:284)
	at org.eclipse.osgi.framework.internal.core.Framework.shutdown(Framework.java:691)
	at org.eclipse.osgi.framework.internal.core.Framework.close(Framework.java:598)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.shutdown(EclipseStarter.java:415)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:198)
	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:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.NullPointerException
	at org.eclipse.cdt.dsf.gdb.internal.ui.console.TracingConsoleManager.getConsole(TracingConsoleManager.java:149)
	at org.eclipse.cdt.dsf.gdb.internal.ui.console.TracingConsoleManager.removeConsole(TracingConsoleManager.java:132)
	at org.eclipse.cdt.dsf.gdb.internal.ui.console.TracingConsoleManager.removeAllConsoles(TracingConsoleManager.java:82)
	at org.eclipse.cdt.dsf.gdb.internal.ui.console.TracingConsoleManager.shutdown(TracingConsoleManager.java:59)
	at org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin.stop(GdbUIPlugin.java:68)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:771)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:764)
	... 19 more
Comment 1 Marc Khouzam CLA 2011-01-22 22:09:56 EST
Committed to HEAD.
Comment 2 CDT Genie CLA 2011-01-22 22:23:04 EST
*** cdt cvs genie on behalf of mkhouzam ***
Bug 335099 - [tests] NPE at the end of the JUnit tests when running headless

[*] TracingConsoleManager.java 1.3 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/TracingConsoleManager.java?root=Tools_Project&r1=1.2&r2=1.3