Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316190 - NPE from remote java script launch delegate
Summary: NPE from remote java script launch delegate
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: Debug (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Michael Rennie CLA
QA Contact: Simon Kaegi CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-08 14:53 EDT by Curtis Windatt CLA
Modified: 2010-06-09 11:46 EDT (History)
1 user (show)

See Also:


Attachments
fix (951 bytes, patch)
2010-06-09 11:05 EDT, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2010-06-08 14:53:59 EDT
Not sure why my vm has no name, but the method is spec'd that is can return null.

eclipse.buildId=I20100530-0800
java.version=1.6.0_18
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_CA
Framework arguments:  -product org.eclipse.sdk.ide -showlocation
Command-line arguments:  -product org.eclipse.sdk.ide -data /home/cwindatt/WS/Workspace Target -dev file:/home/cwindatt/WS/Workspace/.metadata/.plugins/org.eclipse.pde.core/Target/dev.properties -os linux -ws gtk -arch x86 -consoleLog -console -showlocation


Error
Tue Jun 08 13:52:16 CDT 2010
An internal error occurred during: "Launching New_configuration (16)".

java.lang.NullPointerException
	at org.eclipse.wst.jsdt.debug.internal.core.launching.RemoteJavaScriptLaunchDelegate.launch(RemoteJavaScriptLaunchDelegate.java:76)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:923)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1126)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Curtis Windatt CLA 2010-06-08 16:51:59 EDT
I wasn't paying attention, the name isn't null, the vm is.  There should probably be a null check with a more descriptive error sent.  If the connector fails to establish a connection to the crossfire extension it may return null instead of throwing an IOException.  That could be a bug in the connector.

To make it a little better experience for me I added the following to RemoteJavaScriptLaunchDelegate just before the JavaScriptDebugTarget is created.

	if (vm == null){
			Status status = new Status(IStatus.ERROR, JavaScriptDebugPlugin.PLUGIN_ID, "Connection with the vm could not be established"); //$NON-NLS-1$
			throw new CoreException(status);
		}
Comment 2 Michael Rennie CLA 2010-06-09 11:05:54 EDT
Created attachment 171537 [details]
fix

The underlying problem was that I did not respect my own API doc :)
In the Crossfire connector I was catching an IOException and returning null, when I should have been re-throwing the exception
Comment 3 Curtis Windatt CLA 2010-06-09 11:12:41 EDT
I updated the patch on bug 312844 to include a fix to avoid the two cases where the connector could return null.
Comment 4 Michael Rennie CLA 2010-06-09 11:46:12 EDT
applied patch to HEAD (to the crossfire dev bundle) - also throws an IOException for trying to auto-launch browser not on localhost.