2 Replies Latest reply on Feb 28, 2005 2:29 PM by holodok

    Load xml-file

    holodok

      I'va got an Mbean, which I want to load some properties from xml-file. But when I put the xml-file to the MBean sar directory, my Mbean cannot find it. How can I solve this?

        • 1. Re: Load xml-file
          dimitris

          Assuming you put your .xml file, e.g. in META-INF/ in you .sar, use

          Thread.currentThread().getContextClassLoader().getResourceAsStream("META-INF/my.xml");

          to get a reference to it.

          • 2. Re: Load xml-file
            holodok

            I did the following:
            Thread.currentThread().getContextClassLoader().getResource( "registry.xml" ).toString()

            and got the following path:
            file:/C:/jboss-3.2.3/bin/registry.xml

            It seems that it doesn't work. :(