From: Clark M. <cpm...@ma...> - 2010-02-25 17:26:41
|
Pretty sure. I'm actually using an older branch of Wonder with this code right now, but I believe this fix originated on trunk rev. 9669. In looking at it again, I actually think I might have done it this way (touching ERXExtensions instead of just ERXConfigurationManager) so that I would get the log4j configuration extra-early in the app launch or something else out of ERXExtensions. Either way, for database configuration specifically, I know for sure that the behavior I was seeing is that when the connection dictionary swizzling happens, the properties for dbConnectURLGLOBAL and its friends weren't available by doing System.getProperties(). I might be able to look into this a bit more, but we've seen the same behavior in two completely separate code stacks, so I definitely know it works this way, and doing the initialization this way resolved the problem for me in both cases. Clark On 2010-02-25, at 9:06 AM, Mike Schrag wrote: > Are you sure? I'm not sure I believe this ... optional props should be loading in the fray of general properties loading, which is guaranteed to happen before you start doing database things. History has proven me wrong before, though :) > > Are you using trunk? > > ms > > On Feb 25, 2010, at 11:51 AM, Clark Mueller wrote: > >> The answer to this question is no. If you want the properties in an optional configuration file to be used for a database, you need to touch ERXExtensions very early in the launch process. The place where I've done this is actually in a static block in my application class: >> >> static { >> // We do this so that ERXConfigurationManager fires up all the properties early. >> try { >> Class.forName(ERXExtensions.class.getName()); >> } catch (ClassNotFoundException cnfe) {} >> } >> >> Not sure if you have to do it quite that early, but it's what seemed to work at the time. I'm also suddenly nervous looking at this, so you might be better off with something like: >> >> static { >> // Without this the blasted ERXLogger factory doesn't get initialized early enough. >> // When we move everything to use plain Loggers, we should revisit this initializer. - TC >> ERXConfigurationManager.defaultManager().initialize(); >> ERXLogger.configureLogging(System.getProperties()); >> } >> >> (which is what ERXExtensions actually does to initialize the properties, minus setting up its observer) >> >> Clark >> >> On 2010-02-25, at 8:45 AM, David Avendasora wrote: >> >>> I was hoping someone just might know off the top of their head. Oh well. I'll test it and get back. >>> >>> Dave >>> >>> On Feb 25, 2010, at 11:41 AM, Mike Schrag wrote: >>> >>>> it's faster to try it and tell us than to look at the code ... >>>> >>>> On Feb 25, 2010, at 11:34 AM, David Avendasora wrote: >>>> >>>>> Hi all, >>>>> >>>>> I have a very specific properties loading question: >>>>> >>>>> We are using the Properties.Username convention, and launching our application in Production using a username of Production. Included in the Properties.Production file is a link to another Property file that contains information we cannot store in SVN (DB Passwords and other sensitive info) using: >>>>> >>>>> er.extensions.ERXProperties.OptionalConfigurationFiles = (/path/to/PROD/DBPasswordsFile) >>>>> >>>>> My question is, will the properties set in that Optional Configuration File override the ones in Properties.Production? Is it dependent upon where in the property file the link is? >>>>> >>>>> Thanks! >>>>> >>>>> Dave >>>>> ------------------------------------------------------------------------------ >>>>> Download Intel® Parallel Studio Eval >>>>> Try the new software tools for yourself. Speed compiling, find bugs >>>>> proactively, and fine-tune applications for parallel performance. >>>>> See why Intel Parallel Studio got high marks during beta. >>>>> http://p.sf.net/sfu/intel-sw-dev_______________________________________________ >>>>> Wonder-disc mailing list >>>>> Won...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/wonder-disc >>>> >>> >>> ------------------------------------------------------------------------------ >>> Download Intel® Parallel Studio Eval >>> Try the new software tools for yourself. Speed compiling, find bugs >>> proactively, and fine-tune applications for parallel performance. >>> See why Intel Parallel Studio got high marks during beta. >>> http://p.sf.net/sfu/intel-sw-dev_______________________________________________ >>> Wonder-disc mailing list >>> Won...@li... >>> https://lists.sourceforge.net/lists/listinfo/wonder-disc >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev_______________________________________________ >> Wonder-disc mailing list >> Won...@li... >> https://lists.sourceforge.net/lists/listinfo/wonder-disc > |