Author: markt
Date: Thu Feb 21 22:15:06 2013
New Revision: 1448831
URL: http://svn.apache.org/r1448831
Log:
Disable scanning of the bootstrap classpath by default and remove the
jarsToSkip entries that were added to achieve the same objective
Modified:
tomcat/tc7.0.x/trunk/ (props changed)
tomcat/tc7.0.x/trunk/conf/catalina.properties
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
tomcat/tc7.0.x/trunk/webapps/docs/config/jar-scanner.xml
Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
Merged /tomcat/trunk:r1448826
Modified: tomcat/tc7.0.x/trunk/conf/catalina.properties
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/conf/catalina.properties?rev=1448831&r1=1448830&r2=1448831&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/conf/catalina.properties (original)
+++ tomcat/tc7.0.x/trunk/conf/catalina.properties Thu Feb 21 22:15:06 2013
@@ -87,9 +87,6 @@ shared.loader=
# - Jasper JARs
# - Tomcat JARs
# - Common non-Tomcat JARs
-# - Sun JDK JARs
-# - OpenJDK JARs
-# - Apple JDK JARs
tomcat.util.scan.DefaultJarScanner.jarsToSkip=\
bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,\
annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,\
@@ -109,14 +106,6 @@ geronimo-spec-jaxrpc*.jar,wsdl4j*.jar,\
ant.jar,ant-junit*.jar,aspectj*.jar,jmx.jar,h2*.jar,hibernate*.jar,httpclient*.jar,\
jmx-tools.jar,jta*.jar,log4j*.jar,mail*.jar,slf4j*.jar,\
xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,\
-access-bridge.jar,access-bridge-32.jar,access-bridge-64.jar,\
-dnsns.jar,jaccess.jar,ldapsec.jar,localedata.jar,\
-sunjce_provider.jar,sunmscapi.jar,sunpkcs11.jar,jhall.jar,tools.jar,\
-sunec.jar,zipfs.jar,\
-gnome-java-bridge.jar,pulse-java.jar,\
-apple_provider.jar,AppleScriptEngine.jar,CoreAudio.jar,dns_sd.jar,\
-j3daudio.jar,j3dcore.jar,j3dutils.jar,jai_core.jar,jai_codec.jar,\
-mlibwrapper_jai.jar,MRJToolkit.jar,vecmath.jar,\
junit.jar,junit-*.jar,ant-launcher.jar
# Additional JARs (over and above the default JARs listed above) to skip when
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java?rev=1448831&r1=1448830&r2=1448831&view=diff
==============================================================================
---
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java
(original)
+++
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java
Thu Feb 21 22:15:06 2013
@@ -109,6 +109,18 @@ public class StandardJarScanner implemen
}
/**
+ * Controls the testing of the bootstrap classpath which consists of the
+ * runtime classes provided by the JVM and any installed system extensions.
+ */
+ private boolean scanBootstrapClassPath = false;
+ public boolean isScanBootstrapClassPath() {
+ return scanBootstrapClassPath;
+ }
+ public void setScanBootstrapClassPath(boolean scanBootstrapClassPath) {
+ this.scanBootstrapClassPath = scanBootstrapClassPath;
+ }
+
+ /**
* Scan the provided ServletContext and classloader for JAR files. Each JAR
* file found will be passed to the callback handler to be processed.
*
@@ -184,7 +196,13 @@ public class StandardJarScanner implemen
ClassLoader loader =
Thread.currentThread().getContextClassLoader();
- while (loader != null) {
+ ClassLoader stopLoader = null;
+ if (!scanBootstrapClassPath) {
+ // Stop when we reach the bootstrap class loader
+ stopLoader = ClassLoader.getSystemClassLoader().getParent();
+ }
+
+ while (loader != stopLoader) {
if (loader instanceof URLClassLoader) {
URL[] urls = ((URLClassLoader) loader).getURLs();
for (int i=0; i<urls.length; i++) {
Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1448831&r1=1448830&r2=1448831&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Thu Feb 21 22:15:06 2013
@@ -72,6 +72,11 @@
the class hierarchy that triggered the exception to the error message.
(markt)
</add>
+ <add>
+ Add a new option to the standard JarScanner implementation
+ (<code>scanBootstrapClassPath</code>) to control if the bootstrap
+ classpath is scanned or not. By default, it will not be scanned.
(markt)
+ </add>
</changelog>
</subsection>
<subsection name="Web applications">
Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/jar-scanner.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/jar-scanner.xml?rev=1448831&r1=1448830&r2=1448831&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/config/jar-scanner.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/config/jar-scanner.xml Thu Feb 21
22:15:06 2013
@@ -77,10 +77,12 @@
<attributes>
- <attribute name="scanClassPath" required="false">
- <p>If true, the full web application classpath, including the shared and
- common classloaders will be scanned for Jar files in addition to the
- web application. The default is <code>true</code>.</p>
+ <attribute name="scanAllDirectories" required="false">
+ <p>If true, any directories found on the classpath will be checked to
see
+ if are expanded Jar files. The default is <code>false</code>. Tomcat
+ determines if directory is an expanded JAR file by looking for a
META-INF
+ sub-directory. Only if the META-INF sub-directory exists, is the
+ directory to be an expanded JAR file.</p>
</attribute>
<attribute name="scanAllFiles" required="false">
@@ -89,12 +91,17 @@
<code>.jar</code>. The default is <code>false</code></p>
</attribute>
- <attribute name="scanAllDirectories" required="false">
- <p>If true, any directories found on the classpath will be checked to
see
- if are expanded Jar files. The default is <code>false</code>. Tomcat
- determines if directory is an expanded JAR file by looking for a
META-INF
- sub-directory. Only if the META-INF sub-directory exists, is the
- directory to be an expanded JAR file.</p>
+ <attribute name="scanClassPath" required="false">
+ <p>If true, the full web application classpath, including the shared and
+ common classloaders and the system classpath (but not the bootstrap
+ classpath) will be scanned for Jar files in addition to the web
+ application. The default is <code>true</code>. </p>
+ </attribute>
+
+ <attribute name="scanBootstrapClassPath" required="false">
+ <p>If <code>scanClassPath</code> is true and this is true the bootstrap
+ classpath will also be scanned for Jar files. The default is
+ <code>false</code>.</p>
</attribute>
</attributes>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]