Repository: sqoop Updated Branches: refs/heads/sqoop2 54e197cef -> 0ea90d024
SQOOP-2610: Sqoop2: Tomcat related code should be cleanup (Colin Ma via Jarek Jarcec Cecho) Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/0ea90d02 Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/0ea90d02 Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/0ea90d02 Branch: refs/heads/sqoop2 Commit: 0ea90d024fbf164cffacfc752e94a665f8477c38 Parents: 54e197c Author: Jarek Jarcec Cecho <[email protected]> Authored: Fri Oct 9 11:42:50 2015 -0700 Committer: Jarek Jarcec Cecho <[email protected]> Committed: Fri Oct 9 11:42:50 2015 -0700 ---------------------------------------------------------------------- .../sqoop/core/ConfigurationConstants.java | 5 - dist/pom.xml | 4 - dist/src/main/server/bin/setenv.bat | 17 -- dist/src/main/server/bin/setenv.sh | 28 --- dist/src/main/server/conf/catalina.properties | 89 --------- dist/src/main/server/conf/server.xml | 147 -------------- dist/src/main/server/conf/sqoop.properties | 186 ----------------- .../main/server/conf/sqoop_bootstrap.properties | 38 ---- .../main/server/webapps/ROOT/WEB-INF/web.xml | 29 --- dist/src/main/server/webapps/ROOT/index.html | 24 --- pom.xml | 21 -- .../apache/sqoop/server/ServerInitializer.java | 8 - test/pom.xml | 5 - .../minicluster/TomcatSqoopMiniCluster.java | 199 ------------------- .../sqoop/test/testcases/ConnectorTestCase.java | 2 +- tomcat/pom.xml | 46 ----- .../apache/sqoop/tomcat/TomcatToolRunner.java | 80 -------- .../java/org/apache/sqoop/tools/ToolRunner.java | 3 - 18 files changed, 1 insertion(+), 930 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/core/src/main/java/org/apache/sqoop/core/ConfigurationConstants.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/sqoop/core/ConfigurationConstants.java b/core/src/main/java/org/apache/sqoop/core/ConfigurationConstants.java index af53acb..f49fca3 100644 --- a/core/src/main/java/org/apache/sqoop/core/ConfigurationConstants.java +++ b/core/src/main/java/org/apache/sqoop/core/ConfigurationConstants.java @@ -86,11 +86,6 @@ public final class ConfigurationConstants { */ public static final String JOB_CLASSPATH = "org.apache.sqoop.classpath.job"; - /** - * Enable Sqoop App to kill Tomcat in case that it will fail to load. - */ - public static final String KILL_TOMCAT_ON_FAILURE = "sqoop.kill_tomcat_on_load_failure"; - private ConfigurationConstants() { // Disable explicit object creation } http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/dist/pom.xml ---------------------------------------------------------------------- diff --git a/dist/pom.xml b/dist/pom.xml index ff18487..315a018 100644 --- a/dist/pom.xml +++ b/dist/pom.xml @@ -45,10 +45,6 @@ limitations under the License. <groupId>org.apache.sqoop</groupId> <artifactId>sqoop-shell</artifactId> </dependency> - <dependency> - <groupId>org.apache.sqoop</groupId> - <artifactId>sqoop-tomcat</artifactId> - </dependency> </dependencies> <profiles> http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/dist/src/main/server/bin/setenv.bat ---------------------------------------------------------------------- diff --git a/dist/src/main/server/bin/setenv.bat b/dist/src/main/server/bin/setenv.bat deleted file mode 100644 index a4d2bcc..0000000 --- a/dist/src/main/server/bin/setenv.bat +++ /dev/null @@ -1,17 +0,0 @@ -:: -:: 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. -:: -set JAVA_OPTS=-Dsqoop.config.dir=%~dp0 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/dist/src/main/server/bin/setenv.sh ---------------------------------------------------------------------- diff --git a/dist/src/main/server/bin/setenv.sh b/dist/src/main/server/bin/setenv.sh deleted file mode 100755 index 815c974..0000000 --- a/dist/src/main/server/bin/setenv.sh +++ /dev/null @@ -1,28 +0,0 @@ -# -# 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. -# - -# Set Sqoop specific environment variables here - -JAVA_OPTS="$JAVA_OPTS -Dsqoop.config.dir=`dirname $0`/../conf" - -# The port Sqoop server runs -# -# export SQOOP_HTTP_PORT=12000 - -# Sqoop Admin port -# -# export SQOOP_ADMIN_PORT=12001 http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/dist/src/main/server/conf/catalina.properties ---------------------------------------------------------------------- diff --git a/dist/src/main/server/conf/catalina.properties b/dist/src/main/server/conf/catalina.properties deleted file mode 100644 index 5e201be..0000000 --- a/dist/src/main/server/conf/catalina.properties +++ /dev/null @@ -1,89 +0,0 @@ -# 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. - -# -# List of comma-separated packages that start with or equal this string -# will cause a security exception to be thrown when -# passed to checkPackageAccess unless the -# corresponding RuntimePermission ("accessClassInPackage."+package) has -# been granted. -package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans. -# -# List of comma-separated packages that start with or equal this string -# will cause a security exception to be thrown when -# passed to checkPackageDefinition unless the -# corresponding RuntimePermission ("defineClassInPackage."+package) has -# been granted. -# -# by default, no packages are restricted for definition, and none of -# the class loaders supplied with the JDK call checkPackageDefinition. -# -package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper. - -# -# -# List of comma-separated paths defining the contents of the "common" -# classloader. Prefixes should be used to define what is the repository type. -# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute. -# If left as blank,the JVM system loader will be used as Catalina's "common" -# loader. -# Examples: -# "foo": Add this folder as a class repository -# "foo/*.jar": Add all the JARs of the specified folder as class -# repositories -# "foo/bar.jar": Add bar.jar as a class repository -# -# Sqoop Comment: -# You need set Hadoop and Hive dependencies in this property. Please check out -# Sqoop installation guide for more details. -# -# Example (based on default BigTop locations): -#common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/../lib/*.jar,/usr/lib/hadoop/*.jar,/usr/lib/hadoop/lib/*.jar,/usr/lib/hadoop-hdfs/*.jar,/usr/lib/hadoop-hdfs/lib/*.jar,/usr/lib/hadoop-mapreduce/*.jar,/usr/lib/hadoop-mapreduce/lib/*.jar,/usr/lib/hadoop-yarn/*.jar,/usr/lib/hadoop-yarn/lib/*.jar,/usr/lib/hive/lib/*.jar -# -common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/../lib/*.jar,/usr/lib/hadoop/*.jar,/usr/lib/hadoop/lib/*.jar,/usr/lib/hadoop-hdfs/*.jar,/usr/lib/hadoop-hdfs/lib/*.jar,/usr/lib/hadoop-mapreduce/*.jar,/usr/lib/hadoop-mapreduce/lib/*.jar,/usr/lib/hadoop-yarn/*.jar,/usr/lib/hadoop-yarn/lib/*.jar,/usr/lib/hive/lib/*.jar - -# -# List of comma-separated paths defining the contents of the "server" -# classloader. Prefixes should be used to define what is the repository type. -# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute. -# If left as blank, the "common" loader will be used as Catalina's "server" -# loader. -# Examples: -# "foo": Add this folder as a class repository -# "foo/*.jar": Add all the JARs of the specified folder as class -# repositories -# "foo/bar.jar": Add bar.jar as a class repository -server.loader= - -# -# List of comma-separated paths defining the contents of the "shared" -# classloader. Prefixes should be used to define what is the repository type. -# Path may be relative to the CATALINA_BASE path or absolute. If left as blank, -# the "common" loader will be used as Catalina's "shared" loader. -# Examples: -# "foo": Add this folder as a class repository -# "foo/*.jar": Add all the JARs of the specified folder as class -# repositories -# "foo/bar.jar": Add bar.jar as a class repository -# Please note that for single jars, e.g. bar.jar, you need the URL form -# starting with file:. -shared.loader= - -# -# String cache configuration. -tomcat.util.buf.StringCache.byte.enabled=true -#tomcat.util.buf.StringCache.char.enabled=true -#tomcat.util.buf.StringCache.trainThreshold=500000 -#tomcat.util.buf.StringCache.cacheSize=5000 http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/dist/src/main/server/conf/server.xml ---------------------------------------------------------------------- diff --git a/dist/src/main/server/conf/server.xml b/dist/src/main/server/conf/server.xml deleted file mode 100644 index a946da4..0000000 --- a/dist/src/main/server/conf/server.xml +++ /dev/null @@ -1,147 +0,0 @@ -<?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. ---> -<!-- Note: A "Server" is not itself a "Container", so you may not - define subcomponents such as "Valves" at this level. - Documentation at /docs/config/server.html - --> -<Server port="${sqoop.admin.port}" shutdown="SHUTDOWN"> - - <!--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" /> - <!-- Prevent memory leaks due to use of particular java/javax APIs--> - <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> - <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html --> - <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" /> - <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> - - <!-- Global JNDI resources - Documentation at /docs/jndi-resources-howto.html - --> - <GlobalNamingResources> - <!-- Editable user database that can also be used by - UserDatabaseRealm to authenticate users - --> - <Resource name="UserDatabase" auth="Container" - 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" /> - </GlobalNamingResources> - - <!-- A "Service" is a collection of one or more "Connectors" that share - a single "Container" Note: A "Service" is not itself a "Container", - so you may not define subcomponents such as "Valves" at this level. - Documentation at /docs/config/service.html - --> - <Service name="Catalina"> - - <!--The connectors can use a shared executor, you can define one or more named thread pools--> - <!-- - <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" - maxThreads="150" minSpareThreads="4"/> - --> - - - <!-- 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 AJP Connector: /docs/config/ajp.html - APR (HTTP/AJP) Connector: /docs/apr.html - Define a non-SSL HTTP/1.1 Connector on port 8080 - --> - <Connector port="${sqoop.http.port}" protocol="HTTP/1.1" - connectionTimeout="20000" - redirectPort="8443" /> - <!-- A "Connector" using the shared thread pool--> - <!-- - <Connector executor="tomcatThreadPool" - port="8080" protocol="HTTP/1.1" - connectionTimeout="20000" - redirectPort="8443" /> - --> - <!-- Define a SSL HTTP/1.1 Connector on port 8443 - This connector uses the JSSE configuration, when using APR, the - connector should be using the OpenSSL style configuration - described in the APR documentation --> - <!-- - <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" - maxThreads="150" scheme="https" secure="true" - clientAuth="false" sslProtocol="TLS" /> - --> - - <!-- Define an AJP 1.3 Connector on port 8009 --> - - - <!-- An Engine represents the entry point (within Catalina) that processes - every request. The Engine implementation for Tomcat stand alone - analyzes the HTTP headers included with the request, and passes them - on to the appropriate Host (virtual host). - Documentation at /docs/config/engine.html --> - - <!-- You should set jvmRoute to support load-balancing via AJP ie : - <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> - --> - <Engine name="Catalina" defaultHost="localhost"> - - <!--For clustering, please take a look at documentation at: - /docs/cluster-howto.html (simple how to) - /docs/config/cluster.html (reference documentation) --> - <!-- - <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> - --> - - <!-- The request dumper valve dumps useful debugging information about - the request and response data received and sent by Tomcat. - Documentation at: /docs/config/valve.html --> - <!-- - <Valve className="org.apache.catalina.valves.RequestDumperValve"/> - --> - - <!-- This Realm uses the UserDatabase configured in the global JNDI - resources under the key "UserDatabase". Any edits - that are performed against this UserDatabase are immediately - available for use by the Realm. --> - <Realm className="org.apache.catalina.realm.UserDatabaseRealm" - resourceName="UserDatabase"/> - - <!-- Define the default virtual host - Note: XML Schema validation will not work with Xerces 2.2. - --> - <Host name="localhost" appBase="webapps" - unpackWARs="true" autoDeploy="true" - xmlValidation="false" xmlNamespaceAware="false"> - - <!-- SingleSignOn valve, share authentication between web applications - Documentation at: /docs/config/valve.html --> - <!-- - <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> - --> - - <!-- Access log processes all example. - Documentation at: /docs/config/valve.html --> - <!-- - <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" - prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/> - --> - - </Host> - </Engine> - </Service> -</Server> http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/dist/src/main/server/conf/sqoop.properties ---------------------------------------------------------------------- diff --git a/dist/src/main/server/conf/sqoop.properties b/dist/src/main/server/conf/sqoop.properties deleted file mode 100755 index d85e381..0000000 --- a/dist/src/main/server/conf/sqoop.properties +++ /dev/null @@ -1,186 +0,0 @@ -# -# 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. -# - -# -# Sqoop configuration file used by the built in configuration -# provider: org.apache.sqoop.core.PropertiesConfigurationProvider. -# This file must reside in the system configuration directory -# which is specified by the system property "sqoop.config.dir" -# and must be called sqoop.properties. -# -# NOTE: Tokens specified in this file that are marked by a -# leading and trailing '@' characters should be replaced by -# their appropriate values. For example, the token @LOGDIR@ -# should be replaced appropriately. -# -# The following tokens are used in this configuration file: -# -# LOGDIR -# The absolute path to the directory where system genearated -# log files will be kept. -# -# BASEDIR -# The absolute path to the directory where Sqoop 2 is installed -# - -# -# Logging Configuration -# Any property that starts with the prefix -# org.apache.sqoop.log4j is parsed out by the configuration -# system and passed to the log4j subsystem. This allows you -# to specify log4j configuration properties from within the -# Sqoop configuration. -# -org.apache.sqoop.log4j.appender.file=org.apache.log4j.RollingFileAppender -org.apache.sqoop.log4j.appender.file.File=@LOGDIR@/sqoop.log -org.apache.sqoop.log4j.appender.file.MaxFileSize=25MB -org.apache.sqoop.log4j.appender.file.MaxBackupIndex=5 -org.apache.sqoop.log4j.appender.file.layout=org.apache.log4j.PatternLayout -org.apache.sqoop.log4j.appender.file.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} [%l] %m%n -org.apache.sqoop.log4j.debug=true -org.apache.sqoop.log4j.rootCategory=WARN, file -org.apache.sqoop.log4j.category.org.apache.sqoop=DEBUG -org.apache.sqoop.log4j.category.org.apache.derby=INFO - -# -# Audit Loggers Configuration -# Multiple audit loggers could be given here. To specify an -# audit logger, you should at least add org.apache.sqoop. -# auditlogger.[LoggerName].class. You could also provide -# more configuration options by using org.apache.sqoop. -# auditlogger.[LoggerName] prefix, then all these options -# are parsed to the logger class. -# -org.apache.sqoop.auditlogger.default.class=org.apache.sqoop.audit.FileAuditLogger -org.apache.sqoop.auditlogger.default.file=@LOGDIR@/default.audit - -# -# Repository configuration -# The Repository subsystem provides the special prefix which -# is "org.apache.sqoop.repository.sysprop". Any property that -# is specified with this prefix is parsed out and set as a -# system property. For example, if the built in Derby repository -# is being used, the sysprop prefixed properties can be used -# to affect Derby configuration at startup time by setting -# the appropriate system properties. -# - -# Repository provider -org.apache.sqoop.repository.provider=org.apache.sqoop.repository.JdbcRepositoryProvider - -# Repository upgrade -# If set to true, it will not upgrade the sqoop respository schema, by default it will iniate the upgrade on server start-up -org.apache.sqoop.repository.schema.immutable=false - -# JDBC repository provider configuration -org.apache.sqoop.repository.jdbc.handler=org.apache.sqoop.repository.derby.DerbyRepositoryHandler -org.apache.sqoop.repository.jdbc.transaction.isolation=READ_COMMITTED -org.apache.sqoop.repository.jdbc.maximum.connections=10 -org.apache.sqoop.repository.jdbc.url=jdbc:derby:@BASEDIR@/repository/db;create=true -org.apache.sqoop.repository.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver -org.apache.sqoop.repository.jdbc.user=sa -org.apache.sqoop.repository.jdbc.password= - -# System properties for embedded Derby configuration -org.apache.sqoop.repository.sysprop.derby.stream.error.file=@LOGDIR@/derbyrepo.log - -# -# Sqoop Connector configuration -# If set to true will initiate Connectors config upgrade during server startup -# -org.apache.sqoop.connector.autoupgrade=false - -# -# Sqoop Driver configuration -# If set to true will initiate the Driver config upgrade during server startup -# -org.apache.sqoop.driver.autoupgrade=false - -# Sleeping period for reloading configuration file (once a minute) -org.apache.sqoop.core.configuration.provider.properties.sleep=60000 - -# -# Submission engine configuration -# - -# Submission engine class -org.apache.sqoop.submission.engine=org.apache.sqoop.submission.mapreduce.MapreduceSubmissionEngine - -# Number of milliseconds, submissions created before this limit will be removed, default is one day -#org.apache.sqoop.submission.purge.threshold= - -# Number of milliseconds for purge thread to sleep, by default one day -#org.apache.sqoop.submission.purge.sleep= - -# Number of milliseconds for update thread to sleep, by default 5 minutes -#org.apache.sqoop.submission.update.sleep= - -# -# Configuration for Mapreduce submission engine (applicable if it's configured) -# - -# Hadoop configuration directory -org.apache.sqoop.submission.engine.mapreduce.configuration.directory=/etc/hadoop/conf/ - -# -# Execution engine configuration -# -org.apache.sqoop.execution.engine=org.apache.sqoop.execution.mapreduce.MapreduceExecutionEngine - -# -# Authentication configuration -# -#org.apache.sqoop.security.authentication.type=SIMPLE -#org.apache.sqoop.security.authentication.handler=org.apache.sqoop.security.authentication.SimpleAuthenticationHandler -#org.apache.sqoop.security.authentication.anonymous=true -#org.apache.sqoop.security.authentication.type=KERBEROS -#org.apache.sqoop.security.authentication.handler=org.apache.sqoop.security.authentication.KerberosAuthenticationHandler -#org.apache.sqoop.security.authentication.kerberos.principal=sqoop/_HOST@NOVALOCAL -#org.apache.sqoop.security.authentication.kerberos.keytab=/home/kerberos/sqoop.keytab -#org.apache.sqoop.security.authentication.kerberos.http.principal=HTTP/_HOST@NOVALOCAL -#org.apache.sqoop.security.authentication.kerberos.http.keytab=/home/kerberos/sqoop.keytab -#org.apache.sqoop.security.authentication.enable.doAs=true -#org.apache.sqoop.security.authentication.proxyuser.#USER#.users=* -#org.apache.sqoop.security.authentication.proxyuser.#USER#.groups=* -#org.apache.sqoop.security.authentication.proxyuser.#USER#.hosts=* - -# Default user, default value is "sqoop.anonymous.user" -#org.apache.sqoop.security.authentication.default.user= - -# -# Authorization configuration -# -#org.apache.sqoop.security.authorization.handler=org.apache.sqoop.security.authorization.DefaultAuthorizationHandler -#org.apache.sqoop.security.authorization.access_controller=org.apache.sqoop.security.authorization.DefaultAuthorizationAccessController -#org.apache.sqoop.security.authorization.validator=org.apache.sqoop.security.authorization.DefaultAuthorizationValidator -#org.apache.sqoop.security.authorization.authentication_provider=org.apache.sqoop.security.authorization.DefaultAuthenticationProvider -#org.apache.sqoop.security.authorization.server_name=SqoopServer1 - -# External connectors load path -# "/path/to/external/connectors/": Add all the connector JARs in the specified folder -# -org.apache.sqoop.connector.external.loadpath= - -# Sqoop application classpath -# ":" separated list of jars to be included in sqoop. -# -org.apache.sqoop.classpath.extra= - -# Sqoop extra classpath to be included with all jobs -# ":" separated list of jars to be included in map job classpath. -# -org.apache.sqoop.classpath.job= http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/dist/src/main/server/conf/sqoop_bootstrap.properties ---------------------------------------------------------------------- diff --git a/dist/src/main/server/conf/sqoop_bootstrap.properties b/dist/src/main/server/conf/sqoop_bootstrap.properties deleted file mode 100755 index 6e74bd3..0000000 --- a/dist/src/main/server/conf/sqoop_bootstrap.properties +++ /dev/null @@ -1,38 +0,0 @@ -# -# 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. -# - -# -# Bootstrap configuration for Sqoop. This file is picked up -# from the directory specified by the system property -# "sqoop.config.dir". Sqoop will not boot up if this property -# is not set, or if there is no file by the name -# "sqoop_bootstrap.properties" in the directory pointed by -# this system property. -# - -# -# Specifies the configuration provider to be used. -# This is a required configuration that must be specified. -# The default value for this is: -# org.apache.sqoop.core.PropertiesConfigurationProvider -# The PropertiesConfigurationProvider expects the system -# configuration directory to be specified by the system -# property "sqoop.config.dir", and it must contain a file -# by the name "sqoop.properties". -# -sqoop.config.provider=org.apache.sqoop.core.PropertiesConfigurationProvider - http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/dist/src/main/server/webapps/ROOT/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/dist/src/main/server/webapps/ROOT/WEB-INF/web.xml b/dist/src/main/server/webapps/ROOT/WEB-INF/web.xml deleted file mode 100644 index 73cfa18..0000000 --- a/dist/src/main/server/webapps/ROOT/WEB-INF/web.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?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. ---> - -<web-app xmlns="http://java.sun.com/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee - http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" - version="3.0" - metadata-complete="true"> - - <display-name>ROOT</display-name> - -</web-app> http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/dist/src/main/server/webapps/ROOT/index.html ---------------------------------------------------------------------- diff --git a/dist/src/main/server/webapps/ROOT/index.html b/dist/src/main/server/webapps/ROOT/index.html deleted file mode 100644 index 4442532..0000000 --- a/dist/src/main/server/webapps/ROOT/index.html +++ /dev/null @@ -1,24 +0,0 @@ -<!DOCTYPE html> -<!-- - 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. ---> -<html> - <head><title>Apache Sqoop ROOT</title></head> - <body> - Apache Sqoop ROOT - </body> -</html> http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index e438113..ab505f4 100644 --- a/pom.xml +++ b/pom.xml @@ -105,10 +105,6 @@ limitations under the License. <powermock.version>1.5.6</powermock.version> <log4j.version>1.2.16</log4j.version> <servlet.version>2.5</servlet.version> - <cargo.version>1.3.2</cargo.version> - <tomcat.major.version>6</tomcat.major.version> - <tomcat.minor.version>0.37</tomcat.minor.version> - <tomcat.version>${tomcat.major.version}.${tomcat.minor.version}</tomcat.version> <jdbc.mysql.version>5.1.23</jdbc.mysql.version> <jdbc.postgresql.version>9.1-901.jdbc4</jdbc.postgresql.version> <jdbc.oracle.version>11.2.0.3</jdbc.oracle.version> @@ -399,11 +395,6 @@ limitations under the License. <version>${project.version}</version> </dependency> <dependency> - <groupId>org.apache.sqoop</groupId> - <artifactId>sqoop-tomcat</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-core</artifactId> <version>${hadoop.2.version}</version> @@ -546,11 +537,6 @@ limitations under the License. <version>${derby.version}</version> </dependency> <dependency> - <groupId>org.codehaus.cargo</groupId> - <artifactId>cargo-core-container-tomcat</artifactId> - <version>${cargo.version}</version> - </dependency> - <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${jdbc.mysql.version}</version> @@ -625,12 +611,6 @@ limitations under the License. <version>${kitesdk.version}</version> </dependency> <dependency> - <groupId>org.apache.tomcat</groupId> - <artifactId>catalina</artifactId> - <version>${tomcat.version}</version> - <scope>provided</scope> - </dependency> - <dependency> <groupId>org.apache.zookeeper</groupId> <artifactId>zookeeper</artifactId> <version>${zookeeper.version}</version> @@ -685,7 +665,6 @@ limitations under the License. <module>dist</module> <module>test</module> <module>tools</module> - <module>tomcat</module> </modules> <build> http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/server/src/main/java/org/apache/sqoop/server/ServerInitializer.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/sqoop/server/ServerInitializer.java b/server/src/main/java/org/apache/sqoop/server/ServerInitializer.java index 70bb6ee..d0eedc3 100644 --- a/server/src/main/java/org/apache/sqoop/server/ServerInitializer.java +++ b/server/src/main/java/org/apache/sqoop/server/ServerInitializer.java @@ -28,7 +28,6 @@ import javax.servlet.ServletContextListener; * Initializes the Sqoop server. This listener is also responsible for * cleaning up any resources occupied by the server during the system shutdown. */ [email protected]("DM_EXIT") public class ServerInitializer implements ServletContextListener { private static final Logger LOG = Logger.getLogger(ServerInitializer.class); @@ -41,13 +40,6 @@ public class ServerInitializer implements ServletContextListener { try { SqoopServer.initialize(); } catch (Throwable ex) { - // We are assuming that by default we are running as the only app inside - // the tomcat and hence we want to try kill entire tomcat on our load failure. - if("true".equals(System.getProperty(ConfigurationConstants.KILL_TOMCAT_ON_FAILURE, "true"))) { - LOG.error("Sqoop server failed to start", ex); - System.exit(1); - } - throw new RuntimeException("Sqoop server failed to start.", ex); } } http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/test/pom.xml ---------------------------------------------------------------------- diff --git a/test/pom.xml b/test/pom.xml index 54d54f4..ad8cd11 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -136,11 +136,6 @@ limitations under the License. </dependency> <dependency> - <groupId>org.codehaus.cargo</groupId> - <artifactId>cargo-core-container-tomcat</artifactId> - </dependency> - - <dependency> <groupId>org.apache.derby</groupId> <artifactId>derbynet</artifactId> </dependency> http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/test/src/main/java/org/apache/sqoop/test/minicluster/TomcatSqoopMiniCluster.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/sqoop/test/minicluster/TomcatSqoopMiniCluster.java b/test/src/main/java/org/apache/sqoop/test/minicluster/TomcatSqoopMiniCluster.java deleted file mode 100644 index a0ef78a..0000000 --- a/test/src/main/java/org/apache/sqoop/test/minicluster/TomcatSqoopMiniCluster.java +++ /dev/null @@ -1,199 +0,0 @@ -/** - * 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. - */ -package org.apache.sqoop.test.minicluster; - -import java.net.URL; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import org.apache.hadoop.conf.Configuration; -import org.apache.log4j.Logger; -import org.apache.sqoop.common.test.utils.NetworkUtils; -import org.codehaus.cargo.container.ContainerType; -import org.codehaus.cargo.container.InstalledLocalContainer; -import org.codehaus.cargo.container.configuration.ConfigurationType; -import org.codehaus.cargo.container.configuration.LocalConfiguration; -import org.codehaus.cargo.container.deployable.WAR; -import org.codehaus.cargo.container.installer.Installer; -import org.codehaus.cargo.container.installer.ZipURLInstaller; -import org.codehaus.cargo.container.property.ServletPropertySet; -import org.codehaus.cargo.container.tomcat.TomcatPropertySet; -import org.codehaus.cargo.generic.DefaultContainerFactory; -import org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory; - -/** - * Embedded tomcat Sqoop server mini cluster. - * - * This mini cluster will start up embedded tomcat - */ -public class TomcatSqoopMiniCluster extends SqoopMiniCluster { - - private InstalledLocalContainer container = null; - private Integer port; - private Integer ajpPort; - - private static final Logger LOG = Logger.getLogger(TomcatSqoopMiniCluster.class); - - /** {@inheritDoc} */ - public TomcatSqoopMiniCluster(String temporaryPath) throws Exception { - super(temporaryPath); - port = NetworkUtils.findAvailablePort(); - ajpPort = NetworkUtils.findAvailablePort(); - } - - /** {@inheritDoc} */ - public TomcatSqoopMiniCluster(String temporaryPath, Configuration configuration) throws Exception { - super(temporaryPath, configuration); - port = NetworkUtils.findAvailablePort(); - ajpPort = NetworkUtils.findAvailablePort(); - } - - /** {@inheritDoc} */ - @Override - public void start() throws Exception { - // Container has already been started - if(container != null) { - return; - } - - prepareTemporaryPath(); - - // Source: http://cargo.codehaus.org/Functional+testing - String tomcatPath = getTemporaryPath() + "/tomcat"; - String extractPath = tomcatPath + "/extract"; - String confPath = tomcatPath + "/conf"; - - // TODO(jarcec): We should parametrize those paths, version, etc... - // Source: http://cargo.codehaus.org/Functional+testing - // Use null download path so that download path can be shared. - Installer installer = new ZipURLInstaller(new URL("http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37.zip"), null, extractPath); - installer.install(); - - LocalConfiguration configuration = (LocalConfiguration) new DefaultConfigurationFactory().createConfiguration("tomcat6x", ContainerType.INSTALLED, ConfigurationType.STANDALONE, confPath); - container = (InstalledLocalContainer) new DefaultContainerFactory().createContainer("tomcat6x", ContainerType.INSTALLED, configuration); - - // Set home to our installed tomcat instance - container.setHome(installer.getHome()); - - // Store tomcat logs into file as they are quite handy for debugging - container.setOutput(getTemporaryPath() + "/log/tomcat.log"); - - // Propagate system properties to the container - Map<String, String> map = new HashMap<String, String>((Map) System.getProperties()); - container.setSystemProperties(map); - - // Set the timeout for the container, the default value will cause the - // problem described in SQOOP-2474 - container.setTimeout(600000L); - - // Propagate Hadoop jars to the container classpath - // In real world, they would be installed manually by user - List<String> extraClassPath = new LinkedList<String>(); - String []classpath = System.getProperty("java.class.path").split(":"); - for(String jar : classpath) { - if(jar.contains("hadoop-") || // Hadoop jars - jar.contains("hive-") || // Hive jars - jar.contains("commons-") || // Apache Commons libraries - jar.contains("httpcore-") || // Apache Http Core libraries - jar.contains("httpclient-") || // Apache Http Client libraries - jar.contains("htrace-") || // htrace-core libraries, new added in Hadoop 2.6.0 - jar.contains("zookeeper-") || // zookeeper libraries, new added in Hadoop 2.6.0 - jar.contains("curator-") || // curator libraries, new added in Hadoop 2.6.0 - jar.contains("log4j-") || // Log4j - jar.contains("slf4j-") || // Slf4j - jar.contains("jackson-") || // Jackson - jar.contains("derby") || // Derby drivers - jar.contains("avro-") || // Avro - jar.contains("parquet-") || // Parquet - jar.contains("mysql") || // MySQL JDBC driver - jar.contains("postgre") || // PostgreSQL JDBC driver - jar.contains("oracle") || // Oracle driver - jar.contains("terajdbc") || // Teradata driver - jar.contains("tdgs") || // Teradata driver - jar.contains("nzjdbc") || // Netezza driver - jar.contains("sqljdbc") || // Microsoft SQL Server driver - jar.contains("libfb303") || // Facebook thrift lib - jar.contains("datanucleus-") || // Data nucleus libs - jar.contains("google") || // Google libraries (guava, ...) - jar.contains("joda-time") || // Joda time - jar.contains("aws-java-sdk") // Amazon AWS SDK (S3, ...) - ) { - extraClassPath.add(jar); - } - } - - container.setExtraClasspath(extraClassPath.toArray(new String[extraClassPath.size()])); - - // Finally deploy Sqoop server war file - configuration.addDeployable(new WAR("../server/target/sqoop.war")); - - // Random port - configuration.setProperty(ServletPropertySet.PORT, port.toString()); - configuration.setProperty(TomcatPropertySet.AJP_PORT, ajpPort.toString()); - - // Start Sqoop server - LOG.info("Tomcat extract path: " + extractPath); - LOG.info("Tomcat home path: " + installer.getHome()); - LOG.info("Tomcat config home path: " + confPath); - LOG.info("Starting tomcat server on port " + port); - container.start(); - } - - /** {@inheritDoc} */ - @Override - public void stop() throws Exception { - container.stop(); - container = null; - } - - - /** - * Return properties for logger configuration. - * - * Tomcat implementation will log into log file instead of console. - * - * @return - */ - protected Map<String, String> getLoggerConfiguration() { - Map<String, String> properties = new HashMap<String, String>(); - - properties.put("org.apache.sqoop.log4j.appender.file", "org.apache.log4j.RollingFileAppender"); - properties.put("org.apache.sqoop.log4j.appender.file.File", getLogPath() + "sqoop.log"); - properties.put("org.apache.sqoop.log4j.appender.file.MaxFileSize", "25MB"); - properties.put("org.apache.sqoop.log4j.appender.file.MaxBackupIndex", "5"); - properties.put("org.apache.sqoop.log4j.appender.file.layout", "org.apache.log4j.PatternLayout"); - properties.put("org.apache.sqoop.log4j.appender.file.layout.ConversionPattern", "%d{ISO8601} %-5p %c{2} [%l] %m%n\\n"); - properties.put("org.apache.sqoop.log4j.debug", "true"); - properties.put("org.apache.sqoop.log4j.rootCategory", "WARN, file"); - properties.put("org.apache.sqoop.log4j.category.org.apache.sqoop", "DEBUG"); - properties.put("org.apache.sqoop.log4j.category.org.apache.derby", "INFO"); - - return properties; - } - - /** - * Return server URL. - */ - @Override - public String getServerUrl() { - // We're not doing any changes, so return default URL - return "http://localhost:" + port + "/sqoop/"; - } -} http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/test/src/main/java/org/apache/sqoop/test/testcases/ConnectorTestCase.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/sqoop/test/testcases/ConnectorTestCase.java b/test/src/main/java/org/apache/sqoop/test/testcases/ConnectorTestCase.java index 5435ade..8e3d7df 100644 --- a/test/src/main/java/org/apache/sqoop/test/testcases/ConnectorTestCase.java +++ b/test/src/main/java/org/apache/sqoop/test/testcases/ConnectorTestCase.java @@ -44,7 +44,7 @@ import org.testng.annotations.BeforeSuite; /** * Base test case suitable for connector testing. * - * In addition to pure Tomcat based test case it will also create and initialize + * In addition to Jetty based test case it will also create and initialize * the database provider prior every test execution. */ @edu.umd.cs.findbugs.annotations.SuppressWarnings({"MS_PKGPROTECT", "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"}) http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/tomcat/pom.xml ---------------------------------------------------------------------- diff --git a/tomcat/pom.xml b/tomcat/pom.xml deleted file mode 100644 index 3eb150b..0000000 --- a/tomcat/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0"?> -<!-- -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. ---> -<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache</groupId> - <artifactId>sqoop</artifactId> - <version>2.0.0-SNAPSHOT</version> - </parent> - - <groupId>org.apache.sqoop</groupId> - <artifactId>sqoop-tomcat</artifactId> - <name>Sqoop Tomcat additions</name> - - <dependencies> - - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.tomcat</groupId> - <artifactId>catalina</artifactId> - </dependency> - - </dependencies> -</project> http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/tomcat/src/main/java/org/apache/sqoop/tomcat/TomcatToolRunner.java ---------------------------------------------------------------------- diff --git a/tomcat/src/main/java/org/apache/sqoop/tomcat/TomcatToolRunner.java b/tomcat/src/main/java/org/apache/sqoop/tomcat/TomcatToolRunner.java deleted file mode 100644 index 75d4d10..0000000 --- a/tomcat/src/main/java/org/apache/sqoop/tomcat/TomcatToolRunner.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * 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. - */ -package org.apache.sqoop.tomcat; - -import org.apache.catalina.Host; -import org.apache.catalina.startup.Bootstrap; -import org.apache.catalina.startup.ClassLoaderFactory; -import org.apache.catalina.startup.Embedded; -import org.apache.catalina.startup.ExpandWar; - -import java.io.File; -import java.lang.reflect.Method; -import java.net.URL; - -/** - * Add Sqoop webapp and common loader into the classpath and run the usual ToolRunner. - * - * This class will be executed via Tomcat Tool mechanism that do a lot of heavy - * lifting for us - it will set up most of the environment and class loaders. Sadly - * it won't setup the common.loader (Hadoop dependencies) and the Sqoop webapp itself. - */ -public class TomcatToolRunner { - - // TODO: The appBase can be loaded from the conf/server.xml file - private static String PROPERTY_APPBASE_PATH = "org.apache.sqoop.tomcat.webapp.path"; - private static String DEFAULT_APPBASE_PATH = "webapps"; - - public static void main(String[] args) throws Exception { - // Using Boostrap class to boot the common.loader and other catalina specific - // class loaders. - Bootstrap bootstrap = new Bootstrap(); - bootstrap.init(); - - // Now we need to add the sqoop webapp classes into the class loader. Sadly - // we have to do a lot of things ourselves. The procedure is: - // 1) Unpack Sqoop war file - // 2) Build the ClassLoader using Tomcat's ClassLoaderFactory - - // Various paths to war file and locations inside the war file - String webappPath = System.getProperty(PROPERTY_APPBASE_PATH, DEFAULT_APPBASE_PATH); - String catalinaBase = Bootstrap.getCatalinaBase(); - String fullWebappPath = catalinaBase + File.separator + webappPath; - String fullSqoopWarPath = fullWebappPath + File.separator + "sqoop.war"; - String fullSqoopClassesPath = fullWebappPath + File.separator + "sqoop" + File.separator + "WEB-INF" + File.separator + "classes"; - String fullSqoopLibPath = fullWebappPath + File.separator + "sqoop" + File.separator + "WEB-INF" + File.separator + "lib"; - - // Expand the war into the usual location, this operation is idempotent (nothing bad happens if it's already expanded) - Embedded embedded = new Embedded(); - Host host = embedded.createHost("Sqoop Tool Virtual Host", fullWebappPath); - ExpandWar.expand(host, new URL("jar:file://" + fullSqoopWarPath + "!/")); - - // We have expanded war file, so we build the classloader from - File [] unpacked = new File[1]; unpacked[0] = new File(fullSqoopClassesPath); - File [] packed = new File[1]; packed[0] = new File(fullSqoopLibPath); - ClassLoader loader = ClassLoaderFactory.createClassLoader(unpacked, packed, Thread.currentThread().getContextClassLoader()); - Thread.currentThread().setContextClassLoader(loader); - - // Finally we can call the usual ToolRunner. We have to use reflection as - // as the time of loading this class, Sqoop dependencies are not on classpath. - Class klass = Class.forName("org.apache.sqoop.tools.ToolRunner", true, loader); - Method method = klass.getMethod("main", String[].class); - method.invoke(null, (Object)args); - } - -} http://git-wip-us.apache.org/repos/asf/sqoop/blob/0ea90d02/tools/src/main/java/org/apache/sqoop/tools/ToolRunner.java ---------------------------------------------------------------------- diff --git a/tools/src/main/java/org/apache/sqoop/tools/ToolRunner.java b/tools/src/main/java/org/apache/sqoop/tools/ToolRunner.java index f6a84e3..ae6064b 100644 --- a/tools/src/main/java/org/apache/sqoop/tools/ToolRunner.java +++ b/tools/src/main/java/org/apache/sqoop/tools/ToolRunner.java @@ -68,9 +68,6 @@ public final class ToolRunner { throw new RuntimeException("Can't get tool instance: " + args[0]); } - // We do want us to kill the Tomcat when running from tooling - System.setProperty(ConfigurationConstants.KILL_TOMCAT_ON_FAILURE, "false"); - System.out.println("Running tool: " + toolClass); if(tool.runTool(Arrays.copyOfRange(args, 1, args.length))) { System.out.println("Tool " + toolClass + " has finished correctly.");
