-
1. Re: Inject Production Settings
norman Mar 19, 2008 4:57 PM (in response to tom_goring)Everything in Seam is read from the classpath, and server/default/conf is on your classpath. You can't reliably override your application's configuration files by duplicating them there, but you certainly can put some configuration files there.
Are you using seam-gen as the basis of your app? Seam-gen already has the notion of dev and prod profiles.
-
2. Re: Inject Production Settings
tom_goring Mar 19, 2008 7:21 PM (in response to tom_goring)Hi Norman,
Thanks for that.
I am using a seam-gen app started a couple of months ago.
I don't like the idea of rebuilding a ear because I want to deploy into production. I'm fine with the 'debug' vs 'non debug' versions though.
Basically I want to add a couple of settings that I know for sure will be set correctly in dev (like don't send emails, etc, etc).
Looks like I need to add a properties file in ../conf and then load that up in an Application scoped seam component. (this is kind of what I used todo in the old version of my app).
I was hoping that I could tell seam to load up properties from my.properties (located in ../conf) and allow seam to inject them onto my components as required?
-
3. Re: Inject Production Settings
cpopetz Mar 22, 2008 5:07 AM (in response to tom_goring)Another possibility, which we use to allow us to have a single ear run in multiple environments...start your production jboss instance(s) with -Dyour.property.name=foo and have the setter for the property in question check to see if System.getProperty("your.property.name") is non-null, and if it is, use that value and ignore what the setter was passed.
Ugly, but very flexible. We have scripts that set up multiple jboss nodes in clusters, and they know how to set these properties based on the target environment. It's much nicer than building and tracking multiple ears for each tuple of environmental differences (debug / qa / load testing / production / static-mirror / etc.)
In my spring days (shudder) we had a property override mechanism for doing exactly this, in a generic fashion for all properties. It would be nice to have the same in seam, i.e. something you could turn on in components.xml that would allow environment-variable overrides a la components.properties.
-
4. Re: Inject Production Settings
svadu Mar 22, 2008 2:57 PM (in response to tom_goring)There is server/<profile>/deploy/properties-service.xml which allows to specify proprties or location of property files. No need for -D then.
-
5. Re: Inject Production Settings
cpopetz Mar 22, 2008 3:41 PM (in response to tom_goring)
Siarhei Dudzin wrote on Mar 22, 2008 02:57 PM:
There is server/<profile>/deploy/properties-service.xml which allows to specify proprties or location of property files. No need for -D then.Cool, thanks for the tip. I wasn't aware of that service.