Repository: kylin Updated Branches: refs/heads/master f57348618 -> f267ba9dc
KYLIN-2361 Upgrade to Tomcat 8.5.9 Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/f267ba9d Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/f267ba9d Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/f267ba9d Branch: refs/heads/master Commit: f267ba9dcb3db317d07eb367ddff668e03291519 Parents: f573486 Author: Billy Liu <billy...@apache.org> Authored: Fri Jan 6 10:42:48 2017 +0800 Committer: Billy Liu <billy...@apache.org> Committed: Fri Jan 6 10:42:48 2017 +0800 ---------------------------------------------------------------------- build/deploy/context.xml | 47 ++++++------- build/deploy/server.xml | 72 +++++++++++++------- build/script/download-tomcat.sh | 14 ++-- pom.xml | 2 +- .../java/org/apache/kylin/rest/DebugTomcat.java | 10 +-- .../kylin/ext/CustomizedWebappClassloader.java | 5 +- 6 files changed, 82 insertions(+), 68 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/f267ba9d/build/deploy/context.xml ---------------------------------------------------------------------- diff --git a/build/deploy/context.xml b/build/deploy/context.xml index 5d1bedf..e8b4cf1 100644 --- a/build/deploy/context.xml +++ b/build/deploy/context.xml @@ -1,38 +1,31 @@ -<?xml version='1.0' encoding='utf-8'?> +<?xml version="1.0" encoding="UTF-8"?> <!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ 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. - ~ See the License for the specific language governing permissions and - ~ limitations under the License. - --> + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file 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. + See the License for the specific language governing permissions and + limitations under the License. +--> <!-- The contents of this file will be loaded for each web application --> <Context> - <!-- Default set of monitored resources --> + <!-- Default set of monitored resources. If one of these changes, the --> + <!-- web application will be reloaded. --> <WatchedResource>WEB-INF/web.xml</WatchedResource> + <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource> <!-- Uncomment this to disable session persistence across Tomcat restarts --> <!-- <Manager pathname="" /> --> - - <!-- Uncomment this to enable Comet connection tacking (provides events - on session expiration as well as webapp lifecycle) --> - <!-- - <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" /> - --> - <Loader loaderClass="org.apache.kylin.ext.CustomizedWebappClassloader"/> - -</Context> \ No newline at end of file +</Context> http://git-wip-us.apache.org/repos/asf/kylin/blob/f267ba9d/build/deploy/server.xml ---------------------------------------------------------------------- diff --git a/build/deploy/server.xml b/build/deploy/server.xml index 72a87d0..bea6146 100644 --- a/build/deploy/server.xml +++ b/build/deploy/server.xml @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='utf-8'?> +<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -20,17 +20,16 @@ Documentation at /docs/config/server.html --> <Server port="9005" shutdown="SHUTDOWN"> + <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> <!-- Security listener. Documentation at /docs/config/listeners.html <Listener className="org.apache.catalina.security.SecurityListener" /> --> <!--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"/> + <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> <!-- 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"/> - <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/> + <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> + <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> + <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> <!-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html @@ -43,7 +42,7 @@ type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" - pathname="conf/tomcat-users.xml"/> + pathname="conf/tomcat-users.xml" /> </GlobalNamingResources> <!-- A "Service" is a collection of one or more "Connectors" that share @@ -62,14 +61,14 @@ <!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : - Java HTTP Connector: /docs/config/http.html (blocking & non-blocking) + Java HTTP Connector: /docs/config/http.html Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html - Define a non-SSL HTTP/1.1 Connector on port 8080 + Define a non-SSL/TLS HTTP/1.1 Connector on port 8080 --> <Connector port="7070" protocol="HTTP/1.1" connectionTimeout="20000" - redirectPort="7443" + redirectPort="9443" compression="on" compressionMinSize="2048" noCompressionUserAgents="gozilla,traviata" @@ -82,21 +81,44 @@ connectionTimeout="20000" redirectPort="8443" /> --> - <!-- Define a SSL HTTP/1.1 Connector on port 8443 - This connector uses the BIO implementation that requires the JSSE - style configuration. When using the APR/native implementation, the - OpenSSL style configuration is required as described in the APR/native - documentation --> + <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 + This connector uses the NIO implementation. The default + SSLImplementation will depend on the presence of the APR/native + library and the useOpenSSL attribute of the + AprLifecycleListener. + Either JSSE or OpenSSL style configuration may be used regardless of + the SSLImplementation selected. JSSE style configuration is used below. + --> <!-- - <Connector port="7443" protocol="org.apache.coyote.http11.Http11Protocol" - maxThreads="150" SSLEnabled="true" scheme="https" secure="true" - keystoreFile="${user.home}/.keystore" keystorePass="" - clientAuth="false" sslProtocol="TLS" /> - + <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" + maxThreads="150" SSLEnabled="true"> + <SSLHostConfig> + <Certificate certificateKeystoreFile="conf/localhost-rsa.jks" + type="RSA" /> + </SSLHostConfig> + </Connector> + --> + <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2 + This connector uses the APR/native implementation which always uses + OpenSSL for TLS. + Either JSSE or OpenSSL style configuration may be used. OpenSSL style + configuration is used below. + --> + <!-- + <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol" + maxThreads="150" SSLEnabled="true" > + <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /> + <SSLHostConfig> + <Certificate certificateKeyFile="conf/localhost-rsa-key.pem" + certificateFile="conf/localhost-rsa-cert.pem" + certificateChainFile="conf/localhost-rsa-chain.pem" + type="RSA" /> + </SSLHostConfig> + </Connector> --> <!-- Define an AJP 1.3 Connector on port 8009 --> - <Connector port="9009" protocol="AJP/1.3" redirectPort="9443"/> + <Connector port="9009" protocol="AJP/1.3" redirectPort="9443" /> <!-- An Engine represents the entry point (within Catalina) that processes @@ -128,7 +150,7 @@ resourceName="UserDatabase"/> </Realm> - <Host name="localhost" appBase="webapps" + <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <!-- SingleSignOn valve, share authentication between web applications @@ -141,8 +163,8 @@ Documentation at: /docs/config/valve.html Note: The pattern used is equivalent to using pattern="common" --> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" - prefix="localhost_access_log." suffix=".txt" - pattern="%h %l %u %t "%r" %s %b"/> + prefix="localhost_access_log" suffix=".txt" + pattern="%h %l %u %t "%r" %s %b" /> </Host> </Engine> http://git-wip-us.apache.org/repos/asf/kylin/blob/f267ba9d/build/script/download-tomcat.sh ---------------------------------------------------------------------- diff --git a/build/script/download-tomcat.sh b/build/script/download-tomcat.sh index 9dd26f0..c97c3ce 100755 --- a/build/script/download-tomcat.sh +++ b/build/script/download-tomcat.sh @@ -27,22 +27,22 @@ if [[ `uname -a` =~ "Darwin" ]]; then alias md5cmd="md5 -q" fi -if [ ! -f "build/apache-tomcat-7.0.69.tar.gz" ] +if [ ! -f "build/apache-tomcat-8.5.9.tar.gz" ] then echo "no binary file found" - wget --directory-prefix=build/ http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.69/bin/apache-tomcat-7.0.69.tar.gz || echo "download tomcat failed" + wget --directory-prefix=build/ http://archive.apache.org/dist/tomcat/tomcat-8/v8.5.9/bin/apache-tomcat-8.5.9.tar.gz || echo "download tomcat failed" else - if [ `md5cmd build/apache-tomcat-7.0.69.tar.gz | awk '{print $1}'` != "10a071e5169a1a8b14ff35a0ad181052" ] + if [ `md5cmd build/apache-tomcat-8.5.9.tar.gz | awk '{print $1}'` != "b41270a64b7774c964e4bec813eea2ed" ] then echo "md5 check failed" - rm build/apache-tomcat-7.0.69.tar.gz - wget --directory-prefix=build/ http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.69/bin/apache-tomcat-7.0.69.tar.gz || echo "download tomcat failed" + rm build/apache-tomcat-8.5.9.tar.gz + wget --directory-prefix=build/ http://archive.apache.org/dist/tomcat/tomcat-8/v8.5.9/bin/apache-tomcat-8.5.9.tar.g || echo "download tomcat failed" fi fi unalias md5cmd -tar -zxvf build/apache-tomcat-7.0.69.tar.gz -C build/ -mv build/apache-tomcat-7.0.69 build/tomcat +tar -zxvf build/apache-tomcat-8.5.9.tar.gz -C build/ +mv build/apache-tomcat-8.5.9 build/tomcat rm -rf build/tomcat/webapps/* mv build/tomcat/conf/server.xml build/tomcat/conf/server.xml.bak http://git-wip-us.apache.org/repos/asf/kylin/blob/f267ba9d/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 0b323cf..1d47361 100644 --- a/pom.xml +++ b/pom.xml @@ -102,7 +102,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.69</tomcat.version> + <tomcat.version>8.5.9</tomcat.version> <!-- REST Service --> <spring.framework.version>3.2.17.RELEASE</spring.framework.version> http://git-wip-us.apache.org/repos/asf/kylin/blob/f267ba9d/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java ---------------------------------------------------------------------- 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 48cb91b..4f49402 100644 --- a/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java +++ b/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java @@ -18,18 +18,18 @@ package org.apache.kylin.rest; -import java.io.File; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; - 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.catalina.startup.Tomcat; import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.util.Shell; import org.apache.kylin.common.KylinConfig; +import org.apache.tomcat.util.descriptor.web.ErrorPage; + +import java.io.File; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; public class DebugTomcat { http://git-wip-us.apache.org/repos/asf/kylin/blob/f267ba9d/tomcat-ext/src/main/java/org/apache/kylin/ext/CustomizedWebappClassloader.java ---------------------------------------------------------------------- diff --git a/tomcat-ext/src/main/java/org/apache/kylin/ext/CustomizedWebappClassloader.java b/tomcat-ext/src/main/java/org/apache/kylin/ext/CustomizedWebappClassloader.java index 5116849..23bde2c 100644 --- a/tomcat-ext/src/main/java/org/apache/kylin/ext/CustomizedWebappClassloader.java +++ b/tomcat-ext/src/main/java/org/apache/kylin/ext/CustomizedWebappClassloader.java @@ -45,8 +45,7 @@ public class CustomizedWebappClassloader extends ParallelWebappClassLoader { * @param name class name * @return true if the class should be filtered */ - protected boolean filter(String name) { - + protected boolean filter(String name, boolean isClassName) { if (name == null) return false; @@ -63,7 +62,7 @@ public class CustomizedWebappClassloader extends ParallelWebappClassLoader { return true; } - return false; + return super.filter(name, isClassName); } }