-
1. Re: getResourceAsStream() from jar in lib folder failing
raja05 Aug 19, 2003 8:40 AM (in response to dinesh_soma)Im assuming its because all the jars in teh lib directory are loaded by a different class loader than the ones in deploy. So when you call getClass().getClassLoader()....., its the classloader thats used in the deploy directory and not the one in the lib directory.
For experimenting, can you move the jar file to the deploy directory and see if it looks it up fine?
-Raj -
2. Re: getResourceAsStream() from jar in lib folder failing
dinesh_soma Aug 19, 2003 10:53 AM (in response to dinesh_soma)I just tried your suggestion but didn't work either. Kept on getting null as inputstream of getResourceAsStream() method. I basically deployed the 'ear' file and the ptserver.jar to the deploy folder. I hope that's what you meant.
I believe its not working for the same reason - I'm not getting hold of the classloader that actually loaded the ptserver.jar.
Dinesh -
3. Re: getResourceAsStream() from jar in lib folder failing
dinesh_soma Aug 20, 2003 3:40 AM (in response to dinesh_soma)Ok, I've found the problem. The call classLoader.getResource() works fine. It gives me the location of the property file in ptserver.jar. However, it seems that getResourceAsStream() always returns null. I don't quite understand why when getResource() finds it, getResourceAsStream() can't get an input stream to the resource.
Dinesh