Skip to content

fix(server): call server.init after setting server options - #4003

Open
arimu1 wants to merge 2 commits into
jooby-project:mainfrom
arimu1:fix/3995-server-init-after-options
Open

fix(server): call server.init after setting server options#4003
arimu1 wants to merge 2 commits into
jooby-project:mainfrom
arimu1:fix/3995-server-init-after-options

Conversation

@arimu1

@arimu1 arimu1 commented Sep 12, 2026

Copy link
Copy Markdown

Summary

  • Stop calling server.init from the Jooby constructor during bootstrap (it ran before runApp applied config-derived ServerOptions).
  • Call server.init for each app in runApp after final options are set, and in JoobyExtension before start.
  • Add regression test ensuring registry ServerOptions match the configured instance after init.

Fixes #3995

Test plan

  • mvn -pl jooby -am test -Dtest=Issue3995,JoobyRunnerTest,ServerTest (Java 21, Maven 3.8+)

Call server.init from runApp only after final ServerOptions are applied,
and from JoobyExtension before start, so the service registry does not
retain stale defaults from bootstrap.

Fixes jooby-project#3995
Call server.init after test server options are finalized and before
start for integration tests that no longer rely on Jooby constructor init.
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.

server: call server.init after setting the server options (not before)

1 participant