spring-projects / spring-boot

Spring Boot
https://spring.io/projects/spring-boot
Apache License 2.0
74.58k stars 40.55k forks source link

Spring Boot uses an internal jetty class #33833

Closed Sineaggi closed 3 months ago

Sineaggi commented 1 year ago

Spring Boot is using an internal jetty class here in the JettyWebSocketServletWebServerCustomizer.java:23

This means if you were planning on running your dependencies (jackson, slf4j, logback and jetty) on the module path and keep spring-boot on the unnamed-module you'd need to add the flag --add-opens org.eclipse.jetty.websocket.jakarta.server/org.eclipse.jetty.websocket.jakarta.server.internal=ALL-UNNAMED

wilkinsona commented 1 year ago

This is intentional. We try to minimise our use of internal API but will use it where there's no alternative. This may improve with Jetty 12 which we intend to support in Spring Boot 3.1 if the release dates line up.

wilkinsona commented 1 year ago

Re-opening as there's now some new public API that we should see if we can use as part of upgrading to Jetty 12.

rafaelrc7 commented 1 year ago

Hello, I would like to try solving this issue. By reading what was discussed here and in eclipse/jetty.project#9182 it seems that there are two possible solutions: Either calling the same methods that were made public or following the Jetty's team's suggestion, which one would be preferable?

wilkinsona commented 1 year ago

Thanks for the offer, @rafaelrc7, but we can't upgrade to Jetty 12 just yet. I have some work in progress in this branch but it's currently blocked by https://github.com/eclipse/jetty.project/issues/9173.

wilkinsona commented 3 months ago

This was addressed in https://github.com/spring-projects/spring-boot/issues/36073.