Bug 385151

Summary: New Launch Configuration is not created for a Project on run.
Product: [Eclipse Project] Platform Reporter: Guruprasad GV <ggv>
Component: DebugAssignee: Platform-Debug-Inbox <platform-debug-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: minor    
Priority: P3 CC: Michael_Rennie
Version: 4.2Keywords: usability
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Guruprasad GV CLA 2012-07-16 04:43:28 EDT
Build Identifier: 

When there is an empty launch config and you run a project (without a launch config) the launch config is not created automatically (which would be created if the empty launch config was not present in the first place.

Reproducible: Always

Steps to Reproduce:
1.Have empty workspace
2.Go to debug configurations
3.Double click on "Java Application"
4. Close the launch config window
5. Create a java project with a main class.
6. Select the project and Click on the debug icon in menu bar.
------------

-- the new launch config for that java project should have been created but it does not.
Comment 1 Michael Rennie CLA 2012-10-10 17:05:11 EDT
Using your steps I get the following exception:

java.lang.NoClassDefFoundError: 
Caused by: java.lang.ClassNotFoundException: 
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

This is because of the logic in our context runner when looking for matching configurations. We find the config with no resource mappings (the empty one) which implies it can apply to the current launch because (1) it is the same launch type (2) it applies to all resources (no mappings).

This is working as designed for this launch type because a Java Application launch is always associated with resources in its non-error state, creating empty configurations and trying to launch with them is not supported.