Jetty 12 reports deprecation warnings with CrossOriginFilter
Proposal
It appears that running the support for Jetty 11 with a Jetty 12 server behind the scenes is utilising a now-deprecated class.
2025-04-08T09:50:20.757+01:00 WARN 46943 --- [my-wiremock-service] [ main] o.eclipse.jetty.util.DeprecationWarning : Using @Deprecated Class org.eclipse.jetty.ee10.servlets.CrossOriginFilter
The JavaDoc for this deprecated class suggests...
Deprecated
Use org.eclipse.jetty.server.handler.CrossOriginHandlerinstead
...however this is not deprecated in Jetty 11 itself.
When Jetty 12 support is provided officially, this class reference will probably want to be swapped out.
Outside this warning, I can confirm that the Jetty 12 support works perfectly fine under significant load.
Reproduction steps
Run the WireMock server with Jetty 12 on the classpath.
References
No response
Hi, is this still an issue with the latest wiremock-jetty12 module which uses Jetty 12.0.x ? https://mvnrepository.com/artifact/org.wiremock/wiremock-jetty12
Also, we are in the process of releasing a new WireMock version 4.x-beta which will support Jetty 12.1.x
Hey, yeah it is. I'm using Jetty 12.0 with this and can still see an issue on the latest WireMock
And you are using the version of WireMock that bundles Jetty 12 ?
Yep, via the wiremock-jetty12 dependency
Ah, cool. I see it has now been moved to use CrossOriginHandler instead. Thank you for the heads up
No problem. It might also be worth noting on the side as an unrelated note that when I pulled in Spring Boot 4 this week, I encountered some issues with compatibility between WireMock depending on Jetty 12.0, and Spring Boot specifying Jetty 12.1 in the BOM.
The issue itself was WireMock raising a NoClassDefFoundException (or similar, I can't remember the exact issue as I am on my phone responding to this) during startup when interacting with the Jetty APIs.
I've worked around that for now by removing the dependency on spring-boot-starter-parent and spring-boot-dependencies since the BOM pulls in Jetty as well.
I mention it, because it might be something worth double checking, especially since I believe there is a Spring Cloud Contract library that embeds WireMock at the moment, and it might be of value to consider at the same time as this.
Edit: ah, I see in https://github.com/wiremock/wiremock/issues/3139#issuecomment-3469380427 that binary compatibility of Jetty is not expected? I was under the impression it followed semantic versioning conventions but I guess that is not the case.
We have just updated to jetty 12.1 in the main branch so the next 4.x-beta release will have this update (along with 4 going GA soon after). The idea is that you use WireMock 4 with SB 4 and WireMock 3 with SB 3
Thanks!