Bug 49249

Summary: scrapbook execution fails on finding a resource file's url
Product: [Eclipse Project] JDT Reporter: Mitchell Cope <mcope-ebay7318>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Mitchell Cope CLA 2003-12-21 13:55:46 EST
When I use the scrapbook to execute some program code that needs to retrieve a 
resource through a ClassLoader, the ClassLoader fails to find the url for the 
resource.

This is the line which fails:
URL url = classLoader.getResource(resource);
(where resource is a string like "com/antelmann/resource/properties").

Executing the same code through using Run or Debug, the url is found and the 
resource file is obtained for getting properties off of the resource, a flat 
file containing some properties.
Comment 1 Darin Wright CLA 2003-12-22 11:53:00 EST
Retrieving resources is performed relative to the working directory. You can 
set the working directory on the "Scrapbook Runtime" properties of a scrapbook 
file (i.e. context menu: "Properties -> Scrapbook Runtime").
Comment 2 Mitchell Cope CLA 2003-12-23 08:42:28 EST
According to the release notes

http://www.eclipse.org/eclipse/development/readme_eclipse_2_1_2.html#I-Platform-
Core

this is a known issue related to problems with classloaders in created threads. 
Applying the given suggestion worked for my scrapbook page.

*** This bug has been marked as a duplicate of 8907 ***