I ran into a very strange problem, I hope you can help me: I run the following line:
InputStream stream = this.getClass().getClassLoader().getResourceAsStream(SOME_PATH);
And it works. Then I create a new classloader that points to the same file, and then
this.getClass().getClassLoader().getResourceAsStream(SOME_PATH)
returns null.
When I debug it, I saw that
this.getClass().getClassLoader().getResource(SOME_PATH)
returns a valid URL object.
So, I am debugging getResourceAsStream and see that it calls getResource, and when it tries to open steam - it does not work in FileNotFoundException.
I have no idea how to solve it. The stream is properly closed.
Is anyone
source share