Skip to content

Comments

fix: wait for the configuration to activate GraalVMEngine#635

Merged
dgriffon merged 1 commit intomainfrom
fix-graalvmservice-registration-order
Feb 11, 2026
Merged

fix: wait for the configuration to activate GraalVMEngine#635
dgriffon merged 1 commit intomainfrom
fix-graalvmservice-registration-order

Conversation

@dgriffon
Copy link
Member

@dgriffon dgriffon commented Feb 9, 2026

Fixes https://github.com/Jahia/jahia-private/issues/4126

Description

Attempt to fix the following error:

2026-01-19 01:44:18,678: ERROR [Framework] - FrameworkEvent ERROR
org.osgi.framework.ServiceException: Service factory returned null. (Component: org.jahia.modules.javascript.modules.engine.registrars.ViewsRegistrar (80))
	... suppressed 40 lines
	at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:488) ~[org.apache.felix.framework-6.0.5.jar:?]
	at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:420) ~[org.apache.felix.framework-6.0.5.jar:?]
	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) ~[org.apache.felix.framework-6.0.5.jar:?]
	at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:450) ~[org.apache.felix.framework-6.0.5.jar:?]
	... suppressed 7 lines
	at java.base/java.lang.Thread.run(Thread.java:840) [?:?]

This issue happens because at the time the ViewsRegistrar is read by one of its consumer, it has been removed from the OSGi service registry.
One culprit could be the configuration that operates a refresh of ViewsRegistrar dependency if detected after the service started, unregistering the service while being read by another process.

Logs have been added to identify the source of the error in case it happen again.

the log are useful information that can remain even if the issue won't appear.

Checklist

Source code

  • I've shared and documented any breaking change
  • I've reviewed and updated the jahia-depends

Tests

  • I've provided Unit and/or Integration Tests
  • I've updated the parent issue with required manual validations

Tip

Documentation to guide the reviews: How to do a code review

Copilot AI review requested due to automatic review settings February 9, 2026 15:46
@dgriffon dgriffon requested a review from a team as a code owner February 9, 2026 15:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent GraalVMEngine (and downstream consumers like ViewsRegistrar) from being activated/refreshed before required OSGi configuration is available, and adds lifecycle logging to help diagnose service unregister/re-register timing issues.

Changes:

  • Require OSGi configuration before activating GraalVMEngine (configurationPolicy = REQUIRE).
  • Add INFO lifecycle logs for GraalVMEngine and ViewsRegistrar activation/deactivation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
javascript-modules-engine-java/src/main/java/org/jahia/modules/javascript/modules/engine/registrars/ViewsRegistrar.java Adds activation/deactivation INFO logs to trace when the registrar is installed/removed.
javascript-modules-engine-java/src/main/java/org/jahia/modules/javascript/modules/engine/jsengine/GraalVMEngine.java Delays DS activation until configuration is present and adds INFO logs for lifecycle visibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@baptistegrimaud baptistegrimaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Hopefully that'll do it 🤞

@dgriffon dgriffon merged commit c29385d into main Feb 11, 2026
22 checks passed
@dgriffon dgriffon deleted the fix-graalvmservice-registration-order branch February 11, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants