Skip to content

SOLR-17069: Don't include jetty-jakarta-servlet-api JAR (EE9)#3838

Merged
dsmiley merged 7 commits intoapache:mainfrom
dsmiley:SOLR-17069-noJavaxServlet
Nov 7, 2025
Merged

SOLR-17069: Don't include jetty-jakarta-servlet-api JAR (EE9)#3838
dsmiley merged 7 commits intoapache:mainfrom
dsmiley:SOLR-17069-noJavaxServlet

Conversation

@dsmiley
Copy link
Contributor

@dsmiley dsmiley commented Nov 5, 2025

https://issues.apache.org/jira/browse/SOLR-17069

Our Jetty 12 migration should not have incorporated org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api.  This commit removes that completely. The removal of this marks a milestone -- there is no JAR that Solr ships that includes "javax" stuff.

find . -type f -name "*.jar" -ls -exec sh -c 'unzip -l "$1" 2>/dev/null | grep -q "javax/" && echo "$1"' _ {} \;

Our Jetty 12 migration should not have incorporated org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api.  This commit removes that completely.
@dsmiley
Copy link
Contributor Author

dsmiley commented Nov 5, 2025

I checked and see the "toolchain" JAR I'm removing was present in Solr 9.x... so looking at this PR as part of the Jetty 12 upgrade is not entirely accurate. Sunjay understandably merely bumped the version. But the Jetty upgrade enabled this to be possible, whereas it wasn't possible in 9.x. Perhaps the best JIRA here is SOLR-17503, the umbrella issue for Jakarta namespace. Shrug; whatever; I'll ensure the commit message reflects both.

@iamsanjay
Copy link
Contributor

I was just curious what's the javax stuff inside the toolchain jar. All of them are schema files no code classes, I believe to support old web xml files.

 0  09-01-2020 15:21   javax/
        0  09-01-2020 15:21   javax/servlet/
        0  09-01-2020 15:21   javax/servlet/resources/
    16085  09-01-2020 15:21   javax/servlet/resources/XMLSchema.dtd
     6367  09-01-2020 15:21   javax/servlet/resources/datatypes.dtd
    47147  09-01-2020 15:21   javax/servlet/resources/web-common_4_0.xsd
    12710  09-01-2020 15:21   javax/servlet/resources/web-app_4_0.xsd
    14535  09-01-2020 15:21   javax/servlet/resources/jsp_2_2.xsd
    13107  09-01-2020 15:21   javax/servlet/resources/jsp_3_0.xsd
        0  09-01-2020 15:21   javax/servlet/jsp/
        0  09-01-2020 15:21   javax/servlet/jsp/resources/
    12188  09-01-2020 15:21   javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd
     5533  09-01-2020 15:21   javax/servlet/resources/permissions_7.xsd
    19163  09-01-2020 15:21   javax/servlet/resources/javaee_web_services_1_4.xsd
     8741  09-01-2020 15:21   javax/servlet/resources/web-fragment_3_0.xsd
    99984  09-01-2020 15:21   javax/servlet/resources/javaee_7.xsd
    25283  09-01-2020 15:21   javax/servlet/resources/javaee_web_services_client_1_4.xsd
    16143  09-01-2020 15:21   javax/servlet/resources/web-app_2_2.dtd
    11828  09-01-2020 15:21   javax/servlet/jsp/resources/jsp_2_2.xsd
    26845  09-01-2020 15:21   javax/servlet/jsp/resources/web-jsptaglibrary_2_0.xsd
     4321  09-01-2020 15:21   javax/servlet/catalog.xml
    19164  09-01-2020 15:21   javax/servlet/resources/javaee_web_services_1_3.xsd
    99984  09-01-2020 15:21   javax/servlet/resources/javaee_8.xsd
    13962  09-01-2020 15:21   javax/servlet/resources/j2ee_web_services_1_1.xsd
    17617  09-01-2020 15:21   javax/servlet/resources/javaee_web_services_client_1_2.xsd
    12471  09-01-2020 15:21   javax/servlet/resources/web-jsptaglibrary_1_2.dtd
    30020  09-01-2020 15:21   javax/servlet/resources/web-app_2_3.dtd
    13107  09-01-2020 15:21   javax/servlet/jsp/resources/jsp_3_0.xsd
    22403  09-01-2020 15:21   javax/servlet/resources/javaee_web_services_1_2.xsd
    11675  09-01-2020 15:21   javax/servlet/resources/web-fragment_5_0.xsd
    35613  09-01-2020 15:21   javax/servlet/resources/web-app_2_4.xsd
     9877  09-01-2020 15:21   javax/servlet/resources/jsp_2_0.xsd
    25388  09-01-2020 15:21   javax/servlet/resources/javaee_web_services_client_1_3.xsd
     9497  09-01-2020 15:21   javax/servlet/resources/web-app_3_0.xsd
     8812  09-01-2020 15:21   javax/servlet/jsp/resources/jsp_2_0.xsd
    47158  09-01-2020 15:21   javax/servlet/resources/web-common_3_1.xsd
    45172  09-01-2020 15:21   javax/servlet/resources/j2ee_1_4.xsd
     9678  09-01-2020 15:21   javax/servlet/resources/j2ee_web_services_client_1_1.xsd
     3440  09-01-2020 15:21   javax/servlet/resources/jsp_2_1.xsd
    12747  09-01-2020 15:21   javax/servlet/resources/web-app_5_0.xsd
     2922  09-01-2020 15:21   javax/servlet/resources/xml.xsd
    31946  09-01-2020 15:21   javax/servlet/resources/web-jsptaglibrary_2_0.xsd
    37182  09-01-2020 15:21   javax/servlet/jsp/resources/web-jsptaglibrary_3_0.xsd
    98347  09-01-2020 15:21   javax/servlet/resources/jakartaee_9.xsd
    62285  09-01-2020 15:21   javax/servlet/resources/javaee_5.xsd
    10373  09-01-2020 15:21   javax/servlet/resources/web-jsptaglibrary_2_1.xsd
    19172  09-01-2020 15:21   javax/servlet/resources/jakartaee_web_services_2_0.xsd
     5815  09-01-2020 15:21   javax/servlet/resources/web-jsptaglibrary_1_1.dtd
    31466  09-01-2020 15:21   javax/servlet/jsp/resources/web-jsptaglibrary_2_1.xsd
     5559  09-01-2020 15:21   javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd
    50283  09-01-2020 15:21   javax/servlet/resources/web-common_3_0.xsd
    25150  09-01-2020 15:21   javax/servlet/resources/jakartaee_web_services_client_2_0.xsd
    37018  09-01-2020 15:21   javax/servlet/resources/web-app_2_5.xsd
    14566  09-01-2020 15:21   javax/servlet/resources/jsp_2_3.xsd
    37182  09-01-2020 15:21   javax/servlet/resources/web-jsptaglibrary_3_0.xsd
    10043  09-01-2020 15:21   javax/servlet/jsp/resources/jsp_2_1.xsd
    13161  09-01-2020 15:21   javax/servlet/jsp/resources/jsp_2_3.xsd
    11605  09-01-2020 15:21   javax/servlet/resources/web-fragment_4_0.xsd
    46601  09-01-2020 15:21   javax/servlet/resources/web-common_5_0.xsd
    11610  09-01-2020 15:21   javax/servlet/resources/web-fragment_3_1.xsd
    79526  09-01-2020 15:21   javax/servlet/resources/javaee_6.xsd
    11210  09-01-2020 15:21   javax/servlet/resources/web-app_3_1.xsd
    17109  09-01-2020 15:21   javax/servlet/jsp/resources/jspxml_2_0.xsd
     5622  09-01-2020 15:21   javax/servlet/jsp/resources/jspxml_2_0.dtd

