Bug 385151 - New Launch Configuration is not created for a Project on run.
Summary: New Launch Configuration is not created for a Project on run.
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2012-07-16 04:43 EDT by Guruprasad GV CLA
Modified: 2012-10-10 17:05 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.