tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappClassLoader.java
Date Sat, 02 Feb 2002 12:57:43 GMT
remm        02/02/02 04:57:43

  Modified:    catalina/src/share/org/apache/catalina/loader
                        WebappClassLoader.java
  Log:
  - Modify the way class triggers work to be less restrictive, which fixes problems
    with webapps which use Xerces (since Xerces 1 is not API compatible with
    Xerces 2).
  
  Revision  Changes    Path
  1.33      +32 -9     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java
  
  Index: WebappClassLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- WebappClassLoader.java	28 Jan 2002 23:06:00 -0000	1.32
  +++ WebappClassLoader.java	2 Feb 2002 12:57:43 -0000	1.33
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
1.32 2002/01/28 23:06:00 remm Exp $
  - * $Revision: 1.32 $
  - * $Date: 2002/01/28 23:06:00 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
1.33 2002/02/02 12:57:43 remm Exp $
  + * $Revision: 1.33 $
  + * $Date: 2002/02/02 12:57:43 $
    *
    * ====================================================================
    *
  @@ -122,7 +122,7 @@
    *
    * @author Remy Maucherat
    * @author Craig R. McClanahan
  - * @version $Revision: 1.32 $ $Date: 2002/01/28 23:06:00 $
  + * @version $Revision: 1.33 $ $Date: 2002/02/02 12:57:43 $
    */
   public class WebappClassLoader
       extends URLClassLoader
  @@ -161,17 +161,34 @@
           "com.sun.jndi.ldap.LdapCtxFactory",      // LDAP      added in 1.3
           "com.sun.net.ssl.internal.ssl.Provider", // JSSE      added in 1.4
           "javax.security.auth.Subject",           // JAAS      added in 1.4
  -        "javax.naming.Context",                  // JNDI      added in 1.3
  -        "javax.net.SocketFactory",               // JSSE      added in 1.4
  -        "javax.security.cert.X509Certificate",   // JSSE      added in 1.4
  -        "javax.sql.DataSource",                  // JDBC ext. added in 1.4
  -        "javax.xml.parsers.DocumentBuilder",     // JAXP      added in 1.4
  +        //"javax.net.SocketFactory",               // JSSE      added in 1.4
  +        //"javax.security.cert.X509Certificate",   // JSSE      added in 1.4
  +        //"javax.sql.DataSource",                  // JDBC ext. added in 1.4
  +        //"javax.xml.parsers.DocumentBuilder",     // JAXP      added in 1.4
           "javax.servlet.Servlet",                 // Servlet API
           // "org.apache.crimson.jaxp.DocumentBuilderImpl",
                                                    // Crimson   added in 1.4
       };
   
   
  +    /**
  +     * The set of trigger classes that will cause a proposed repository not
  +     * to be added if this class is visible to the class loader that loaded
  +     * this factory class.  Typically, trigger classes will be listed for
  +     * components that have been integrated into the JDK for later versions,
  +     * but where the corresponding JAR files are required to run on
  +     * earlier versions.
  +     */
  +    private static final String[] classTriggers = {
  +        "javax.net.",                                // JSSE      added in 1.4
  +        "javax.security.cert.",                      // JSSE      added in 1.4
  +        "javax.naming.",                             // JNDI      added in 1.3
  +        "javax.xml.",                                // JAXP      added in 1.4
  +        "org.xml.sax.",
  +        "org.w3c.dom."
  +    };
  +
  +
       // ----------------------------------------------------------- Constructors
   
   
  @@ -1894,6 +1911,7 @@
               return false;
   
           // Looking up the package
  +        /*
           String packageName = null;
           int pos = name.lastIndexOf('.');
           if (pos != -1)
  @@ -1909,6 +1927,11 @@
               return false;
           if (packageName.equals("javax.servlet.jsp.tagext"))
               return false;
  +        */
  +        for (int i = 0; i < classTriggers.length; i++) {
  +            if (name.startsWith(classTriggers[i]))
  +                return false;
  +        }
   
           return true;
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message