1 Reply Latest reply on May 12, 2010 5:56 PM by Rose Kad

    how to load property file outside of the webapplication in Jboss server?

    Rose Kad Newbie

      I created a property file and placed it inside a jar file and changed the classpath of the jboss server. (opened run.bat and set CLASSPATH variable)

      I could able to see the updated classpath when I do run --help at command prompt.

       

      the JBOSS CLASSPATH contains:jboss_home\bin\run.jar;custom_jar_home\serverconfig.jar

       

      From my web application I did like this.

      ClassLoader.getSystemClassLoader().getResource("serverconfig.properties").getPath()

        • 1. Re: how to load property file outside of the webapplication in Jboss server?
          Rose Kad Newbie

          continue...

           

           

          it is throwing null pointer exception...

           

          but when i do the following it is working

           

          System.out.println(ClassLoader.getSystemClassLoader().getResource("log4j-debug.properties").getPath());

           

          where log4j-debug.properties is inside the run.jar

           

          Similary  I tried with ResourceBundle. It is working for the props inside the run.jar file only.

           

          At present I am placing the properties file inside the /server/conf/ folder and changed the property-server.xml and getting the properties using System.getProperty("");

           

          But my question is why the property file inside the run.jar is available but not the property file from the custom lib.

           

          Any help is greatly appreciated.

           

          Regards,

          Rose.