Bug 49249 - scrapbook execution fails on finding a resource file's url
Summary: scrapbook execution fails on finding a resource file's url
Status: RESOLVED DUPLICATE of bug 8907
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.1.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-21 13:55 EST by Mitchell Cope CLA
Modified: 2003-12-23 08:42 EST (History)
0 users

See Also:


Attachments

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