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-f174.google.com ([209.85.160.174] verified) by selbstdenker.ag (CommuniGate Pro SMTP 6.3.17) with ESMTPS id 29409176 for webobjects-dev@wocommunity.org; Mon, 13 Feb 2023 19:44:30 +0100 Received-SPF: pass receiver=post.selbstdenker.com; client-ip=209.85.160.174; envelope-from=recurve@cocoanutstech.com Received: by mail-qt1-f174.google.com with SMTP id f10so14876444qtv.1 for ; Mon, 13 Feb 2023 10:44:30 -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=utUidEFBlWsd5BOkYMxvflinUHrhIokAKbPZoDdAbdU=; b=KBnztMaGYKxPsoJGq2ACHke2bconLVctGrmgPM/wzTE1GDM8wOgxcH0VzwONsmcJva vmczK+mXmAISqg3AhlrnSytLHUNIVrZKThGznW8UbQXMQD2NvI2z7xhehRrgVqVSp9tE lZHfhsLdfw4rJ4dcsMrgZKcxueNBFI+ISl52M= 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=utUidEFBlWsd5BOkYMxvflinUHrhIokAKbPZoDdAbdU=; b=ElgzvtZFYb/LA13DXndqV8p9cZIFstnUbxDHrSUbQ+Y0qElwmolT2Ujaxu8E2vnySj RGH4TjXio7ptE19X1HPNHkPEyeOl3vMJ9reC9TpSGSgjWwR9zezydPtNlFsS5UApgxxW hhzfezj7tvQGMCOVmk5s4g1xFpSXXQVgTVxbt2FbejLeOvL5LjYjqKrTW1CgrysPH3hp /OxL6KzfW4+AJHDyZWORozpA3bekYbI4/zTUye5ZKu9jZxbztJSrL+B2Pxc5AKAOn4Gj OwBVvjhSvNNWyeLobFkUY3WTkn/9GpbEO22XynKzYbkWD8pB1okR02f/bf5iPGHJHsCg rDkg== X-Gm-Message-State: AO0yUKUNdqWbaxtYWTGfPh0v8T7AfTqCm8Eqw9sR/0Yy6XegP9M6U78N Ozg1zsnj9Ifi4oajzSS8om1dbtAzvxr9m0njX2w= X-Google-Smtp-Source: AK7set/waUe/qizsCMEt8nNyq8G2Fajzr/rjjo/Pgf3jQ2k6BVmGE+R7NK6WJg3pjT2Upt5w0exA3A== X-Received: by 2002:a05:622a:151:b0:3b8:2a6c:d1e9 with SMTP id v17-20020a05622a015100b003b82a6cd1e9mr44452644qtw.18.1676313849018; Mon, 13 Feb 2023 10:44:09 -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 ce11-20020a05622a41cb00b003b9b4028d63sm9477330qtb.80.2023.02.13.10.44.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Feb 2023 10:44:08 -0800 (PST) From: Aaron Rosenzweig Message-Id: <8F0491E8-B150-407B-98F3-3E040BADE759@chatnbike.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_42FA5436-A72B-4F98-9A06-A472E1977220" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.2\)) Date: Mon, 13 Feb 2023 13:44:07 -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=_42FA5436-A72B-4F98-9A06-A472E1977220 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hey Samuel! I was able to give it a try just now but sad news, it = didn=E2=80=99t work :-( It was worth a shot though.=20 I tried it in three ways: 1) App.finishInitialization() =E2=80=94 it was too late. When I tried to = use the page with ERAttachment it wasn=E2=80=99t prepending the schema = to SQL.=20 2) first line inside: static main() =E2=80=94 it was too early, the call = to =E2=80=9CloadConfiguration()=E2=80=9D had a null pointer exception.=20= 3) last line inside: static main() =E2=80=94 it was too late, the lazy = initializer was already called inside of = ERXEntityClassDescription.registerDescription() and is stuck=E2=80=A6 so = ERAttachment still doesn=E2=80=99t have the schema prefix.=20 Thanks for thinking about it and suggesting this. It was worth a try :-) I=E2=80=99m thinking ERXEntityClassDescription.registerDescription() = likely needs to be less brittle about timing.=20 Cheers, =E2=80=94 Aaron > 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=_42FA5436-A72B-4F98-9A06-A472E1977220 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hey = Samuel! I was able to give it a try just now but sad news, it didn=E2=80=99= t work :-( It was worth a shot though. 

I tried it in three ways:

1) = App.finishInitialization() =E2=80=94 it was too late. When I tried to = use the page with ERAttachment it wasn=E2=80=99t prepending the schema = to SQL. 

2)= first line inside: static main() =E2=80=94 it was too early, the call = to =E2=80=9CloadConfiguration()=E2=80=9D had a null pointer = exception. 

3) last line inside: static main() =E2=80=94 it was too late, = the lazy initializer was already called inside = of ERXEntityClassDescription.registerDescription() and is stuck=E2=80= =A6 so ERAttachment still doesn=E2=80=99t have the schema = prefix. 

Thanks for thinking about it and suggesting this. It was = worth a try :-)

I=E2=80=99m thinking = ERXEntityClassDescription.registerDescription() likely needs to be less = brittle about timing. 

Cheers,
=E2=80=94 Aaron

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=_42FA5436-A72B-4F98-9A06-A472E1977220--