You do not need to add these files to the same directory to make it work.
I got this symptom when I created a new Package and Source folder for running junit tests. Tests fail because getResourceAsStream returns null.
Here's how to fix it:
Right-click the class (in my case, the new junit test class) in the Project Explorer Explorer Eclipse view
Build Path → Configure Build Path → Java Build Path → Source Tab → Add Folder
Select the folder where your files are stored.
Ben L. Feb 28 '12 at 21:41 2012-02-28 21:41
source share