-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Spring Boot Test 3 NoClassDefFoundError: jakarta/servlet/ServletConnection #33661
Comments
Spring Boot 3 requires Jakarta 6, not 5.
|
Unfortunately at the time of release there was no Jetty version available that supported Servlet 6.0. We have an open issue to document how to downgrade dependencies. There's a lot of discussion in that issue with a few suggestions. |
I think we can consider this one a duplicate of #33044 |
@kdebski85
I need to set Servlet API to 5.0 when I'm using Spring Boot 3 with Jetty, and it works, but then Spring tests throw exception. |
Found a temporary fix for the problem.
With the latest version of jetty-server. With this the service starts up and the unit tests with MockMvc works as expected. |
I've had the same issue, and the previously suggested options were not working for everything. Either the service would start or all the tests (inc mockmvc) would succeed. But not everything. :-( In the end, this setup has worked for all:
plus:
|
@tasosz |
Hi, I do not understand. I thought , Jetty does not support servlet 6. How would adding latest version able to fix the problem? |
Spring Boot Web + Jetty (exclude Tomcat) + MockMvc 3.0.1 and jakarta-servlet.version 5.0.0
Error test on startup:
reproducer: https://github.com/nibexo/jetty-spring-boot-test-3-repro
The text was updated successfully, but these errors were encountered: