Adam Cameron
bundle-info
at the bottom, and a dump of the same object on a different Lucee 5.3.9.133 instance to not include that section?
Both built from the same lucee/lucee:5.3.9.133-nginx
Docker image. The Docker config for each is superficially different, but not in any way that ought to impact this.
IE: one dump ends with:
https://i2.paste.pics/82d78f78ce4dc51e421fd080ab8c628d.png▾
https://i2.paste.pics/a03f47f8d4442f253d1156618b620f29.png▾
zackster
07/14/2022, 5:12 PMAdam Cameron
Adam Cameron
<cfdump var="#CreateObject("java", "com.vendor.app.ClassName")#"><cfabort>
Adam Cameron
bundle-info.location
in the first dump)dswitzer
07/14/2022, 5:41 PMAdam Cameron
CreateObject("java", "com.vendor.app.ClassName")
is being called (and it's the only reference to com.vendor.app.ClassName
in the codebase), as I did not want any other code "interfering" with it before I call it. I am... 95% nothing else is in play.
Both dumps are being done immediately after a Lucee restart, and it's the first request being run on each instance after restart.
Any number of other reqs to same code subsequently has no impact on what is dumped.Adam Cameron
bundle-info
bit. The one in the straight test.cfm
file does not.Adam Cameron
Adam Cameron
https://i2.paste.pics/128fae90f582d5c5701bae58293f1f8a.png▾
Adam Cameron
/opt/lucee/server/lucee-server/context/lib/ezsign-4.1.3.jar
I restarted the container
I diffed the two files: same
I made the request that has the createObject
call in it
I diff the two files: now the one at /opt/lucee/server/lucee-server/context/lib/ezsign-4.1.3.jar
is different (as indicated above).dswitzer
07/14/2022, 6:08 PMAdam Cameron
Adam Cameron
to make the JAR OSGi compliant.Oh God. Probably. [despair]
Adam Cameron
this.javaSettings
in Application.cfc (or CFWheels's approximation thereof), but I just removed that and no changeAdam Cameron
dswitzer
07/14/2022, 6:14 PMAdam Cameron
Adam Cameron
Adam Cameron
Adam Cameron
dswitzer
07/14/2022, 6:23 PMAdam Cameron
Adam Cameron
dswitzer
07/14/2022, 6:24 PMAdam Cameron
dswitzer
07/14/2022, 6:25 PMAdam Cameron
Adam Cameron
bundle-info
in the "broken" container too.Adam Cameron
Adam Cameron
Adam Cameron
dswitzer
07/14/2022, 6:54 PMAdam Cameron
https://i2.paste.pics/4c14cf15586bf2f1e176420ad2498cc1.png▾
dswitzer
07/14/2022, 6:58 PMdswitzer
07/14/2022, 6:58 PMAdam Cameron
Adam Cameron
/opt/lucee/server/lucee-server/context/lib/
via the Dockerfile. I build the container, wait for Lucee to gets its act together and be responsive, and I hit my test code. First time I hit it I get this:
No Bundle provided
lucee.runtime.exp.NativeException: No Bundle provided at java.base/java.util.Objects.requireNonNull(Objects.java:246) at org.apache.logging.log4j.core.osgi.BundleContextSelector.locateContext(BundleContextSelector.java:137) at org.apache.logging.log4j.core.osgi.BundleContextSelector.getContext(BundleContextSelector.java:124) at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:230) at
@bdw429s if yer reading, this might be familiar to you (https://ortussolutions.atlassian.net/browse/COMMANDBOX-1460). NB: CommandBox is not in play here, I'm just pinging you cos you've experienced this too.
Note: I am not directly calling anything to do with Log4J, but the third party code has a wrapper around same, so it will be.
If I wait a few sec and run the test code again, this time I get:
Could not initialize class com.Moo.Zoo.log.GooLog
lucee.runtime.exp.NativeException: Could not initialize class com.Moo.Zoo.log.GooLog at com.Moo.Zoo.Foo.<init>(Foo.java:103) at com.Moo.Zoo.Foo.<init>(Foo.java:119) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at
(I've changed a few things in there to redact the vendor & their app)
OK so that's already weird.
This stays the same for as many re-runs as I like.
UNLESS
I restart Tomcat (ie via shutdown.sh and startup.sh).
Then the code just works.
NB: restarting the container doesn't work. It needs to just be a restart of tomcat in the running container.
I can reliably repeat this as many times as I want.
So what I'd like a clear straight answer on, please, is... WTF?
If we can't explain the entire F, then perhaps some lucidity on what Lucee is doing to these poor jar files, and also why I'm getting three different results depending on whether it's the first hit to the jar, subsequent hits to the jar, or subsequent hits to the jar after a Tomcat restart.
NB: if I add ENV LUCEE_JAVA_OPTS="-DLog4jContextSelector=org.apache.logging.log4j.core.selector.ClassLoaderContextSelector"
into my Dockerfile (thanks for the tip there Brad), then the thing works right from the outset.zackster
07/22/2022, 4:29 PMAdam Cameron
Adam Cameron
zackster
07/22/2022, 4:31 PMbdw429s
07/22/2022, 4:31 PMAdam Cameron
Adam Cameron
i thought that's what slack was for?We can do it on both, I'm fine with that
zackster
07/22/2022, 4:33 PMAdam Cameron
Adam Cameron
bdw429s
07/22/2022, 4:34 PMAdam Cameron
-D
setting will solve it for us, but I this whole thing smells a bit.Adam Cameron
Adam Cameron
zackster
07/22/2022, 4:38 PMAdam Cameron
zackster
07/22/2022, 4:41 PMAdam Cameron
Adam Cameron
https://i2.paste.pics/5ddecab2349944ba2b869b04796e7965.png▾
Patrick S
07/22/2022, 6:37 PMAdam Cameron
Adam Cameron
https://i2.paste.pics/f4cd6e5971c63efb40bd376bf3a92a81.png▾
Patrick S
07/22/2022, 6:52 PMAdam Cameron
Adam Cameron
Adam Cameron
5.3.9.133
. It works fine on 5.3.7.47
.Adam Cameron