Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jetty 12 : Handler.Collection does not propagate Server to handlers in expected way #8442

Closed
joakime opened this issue Aug 10, 2022 · 5 comments · Fixed by #8459 or #9090
Closed

Jetty 12 : Handler.Collection does not propagate Server to handlers in expected way #8442

joakime opened this issue Aug 10, 2022 · 5 comments · Fixed by #8459 or #9090
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@joakime
Copy link
Contributor

joakime commented Aug 10, 2022

Jetty version(s)
Jetty 12

Description

In Jetty 12, if you use the jetty-core org.eclipse.jetty.server.Handler$Collection the .setHandlers(List) does not propagate the Server correctly.

Example code.

WebAppContext context = new WebAppContext();
context.setContextPath("/");
context.setBaseResource(context.getResourceFactory().newResource(staticBase));
server.setHandler(new Handler.Collection(context, new DefaultHandler()));
server.start();

The DefaultHandler.setServer(Server) never gets called with a valid Server instance.

This is because the internal Handler.Collection processing does it's handler.setServer(server) far too early.
AFAICT, this seems to be the only Handler implementation with this bug.

@joakime joakime added Bug For general bugs on Jetty side jetty 12 labels Aug 10, 2022
@joakime joakime changed the title Jetty 12 : Handler.Collection does not propagate Server to handlers Jetty 12 : Handler.Collection does not propagate Server to handlers in expected way Aug 10, 2022
gregw added a commit that referenced this issue Aug 10, 2022
Test setServer propagation
protect from inadvertent null setting
@gregw
Copy link
Contributor

gregw commented Aug 10, 2022

fixed by a0d6f42

@gregw gregw closed this as completed Aug 10, 2022
@lorban lorban reopened this Aug 11, 2022
lorban added a commit that referenced this issue Aug 11, 2022
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
@lorban
Copy link
Contributor

lorban commented Aug 11, 2022

@gregw sorry, I've had to revert these changes in #8452 because they broke the build.

@gregw
Copy link
Contributor

gregw commented Aug 11, 2022

@lorban no probs.... any hint to how the build was broken?

@github-actions
Copy link

This issue has been automatically marked as stale because it has been a
full year without activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@github-actions github-actions bot added the Stale For auto-closed stale issues and pull requests label Aug 12, 2023
@sbordet sbordet removed the Stale For auto-closed stale issues and pull requests label Aug 12, 2023
@gregw
Copy link
Contributor

gregw commented Aug 23, 2023

This was fixed during Handler restructure in 12.

@gregw gregw closed this as completed Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
None yet
4 participants