Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ClassLoader.getSystemResource() can't find XML files?!?

807580Jan 25 2010 — edited May 21 2010
This has been working for over a year for me and today it's broken. I'm sure I must've changed something, but I have no idea what I did.

Suddenly, my app can't find XML files that are in its internal resources directory. It can find other files in the same directory.

My directory structure in my project is like this:
src
      com
      resources
The following code is how I'm checking it:

System.out.println(ClassLoader.getSystemResource("resources/foo.au"));
	System.out.println(ClassLoader.getSystemResource("resources/index.xml"));
Both files exist, but the test outputs the following:
file:/C:/myDir/Workspace/myProject/classes/core/BettingSchedules/foo.au
null
Did I set somehow set something to make it look elsewhere for xml files?!?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2010
Added on Jan 25 2010
14 comments
1,497 views