-
1. Re: conf directory equivalent in JBoss 7?
wdfink Mar 13, 2012 6:33 AM (in response to viggo.navarsete)You might have a look to this thread.
I would pack such resources in a jar and add it to the module directory. For your app aou have to set a dependency.
-
2. Re: conf directory equivalent in JBoss 7?
viggo.navarsete Mar 13, 2012 6:43 AM (in response to wdfink)Thanks for input Wolf-Dieter!
The problem is that they discuss the problem, and actuallys states that it is a difference between the two mentioned configuration directories, but there is no solution to my problem there. They mention log4j.xml and datasources as two files, but they are "jboss specific" files, and have their new places in the new jboss. I'm talking about my own configuration files which I used to put in $JBOSS_HOME/server/<instance/conf directory, and read it with Thread.currentThread()......
This doesn't seem to work anymore in JBoss 7, and that's the problem I want to discuss in this thread. The configuration files I have are files that we use to change the configuration of our application, and it was very convenient to have configuration file that could be easily changed. If the files are put in a jar it will be more messy, and impossible to change.
-
3. Re: conf directory equivalent in JBoss 7?
guinotphil Mar 13, 2012 9:27 AM (in response to viggo.navarsete)I guess you should get rid of the current way you load such resources, because they are not meant to be on your application's class loader.
Why don't you add a property on your standalone.xml to the system path of the configuration, eg <property name="myapp.confdir" value="/etc/myapp"/>
And then, create your own ConfigurationLoader that can load a file like this:
InputStream getResourceAsStream( String filename ) {
return new File(new File(System.getProperty("myapp.confdir"), filename).getURI().getURL().openStream();
}
-
4. Re: conf directory equivalent in JBoss 7?
wdfink Mar 13, 2012 11:27 AM (in response to guinotphil)Just to notice, use of java.io.* inside of a JEE application is violating the spec.
I know it is used often but may have some side effects.
-
5. Re: conf directory equivalent in JBoss 7?
viggo.navarsete Mar 13, 2012 1:37 PM (in response to viggo.navarsete)Wolf-Dieter and guinotphil: Any best practises on how I should do it?