Mailing List webobjects-dev@wocommunity.org Message #423
From: Samuel Pelletier <samuel@samkar.com>
Subject: Re: [WO-DEV] Maven: Properties not available until late in app startup sequence
Date: Mon, 13 Feb 2023 08:37:41 -0500
To: WebObjects & WOnder Development <webobjects-dev@wocommunity.org>
Hi Aaron,

I did a quick look at properties loading and I would try this before reading the property during your early initialization code:

ERXConfigurationManager.defaultManager().loadConfiguration();


I hope this will help you!

Samuel


Le 10 févr. 2023 à 09:32, Aaron Rosenzweig <aaron@chatnbike.com> a écrit :

Hi Everyone,

There is a difference in the startup processing of properties when I launch our app in Eclipse using ANT vs Maven. Anyone know why this might be?

Our properties file has defined: er.extensions.ERXClassDescription.factoryClass

Which is supposed to direct this call: ERXEntityClassDescription.registerDescription()

But when it is time to register, the following returns null: ERXProperties.stringForKey("er.extensions.ERXClassDescription.factoryClass”)

Later, such as in installPatches() or finishInitilization(), the property has a value. So the app does find the property but not in the early part when its really needed.

I have a hunch that the order of frameworks loading is brittle and causes this behavior. We have several apps which share a “core” framework which is where the Properties file is stored and makes the declaration. I think with ANT, our core framework initialized before ERExtensions and now, with Maven, the opposite is true. I don’t know this for a fact but it’s what I suspect.

If I redeclare the property in a particular apps Properties file, then ERXEntityClassDescription.registerDescription() can determine the override. It’s a temporary workaround but it means I need to duplicate all the properties that used to be in CORE by putting them into each app's properties.
#############################################################
This message is sent to you because you are subscribed to
 the mailing list <webobjects-dev@wocommunity.org>.
To unsubscribe, E-mail to: <webobjects-dev-off@wocommunity.org>
To switch to the DIGEST mode, E-mail to <webobjects-dev-digest@wocommunity.org>
To switch to the INDEX mode, E-mail to <webobjects-dev-index@wocommunity.org>
Send administrative queries to  <webobjects-dev-request@wocommunity.org>


Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster