Further info here - what I am looking for is something like the PropertiesService.xml but which can read xml formatted data.
And we are using JBoss 3.2
found any answers to your question? I'm looking for answers for the exact same question, and I must say I'm a bit puzzled about the lack of answers around here...
I have found the following system properties that will help you do what you ask.
Use System.getProperty("key"); to get the required property A second string paramater can be used to specify a default value if the key cannot be found or if it has no value e.g. System.getProperty("key", "Default return value"); jboss.server.base.url: file:/C:/Programs/JBoss/jboss-4.0.0/server/ jboss.home.dir: C:\Programs\JBoss\jboss-4.0.0\ jboss.server.config.url: file:/C:/Programs/JBoss/jboss-4.0.0/server/default/conf/ jboss.home.url: file:/C:/Programs/JBoss/jboss-4.0.0/ jboss.server.home.url: file:/C:/Programs/JBoss/jboss-4.0.0/jboss-4.0.0/server/default/ jboss.lib.url: file:/C:/Programs/JBoss/jboss-4.0.0/lib/ jboss.server.name: default jboss.server.data.dir: C:\Programs\JBoss\jboss-4.0.0\server\default\data
So you would use "jboss.server.config.url". Note that this is a URI.
Hope this is helpful to you.
Martin - thank you!
Are these documented somewhere in the JBoss docs?
Thanks again. Can someone from the JBoss team confirm whether there are any negative effects caused by dropping config files that are usec by applications, not by jboss itself, into the directory specified by the jboss.server.config.url property?
Is this an officially sanctioned practice?
I would assume that jboss only opens files it is looking for here, unlike the deploy directory, in which I know that jboss tries to open everything. But I'd like some confirmation of this.
Another option is to use HSQLDB. Set up a JNDI entry for your application-specific "properties" table to access the data from your application. You can populate the tables with regular SQL, of course. This may be overkill, depending on what you're doing, but it's pretty easy, since HSQLDB is integrated into JBoss.
Can you point me at some real documentation on HSQLDB? I know I've stared at the word in countless JBOSS startup logs without thinking about it. How robust a database is it, etc.? I'm in a position where I really SHOULD be accessing a database but we don't have access to one. If HSQLDB is any good, it could be the answer. But solid documentation on it withing the JBoss site is very sparse.