Author: markt
Date: Thu Feb 21 22:07:45 2013
New Revision: 1448826

URL: http://svn.apache.org/r1448826
Log:
Disable scanning of the bootstrap classpath by default and remove the 
jarsToSkip entries that were added to achieve the same objective

Modified:
    tomcat/trunk/conf/catalina.properties
    tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java
    tomcat/trunk/webapps/docs/config/jar-scanner.xml

Modified: tomcat/trunk/conf/catalina.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/conf/catalina.properties?rev=1448826&r1=1448825&r2=1448826&view=diff
==============================================================================
--- tomcat/trunk/conf/catalina.properties (original)
+++ tomcat/trunk/conf/catalina.properties Thu Feb 21 22:07:45 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/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java?rev=1448826&r1=1448825&r2=1448826&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java Thu 
Feb 21 22:07:45 2013
@@ -110,6 +110,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.
      *
@@ -198,11 +210,17 @@ public class StandardJarScanner implemen
                 log.trace(sm.getString("jarScan.classloaderStart"));
             }
 
+            ClassLoader stopLoader = null;
+            if (!scanBootstrapClassPath) {
+                // Stop when we reach the bootstrap class loader
+                stopLoader = ClassLoader.getSystemClassLoader().getParent();
+            }
+
             // No need to scan the web application class loader - we have
             // already scanned WEB-INF/lib and WEB-INF/classes
             ClassLoader loader = classloader.getParent();
 
-            while (loader != null) {
+            while (loader != stopLoader) {
                 if (loader instanceof URLClassLoader) {
                     URL[] urls = ((URLClassLoader) loader).getURLs();
                     for (int i=0; i<urls.length; i++) {

Modified: tomcat/trunk/webapps/docs/config/jar-scanner.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/jar-scanner.xml?rev=1448826&r1=1448825&r2=1448826&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/jar-scanner.xml (original)
+++ tomcat/trunk/webapps/docs/config/jar-scanner.xml Thu Feb 21 22:07:45 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: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to