ClassLoader.getSystemResourceAsStream() does not work as expected [message #297907] |
Sun, 22 January 2006 12:05  |
Eclipse User |
|
|
|
Originally posted by: stefanuhrig.gmx.net
Hi,
I'm developing an RCP-application that depends on third-party libraries (JAR-archives).
I've packaged all necessary .jar-archives into a separate plug-in that I created by using the "Plug-in from existing JAR archives"
wizard. Afterwards I made my RCP-application dependent on this plug-in.
I can access and use all the classes inside the JAR archives, it works fine. However, one of the libraries uses
ClassLoader.getSystemResourceAsStream() to access a file inside its archive. This attempt fails and returns null (although it works
when the library is not used inside the plug-in).
Has anyone an idea why this fails and how to get it working, so that the library can access its file?
Thanks in advance,
Stefan
|
|
|
|
|
|
Re: ClassLoader.getSystemResourceAsStream() does not work as expected [message #297954 is a reply to message #297907] |
Mon, 23 January 2006 09:35  |
Eclipse User |
|
|
|
Stefan Uhrig wrote:
> Hi,
>
> I'm developing an RCP-application that depends on third-party libraries
> (JAR-archives).
>
> I've packaged all necessary .jar-archives into a separate plug-in that I
> created by using the "Plug-in from existing JAR archives" wizard.
> Afterwards I made my RCP-application dependent on this plug-in.
>
> I can access and use all the classes inside the JAR archives, it works
> fine. However, one of the libraries uses
> ClassLoader.getSystemResourceAsStream() to access a file inside its
> archive. This attempt fails and returns null (although it works when the
> library is not used inside the plug-in).
One of the libraries uses ClassLoader#getSystemResourceAsStream() to
access a file inside the library? Or inside your plugin?
Like the other mentioned, it sounds like a bad use of the system class
loader. Why don't more people use
getClass().getClassLoader().getResourceAsStream(*)?
Later,
PW
|
|
|
Powered by
FUDForum. Page generated in 0.07955 seconds