Skip to content

jetty, undertow: register ServerOptions on start, like netty - #4057

Merged
jknack merged 1 commit into
jooby-project:mainfrom
shawzyy457:4056-register-server-options
Nov 27, 2026
Merged

jknack merged 1 commit into
jooby-project:mainfrom
shawzyy457:4056-register-server-options

Conversation

@shawzyy457

Copy link
Copy Markdown
Contributor

Fixes #4056

JettyServer and UndertowServer now put ServerOptions and the server in each app registry on start, the same way NettyServer already does, so a server started without runApp works again. With runApp nothing changes, init already puts the same instances there.

Issue4056 starts Jetty, Netty and Undertow by hand and calls ctx.getServerPort(). Without the change it gets a 500 on Jetty and Undertow and passes on Netty. The tests, jooby-jetty and jooby-undertow modules pass locally on JDK 24 with an English locale.

…oby-project#4056

A server started by hand, without runApp, never got ServerOptions in the
app registry, so ctx.getServerPort() and friends failed with
"Service not found: io.jooby.ServerOptions". NettyServer already registers
the options and the server on start, Jetty and Undertow now do the same.
@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.20%. Comparing base (9c1d0ee) to head (0fd449f).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4057      +/-   ##
============================================
- Coverage     94.21%   94.20%   -0.01%     
- Complexity     6694     6695       +1     
============================================
  Files           432      432              
  Lines         20966    20971       +5     
  Branches       2109     2109              
============================================
+ Hits          19753    19756       +3     
- Misses          761      762       +1     
- Partials        452      453       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jknack jknack added this to the 4.6.1 milestone Nov 27, 2026
@jknack
jknack merged commit 2d17980 into jooby-project:main Nov 27, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

jetty, undertow: server started by hand has no ServerOptions in the registry since 4.6.0

2 participants