You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by xx...@apache.org on 2022/04/29 02:31:58 UTC

[kylin] branch main updated: KYLIN-5178, upgrade tomcat to 8.5.78 (#1863)

This is an automated email from the ASF dual-hosted git repository.

xxyu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/main by this push:
     new fa8e0fccef KYLIN-5178, upgrade tomcat to 8.5.78 (#1863)
fa8e0fccef is described below

commit fa8e0fccefdaab37e93ff83e1f7d19f3af19f47d
Author: Tengting Xu <34...@users.noreply.github.com>
AuthorDate: Fri Apr 29 10:31:51 2022 +0800

    KYLIN-5178, upgrade tomcat to 8.5.78 (#1863)
    
    * KYLIN-5178, upgrade tomcat to 8.5.78
    
    * minor fix, comment the JasperListener which already removed from tomcat 8.0
---
 build/deploy/server.xml                              |  5 ++++-
 build/script/download-tomcat.sh                      |  6 +++---
 pom.xml                                              | 18 +++++++++++++++---
 .../main/java/org/apache/kylin/rest/DebugTomcat.java | 20 +++++++++++++++-----
 4 files changed, 37 insertions(+), 12 deletions(-)

diff --git a/build/deploy/server.xml b/build/deploy/server.xml
index aab07a01ee..3832c77c4c 100644
--- a/build/deploy/server.xml
+++ b/build/deploy/server.xml
@@ -26,7 +26,10 @@
     <!--APR library loader. Documentation at /docs/apr.html -->
     <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
     <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
-    <Listener className="org.apache.catalina.core.JasperListener" />
+
+    <!-- After Tomcat 8.0, JasperListener has been removed. Documentation at
+    https://tomcat.apache.org/tomcat-8.0-doc/changelog.html -->
+    <!-- <Listener className="org.apache.catalina.core.JasperListener" />-->
     <!-- Prevent memory leaks due to use of particular java/javax APIs-->
     <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
     <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
diff --git a/build/script/download-tomcat.sh b/build/script/download-tomcat.sh
index bc93a594ff..039f70b6d7 100755
--- a/build/script/download-tomcat.sh
+++ b/build/script/download-tomcat.sh
@@ -27,13 +27,13 @@ if [[ `uname -a` =~ "Darwin" ]]; then
     alias md5cmd="md5 -q"
 fi
 
-tomcat_pkg_version="7.0.100"
-tomcat_pkg_md5="79be4ba5a6e770730a4be3d5cb3c7862"
+tomcat_pkg_version="8.5.78"
+tomcat_pkg_md5="2e4752883c3082fad82fd17ba1f35b3a"
 
 if [ ! -f "build/apache-tomcat-${tomcat_pkg_version}.tar.gz" ]
 then
     echo "no binary file found"
-    wget --directory-prefix=build/ http://archive.apache.org/dist/tomcat/tomcat-7/v${tomcat_pkg_version}/bin/apache-tomcat-${tomcat_pkg_version}.tar.gz || echo "Download tomcat failed"
+    wget --directory-prefix=build/ http://archive.apache.org/dist/tomcat/tomcat-8/v${tomcat_pkg_version}/bin/apache-tomcat-${tomcat_pkg_version}.tar.gz || echo "Download tomcat failed"
 else
     if [ `md5cmd build/apache-tomcat-${tomcat_pkg_version}.tar.gz | awk '{print $1}'` != "${tomcat_pkg_md5}" ]
     then
diff --git a/pom.xml b/pom.xml
index 454bef9f5f..b96511c021 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,9 +7,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
      http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -154,7 +154,7 @@
     <cglib.version>3.2.4</cglib.version>
     <supercsv.version>2.4.0</supercsv.version>
     <cors.version>2.5</cors.version>
-    <tomcat.version>7.0.100</tomcat.version>
+    <tomcat.version>8.5.78</tomcat.version>
     <t-digest.version>3.1</t-digest.version>
     <freemarker.version>2.3.23</freemarker.version>
     <rocksdb.version>5.18.4</rocksdb.version>
@@ -696,11 +696,23 @@
         <groupId>org.apache.hive</groupId>
         <artifactId>hive-jdbc</artifactId>
         <version>${hive.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jaspic_1.0_spec</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.hive.hcatalog</groupId>
         <artifactId>hive-hcatalog-core</artifactId>
         <version>${hive-hcatalog.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jaspic_1.0_spec</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <!-- Yarn dependencies -->
       <dependency>
diff --git a/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java b/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java
index 047eaa2b78..fb893a2134 100644
--- a/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java
+++ b/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *     http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,13 +21,15 @@ package org.apache.kylin.rest;
 import org.apache.catalina.Context;
 import org.apache.catalina.core.AprLifecycleListener;
 import org.apache.catalina.core.StandardServer;
-import org.apache.catalina.deploy.ErrorPage;
+import org.apache.tomcat.JarScanner;
+import org.apache.tomcat.util.descriptor.web.ErrorPage;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.util.Shell;
 import org.apache.kylin.common.KylinConfig;
+import org.apache.tomcat.util.scan.StandardJarScanner;
 
 import java.io.File;
 import java.io.IOException;
@@ -52,8 +54,9 @@ public class DebugTomcat {
             System.setProperty("spring.profiles.active", "testing");
 
             //avoid log permission issue
-            if (System.getProperty("catalina.home") == null)
+            if (System.getProperty("catalina.home") == null) {
                 System.setProperty("catalina.home", ".");
+            }
 
             if (StringUtils.isEmpty(System.getProperty("hdp.version"))) {
                 System.setProperty("hdp.version", "2.4.0.0-169");
@@ -103,8 +106,9 @@ public class DebugTomcat {
         File[] files = new File(dir).listFiles();
         if (files != null) {
             for (File f : files) {
-                if (f.getName().matches(ptn))
+                if (f.getName().matches(ptn)) {
                     return f;
+                }
             }
         }
         return null;
@@ -144,6 +148,12 @@ public class DebugTomcat {
         server.addLifecycleListener(listener);
 
         Context webContext = tomcat.addWebapp("/kylin", webBase.getAbsolutePath());
+
+        // Higher 8.5.1 and above version of tomcat will scan the manifest default.
+        JarScanner jarScanner = webContext.getJarScanner();
+        if (jarScanner instanceof StandardJarScanner) {
+            ((StandardJarScanner) jarScanner).setScanManifest(false);
+        }
         ErrorPage notFound = new ErrorPage();
         notFound.setErrorCode(404);
         notFound.setLocation("/index.html");