3 Replies Latest reply on Aug 20, 2003 3:40 AM by dinesh_soma

    getResourceAsStream() from jar in lib folder failing

    dinesh_soma Newbie

      I have a 'ear' file that contains an ejb module that's been deployed to the server/default/deploy folder. I've also deployed another jar (called ptserver.jar) into the server/default/lib folder. The ejb module accesses some of the classes in the ptserver.jar. The ptserver.jar contains some '.properties' files at the top level.

      When a method is invoked in a deployed ejb, it calls down to a class in the ptserver.jar. When a class in ptserver.jar is invoked, it uses getResourceAsStream() to load up a '.properties' file contained in that jar. However, this seems to return null always even if the property file exists in the ptserver.jar. To load the property files, I use <class in ptserver.jar>.getClass().getClassLoader().getResourceAsStream(). I've also used Thread.currentThread().getContextClassLoader(). Doesn't seem to work either.

      What am I doing wrong ? I can't see it. Any help would be appreciated.