3 Replies Latest reply on Oct 15, 2004 1:45 PM by Mark LaPolla

    JBoss4 ContextClassLoader

    bhalli Newbie

      Seeminlgy Thread.currentThread().getContextClassLoader().getResource(".") in jboss4 yields "${JBOSS_HOME}/server/default/conf/".
      Any thoughts on how to access resource files located inside .ear or .jar .war or .sar deploys.

        • 1. Re: JBoss4 ContextClassLoader
          Mark LaPolla Newbie

          I would like to know the answer to this. I ported some Java ClassLoader code from a web application into my ejb module and though I could look up the resource in my jar, I could not manipulate the path or load the resource.

          I am interested in this answer. What I am going to try next is to


          After packaging my resources directory into my ejb.jar.

          Any help on this will be greatly appreciated.

          Thank you.

          • 2. Re: JBoss4 ContextClassLoader
            Mark LaPolla Newbie

            I have some observations and I'd like to know what's going on here. If I call the following:


            I get this path:

            If I call an actual resource name:

            I get the path to my ejb jar.


            • 3. Re: JBoss4 ContextClassLoader
              Mark LaPolla Newbie

              Pardon me, I'm using JBoss 4.0 with IntelliJ 4.5 and I am calling the getResource from my SessionBean. I am deploying in an .ear wtih a ejb module and a web module.

              Sorry about the lack of context.