X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.25a (ClamAV 0.103.6/26811) X-Junk-Score: 0 [] X-KAS-Score: 0 [] Return-Path: Received: from mail-qt1-f177.google.com ([209.85.160.177] verified) by selbstdenker.ag (CommuniGate Pro SMTP 6.3.17) with ESMTPS id 29408029 for webobjects-dev@wocommunity.org; Mon, 13 Feb 2023 14:45:02 +0100 Received-SPF: pass receiver=post.selbstdenker.com; client-ip=209.85.160.177; envelope-from=recurve@cocoanutstech.com Received: by mail-qt1-f177.google.com with SMTP id h24so13648920qta.12 for ; Mon, 13 Feb 2023 05:45:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chatnbike.com; s=chatnbike; h=references:to:in-reply-to:subject:date:mime-version:message-id:from :from:to:cc:subject:date:message-id:reply-to; bh=46O8K45V9ZR3A0OitXoCZLixGTrHYTW7JOYhG8Q3tOk=; b=PSJAb9H6kX8qTCLWO433HYbg+LjRpUoS042egJC+PeVj+/rGeUJXDcChUFa8QIiy0Q Dw1i945JwtOT0/3Pdci7g7Q0BQczPChk1Q8QdWe6kqLIbu7q7HQEwm3LlN9MkXn3PCvF MJJ9cN3xrLtmGvG7BC57w23AJCMMorfNNNp+8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:to:in-reply-to:subject:date:mime-version:message-id:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=46O8K45V9ZR3A0OitXoCZLixGTrHYTW7JOYhG8Q3tOk=; b=h4vswFNzyr0eT+eqg/K8mCq1ztMuw3xfWncy0/Ai2+jGnt2BZr/fxqCydv0ge8a4cs +DYY03AFyuHAQwd9/CCvErlvdqCbyJ2apkGtnjwn0GvXaowneDDMUiYsvzscww6Va8lG oQKKpkiKl8sA9tcMcl0ZbEFTyn4kJqdkOEn5E77HzHUklQV+a+clbjTkUBhVwL6GOUQG Epi0iWex5dqCV4cxBzyLktfeC09oeWiM4dmOzex1/zR8qY/O4/KuugQ1+ZpSmKdLItpY ZYM5jriBvDvSUtrZ6Vl2mbDLzVgLxWhbljPS+iD0Ai9PSx0yjtzLRlkhxKa+eJPPVCcW 71uA== X-Gm-Message-State: AO0yUKXumAUkutin+9/gUu9V2ubOaA+Da2tbzqJGMPb02asWBYJ2E7My ka+H0UhhajdKf2C5iEl6HU8PojLMOFlzAQyOzQ0= X-Google-Smtp-Source: AK7set+o5ewBrZLD9sWujdKchXS/RJ6QjvZ6iYP/F64Q3d1txO2q8KCM7fNl5zB8X4N01EA4IE7Upg== X-Received: by 2002:a05:622a:185:b0:3b1:80ab:38e with SMTP id s5-20020a05622a018500b003b180ab038emr41285926qtw.0.1676295879813; Mon, 13 Feb 2023 05:44:39 -0800 (PST) Return-Path: Received: from smtpclient.apple (pool-173-79-19-72.washdc.fios.verizon.net. [173.79.19.72]) by smtp.gmail.com with ESMTPSA id x21-20020ac87a95000000b003b869f71eedsm9140745qtr.66.2023.02.13.05.44.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Feb 2023 05:44:39 -0800 (PST) From: Aaron Rosenzweig Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_7AD4CC4C-A1E6-4AF2-956C-BCC4E7899902" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.2\)) Date: Mon, 13 Feb 2023 08:44:38 -0500 Subject: Re: [WO-DEV] Maven: Properties not available until late in app startup sequence In-Reply-To: To: WebObjects & WOnder Development References: X-Mailer: Apple Mail (2.3696.120.41.1.2) --Apple-Mail=_7AD4CC4C-A1E6-4AF2-956C-BCC4E7899902 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Thanks Samuel, I=E2=80=99ll give that a try later :-) I=E2=80=99m not sure it will work in something like the app's = =E2=80=9CfinishInitilization()" because when you look at: = er.extensions.eof.ERXEntityClassDescription.registerDescription() it has = a lazy initializer that is already initialized with the wrong value = during app startup.=20 I would have to put the defaultManager().loadConfiguration() call really = early like in the static main first thing.=20 I=E2=80=99ll try it later=E2=80=A6 maybe not today :-( Perhaps tomorrow. = Thank you :-) > On Feb 13, 2023, at 8:37 AM, Samuel Pelletier = wrote: >=20 > Hi Aaron, >=20 > I did a quick look at properties loading and I would try this before = reading the property during your early initialization code: >=20 > ERXConfigurationManager.defaultManager().loadConfiguration(); >=20 > I hope this will help you! >=20 > Samuel >=20 >=20 >> Le 10 f=C3=A9vr. 2023 =C3=A0 09:32, Aaron Rosenzweig = a =C3=A9crit : >>=20 >> Hi Everyone,=20 >>=20 >> 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?=20 >>=20 >> Our properties file has defined: = er.extensions.ERXClassDescription.factoryClass >>=20 >> Which is supposed to direct this call: = ERXEntityClassDescription.registerDescription() >>=20 >> But when it is time to register, the following returns null: = ERXProperties.stringForKey("er.extensions.ERXClassDescription.factoryClass= =E2=80=9D) >>=20 >> 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.=20 >>=20 >> I have a hunch that the order of frameworks loading is brittle and = causes this behavior. We have several apps which share a =E2=80=9Ccore=E2=80= =9D 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=E2=80=99t = know this for a fact but it=E2=80=99s what I suspect.=20 >>=20 >> If I redeclare the property in a particular apps Properties file, = then ERXEntityClassDescription.registerDescription() can determine the = override. It=E2=80=99s 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.=20 >> ############################################################# >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> To switch to the DIGEST mode, E-mail to = >> To switch to the INDEX mode, E-mail to = >> Send administrative queries to = >>=20 >=20 --Apple-Mail=_7AD4CC4C-A1E6-4AF2-956C-BCC4E7899902 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Thanks Samuel, I=E2=80=99ll give that a try later :-)

I=E2=80=99m not sure it = will work in something like the app's =E2=80=9CfinishInitilization()" = because when you look = at: er.extensions.eof.ERXEntityClassDescription.registerDescription()= it has a lazy initializer that is already initialized with the wrong = value during app startup. 

I would have to put the = defaultManager().loadConfiguration() call really early like in the = static main first thing. 

I=E2=80=99ll try it later=E2=80=A6 = maybe not today :-( Perhaps tomorrow. Thank you :-)

On Feb 13, 2023, at 8:37 AM, Samuel Pelletier <samuel@samkar.com> = wrote:

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=C3=A9vr. 2023 =C3=A0 09:32, Aaron Rosenzweig <aaron@chatnbike.com>= a =C3=A9crit :

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= =E2=80=9D)

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 =E2=80=9Ccore=E2=80=9D 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=E2=80=99t know this for a fact but it=E2=80=99= s what I suspect.

If I redeclare the = property in a particular apps Properties file, then = ERXEntityClassDescription.registerDescription() can determine the = override. It=E2=80=99s 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>



= --Apple-Mail=_7AD4CC4C-A1E6-4AF2-956C-BCC4E7899902--