Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

The properties service (configured in properties-service.xml) in JBoss application server lets you specify external .properties files that are loaded and can then be accessed as system properties from the deployed applications.

(See here http://community.jboss.org/wiki/PropertiesService for more info...)

Is it also possible to load config files in the .xml format instead of .properties?

I know it is possible for certain given configs like for example the mail-service.xml and the jboss-log4j.xml... But they are both loaded directly by JBoss, and not via the properties service.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

This might be possible. The PropertieServices uses the java.util.Properties class, which contains a loadFromXml method. Perhaps you could extend the properties service? Here is some additional info: http://www.webreference.com/programming/Globalize-Web-Applications15_Java6/

Here is some more detailed information on how the SystemProperties service works: http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch10.html

As you may know, you can use either name=value pairs in a .properties file, or a comma-separated list of URL strings in the service descriptor.

Why do you want to use a .xml file instead of .properties?

share|improve this answer
    
.xml files allow for a more detailed (and hierarchical) organization of properties. And as there are no application specific properties in JBoss, only global ones, a good organization is key to avoid a huge mess in the properties. (Think of a JBoss with some dozen deployed applications...) –  fgysin Oct 15 '10 at 8:09
    
Manually extending/writing property loaders isn't really an option. Accessing properties files on the filesystem from JBoss deployed applications is both messy and ugly. –  fgysin Oct 15 '10 at 8:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.