Search code examples
javapropertiesjbossproperties-filejboss-eap-6

Loading properties file in jboss eap 6.3


I am new to jboss eap 6.3. I have to load a list of configuration parameters (properties file) into a cache in my application running on jboss eap 6.3.

I checked the developers guide from red hat but did not find anything specific.

Any pointers will help.

I have this method to load properties files but not sure how it is done on server start up:

public static void loadProperties(){

  InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("test.properties");
     try {
           properties = new Properties();
           properties.load(inputStream);
     } catch (IOException e) {
            e.printStackTrace();
     }
}

Solution

  • You can load your properties by keeping the property files in Module folder of server like :

    Module -> com -> appName -> configuration -> main (Keep Your property file in this folder sturcture over here) then create one module.xml and put the entry for that file in module.xml.

    after completing the above steps please provide the entry in deployment descriptor.xml file in inclusion(path from ur exporting the file).

    Restart the server.