-
Notifications
You must be signed in to change notification settings - Fork 340
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
HttpServletResponse#setStatus(int sc, String sm) no longer called #5682
base: 2.x
Are you sure you want to change the base?
Conversation
This method is deprecated since servlet-api 2.1. This method was dropped from servlet-api 6. Calling it renders jersey 2.x unusable on Tomcat 10.1 with the jakartaee-migration tool: https://github.com/apache/tomcat-jakartaee-migration This commit is partial cherry-pick of: 4977fec Author: jansupol <jan.supol@oracle.com> Date: Mon Feb 21 18:23:20 2022 +0100 Replace removed API in Servlet 6
Sorry, Jersey 2.x is only targeted for Tomcat 9. |
Too bad. I have an application here with a myriad of dependencies. So far, that jakartaee-migration tool dealt miraculously well with all of them, except jersey. Updating to Jersey 3.1.x causes another load of problems with no end in sight. |
The |
I assume |
Yes.
|
About Tomcat 10.0.x: This is already end-of-life: https://tomcat.apache.org/whichversion.html Also, Debian does not provide a 10.0.x out of the box, just 9.0.x and 10.1.x. |
I'm really don't know much about neither jersey nor servlet api. But when looking at 4977fec I see: This reasonPhrase was just ommitted, not put anywhere else instead. Also, not a single test had to be adjusted to reflect that changed (actually reduced) functionality. So this reasonPhrase seems to be superfluous, even on servlet api 4 or earlier. And the function in question was deprecated with servlet api 2.1, the "First official specification" at all, released in 1998: https://en.wikipedia.org/wiki/Jakarta_Servlet |
in the PR you are doing the Servlet API is from Servelt 4th:
The Tomcat 10.1 bundles Servlet 6 API:
This won't work anyway even if the PR would be merged. The application should be properly migrated (even manually) with respect to changes that have occurred since the 2.x version. It is important to remember, that Jersey 2.x will not work (without proper hacks) on the Tomcat 10.1. If the migration is at least successful for Jersey 3.0 + Tomcat 10.0, it is possible to use that Tomcat even if it has reached its end of life meanwhile migrating to Jersey 3.1 |
We know that the reason phrase is very important for the customer use-cases and we had multiple complaints about not using/propagating the reason phrase in EE 10 (as well as in EE 9 Jetty which dropped the reason phrase in the middle of the product lifecycle breaking backward compatibility), so we know we cannot just drop the reason-phrases. The migration-tool really would not help in the cases where new API methods are used instead of the old ones, or the old methods are dropped. That would be the case not only for the Servlet itself, but also for the 3rd party dependencies brought in to Tomcat. In the simplest use-cases, the tool might work for Tomcat 10.1, though. In theory, the no-reason method invocations could be wrapped into |
Just to let you know, it works: I have my web application running nicely on Tomcat 10.1. without upgrading any of my dependencies. So no jersey 2.x->3.1.x, no Apache Wicket 9->10, etc. I just sent all the dependencies through jakartaee-migration. And of course I had to apply this MR to jersey. And I had to apply this to jakartaee-migration and use it, otherwise the migration tool migrates too much. Of course, sooner or later I will upgrade to jersey 3.1.x, as I will upgrade to Apache Wicket 10 etc. But I will tackle these upgrades one by one, in my own pace. And to make sure I used "Find Usages" in IDEA to look for any usages of any method dropped from servlet api 6. I did not find any such usages, except in jersey what is removed by this PR. Not only in the project I'm converting right now, but also in all other projects my colleagues are currently working on. Makes sense to me, since these methods are deprecated for 26 years. So I still think, this PR would be good to merge. But if you don't agree, you may just close it. |
This method is deprecated since servlet-api 2.1.
This method was dropped from servlet-api 6. Calling it renders jersey 2.x unusable on Tomcat 10.1 with the jakartaee-migration tool:
https://github.com/apache/tomcat-jakartaee-migration
This commit is partial cherry-pick of:
4977fec
Author: jansupol jan.supol@oracle.com
Date: Mon Feb 21 18:23:20 2022 +0100
Replace removed API in Servlet 6