@iamsanjay
Copy link
Contributor

I don't see much difference between jakarta.servlet:jakarta.servlet-api and org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api except the old javax resource files which are part of toolchain, however because jakarta-api is at 6.0.0 and toolchain is on 5.0.2, with this change now core/server will be moved from EE9 to EE10.

@dsmiley
Copy link
Contributor Author

dsmiley commented Nov 6, 2025

(embarassed); I should have looked closer at precisely what the javax stuff was in that JAR; thanks Sanjay. Still... it seems wrong and likely problematic to include this JAR from EE 9 when we already have Servlet v6 JAR in the build, which is aligned with EE 10.

@iamsanjay
Copy link
Contributor

Yes toolchain is not even active anymore and no support for EE10 actually. So +1 to the change. And with this everything Jakarta related is EE10 now.

@iamsanjay
Copy link
Contributor

May be we should change the title of this PR.

=== Upgrade to Jetty 12.x and Jakarta namespace

Solr upgraded to Jetty 12.x from 10.x as Jetty 10 and 11 have reached end-of-life support. Jetty 12.x requires Java 17 or newer and is fully compatible with Solr's new minimum requirement of Java 21. This upgrade brings support for modern HTTP protocols and adopts the Jakarta EE 10 namespace. For more details, see https://webtide.com/jetty-12-has-arrived/.
This migration marks the point at which Solr no longer includes _any_ JAR with "javax" in it -- the Jakarta migration is complete.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not be valid anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one-liner command in the PR description validates this. And the adjacent PR #3839 improves the smoketester to validate it.

@dsmiley dsmiley changed the title SOLR-17069: Don't include javax.servlet API SOLR-17069: Don't include jetty-jakarta-servlet-api JAR (EE9) Nov 7, 2025
@dsmiley dsmiley merged commit 50808cd into apache:main Nov 7, 2025
4 of 6 checks passed
@dsmiley dsmiley deleted the SOLR-17069-noJavaxServlet branch November 7, 2025 22:38
dsmiley added a commit that referenced this pull request Nov 9, 2025
…E9) (#3838)

We should not have this JAR org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api as it is for Jakarta EE 9, and it contains javax XSD definitions.  It also contains servlet classes for v5 that compete with jakarta servlet-api v6 that we already depend on in some places.

* Use mocking instead of implementing the entire HttpServletRequest and response interfaces.
* toml: remove unused jetty lib references
* NOTICE: the servlet references were obsolete.  The servlet JAR has it's own license file, and isn't CDDL either.

(cherry picked from commit 50808cd)
dsmiley added a commit that referenced this pull request Nov 9, 2025
…E9) (#3838)

We should not have this JAR org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api as it is for Jakarta EE 9, and it contains javax XSD definitions.  It also contains servlet classes for v5 that compete with jakarta servlet-api v6 that we already depend on in some places.

* Use mocking instead of implementing the entire HttpServletRequest and response interfaces.
* toml: remove unused jetty lib references
* NOTICE: the servlet references were obsolete.  The servlet JAR has it's own license file, and isn't CDDL either.

(cherry picked from commit 50808cd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants