You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flaky bare NullPointerException in model instantiation on Lucee 7 (cleared by reload) #3457
On Lucee 7.0.0.395 (the engine the Wheels CLI installs), the first model() call after a fresh boot — and intermittently afterwards — fails with a bare java.lang.NullPointerException with no Java stack, returning HTTP 500. ?reload=true clears it temporarily. Observed with both SQLite and H2 datasources, in plain wheels new scaffolds running current develop.
A variant of the same failure surfaces as:
Cannot invoke "lucee.runtime.component.Member.getAccess()" because the return
value of "java.util.Map$Entry.getValue()" is null
at lucee.runtime.ComponentImpl.keySet, reached via ComponentUtil.notFunction → onMissingMethod — Lucee enumerating a component whose member map contains a null entry.
Reproduction
wheels new bench-perf
Replace vendor/wheels with current develop.
Add a model (app/models/Post.cfc extends="Model") and an action: for (i = 1; i <= 3000; i++) { model("Post").new(); }.
First request after server start → 500 bare NPE (often at iteration 1). The same loop inside try/catch reports java.lang.NullPointerException with empty message and no detail.
?reload=true&password=... → the loop runs clean for a while; the failure can return on later requests.
Suspected cause
Issue #3236's integration-plan cache ($buildComponentIntegrationPlan / $integrateFunctions in vendor/wheels/global/objects.cfm and Model.cfc) pre-resolves method references from a shared holder component ({name, ref} pairs) and copies them into each new instance via variables[name] = ref; this[name] = ref;. If any ref resolves to Java null on Lucee 7 (holder method lookup during a cold class-cache), every materialized instance inherits a null member entry, and Lucee later NPEs while enumerating the component. The plan is cached in application.wheels.integrationPlans, which is why a reload (rebuilding the app scope) clears it.
Context
Found while benchmarking #3213 (Wheels 2.5 vs 4.x performance). The same rig runs cleanly on Wheels 4.0.3 (pre-#3236 code path) and on Wheels 2.5.0.
Activity
fix(perf): rebuild cached integration plans containing null function …
perf(controller): apply a per-class cached method integration instead…