Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-8246 Java 11/17 Support and Testing
  3. HDDS-8280

[Discussion][JDK17] Bump jetty from 9.4.x to 11.x/12.x

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Hundles:

      1. Upgrading jetty to 10.x or higher means ditching support for JDK 8. 10.x or 11.x requires JDK 11 to compile and run. 12.x requires JDK 17. See this: https://www.eclipse.org/jetty/download.php#version-table
      2. Community Support for Jetty 9.x has ended. There doesn't seem to have a plan to support JDK 17 in Jetty 9.4.x: https://github.com/eclipse/jetty.project/issues/9196. Unless there is another fork.
      3. Even if ditching JDK 8 is tolerable, some servlets (AdminAuthorizedServlet, HttpServer2) have to be manually migrated to accommodate new jetty. Here I attempted to compile with jetty 11.0.14 + Zulu JDK 17:

      [ERROR] COMPILATION ERROR :
      [INFO] -------------------------------------------------------------
      [ERROR] /Users/smeng/repo/ozone-master/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/AdminAuthorizedServlet.java:[36,3] method does not override or implement a method from a supertype
      [ERROR] /Users/smeng/repo/ozone-master/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/AdminAuthorizedServlet.java:[40,61] incompatible types: jakarta.servlet.ServletContext cannot be converted to javax.servlet.ServletContext
      [ERROR] /Users/smeng/repo/ozone-master/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/AdminAuthorizedServlet.java:[43,19] incompatible types: javax.servlet.http.HttpServletRequest cannot be converted to jakarta.servlet.http.HttpServletRequest
      [ERROR] /Users/smeng/repo/ozone-master/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpServer2.java:[575,69] incompatible types: org.eclipse.jetty.server.handler.ContextHandler.Context cannot be converted to javax.servlet.ServletContext
      [ERROR] /Users/smeng/repo/ozone-master/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpServer2.java:[834,30] no suitable constructor found for ServletHolder(java.lang.Class<com.sun.jersey.spi.container.servlet.ServletContainer>)
          constructor org.eclipse.jetty.servlet.ServletHolder.ServletHolder(org.eclipse.jetty.servlet.Source) is not applicable
            (argument mismatch; java.lang.Class<com.sun.jersey.spi.container.servlet.ServletContainer> cannot be converted to org.eclipse.jetty.servlet.Source)
          constructor org.eclipse.jetty.servlet.ServletHolder.ServletHolder(jakarta.servlet.Servlet) is not applicable
            (argument mismatch; java.lang.Class<com.sun.jersey.spi.container.servlet.ServletContainer> cannot be converted to jakarta.servlet.Servlet)
          constructor org.eclipse.jetty.servlet.ServletHolder.ServletHolder(java.lang.Class<? extends jakarta.servlet.Servlet>) is not applicable
            (argument mismatch; java.lang.Class<com.sun.jersey.spi.container.servlet.ServletContainer> cannot be converted to java.lang.Class<? extends jakarta.servlet.Servlet>)
      [ERROR] /Users/smeng/repo/ozone-master/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpServer2.java:[883,28] no suitable constructor found for ServletHolder(java.lang.Class<capture#1 of ? extends javax.servlet.http.HttpServlet>)
          constructor org.eclipse.jetty.servlet.ServletHolder.ServletHolder(org.eclipse.jetty.servlet.Source) is not applicable
            (argument mismatch; java.lang.Class<capture#1 of ? extends javax.servlet.http.HttpServlet> cannot be converted to org.eclipse.jetty.servlet.Source)
          constructor org.eclipse.jetty.servlet.ServletHolder.ServletHolder(jakarta.servlet.Servlet) is not applicable
            (argument mismatch; java.lang.Class<capture#1 of ? extends javax.servlet.http.HttpServlet> cannot be converted to jakarta.servlet.Servlet)
          constructor org.eclipse.jetty.servlet.ServletHolder.ServletHolder(java.lang.Class<? extends jakarta.servlet.Servlet>) is not applicable
            (argument mismatch; java.lang.Class<capture#1 of ? extends javax.servlet.http.HttpServlet> cannot be converted to java.lang.Class<? extends jakarta.servlet.Servlet>)
      [ERROR] /Users/smeng/repo/ozone-master/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpServer2.java:[957,30] no suitable constructor found for ServletHolder(java.lang.Class<capture#2 of ? extends javax.servlet.http.HttpServlet>)
          constructor org.eclipse.jetty.servlet.ServletHolder.ServletHolder(org.eclipse.jetty.servlet.Source) is not applicable
            (argument mismatch; java.lang.Class<capture#2 of ? extends javax.servlet.http.HttpServlet> cannot be converted to org.eclipse.jetty.servlet.Source)
          constructor org.eclipse.jetty.servlet.ServletHolder.ServletHolder(jakarta.servlet.Servlet) is not applicable
            (argument mismatch; java.lang.Class<capture#2 of ? extends javax.servlet.http.HttpServlet> cannot be converted to jakarta.servlet.Servlet)
          constructor org.eclipse.jetty.servlet.ServletHolder.ServletHolder(java.lang.Class<? extends jakarta.servlet.Servlet>) is not applicable
            (argument mismatch; java.lang.Class<capture#2 of ? extends javax.servlet.http.HttpServlet> cannot be converted to java.lang.Class<? extends jakarta.servlet.Servlet>)
      [INFO] 7 errors
      

      The last point could very well impact to Hadoop/HDFS's jetty usage as well. Though I have not seen anyone mentioning in it under HADOOP-17177 yet.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              smeng Siyao Meng
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: