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?
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.
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.