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/startup ContextConfig.java
Date Thu, 16 May 2002 21:08:26 GMT
remm        02/05/16 14:08:26

  Modified:    catalina/src/share/org/apache/catalina/startup
                        ContextConfig.java
  Log:
  - When running in embedded mode, the service was always null, causing a
    NPE. In that case, the CertificatesValve will always be added.
  
  Revision  Changes    Path
  1.65      +14 -9     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
  
  Index: ContextConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- ContextConfig.java	12 May 2002 04:06:19 -0000	1.64
  +++ ContextConfig.java	16 May 2002 21:08:26 -0000	1.65
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
1.64 2002/05/12 04:06:19 glenn Exp $
  - * $Revision: 1.64 $
  - * $Date: 2002/05/12 04:06:19 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
1.65 2002/05/16 21:08:26 remm Exp $
  + * $Revision: 1.65 $
  + * $Date: 2002/05/16 21:08:26 $
    *
    * ====================================================================
    *
  @@ -133,7 +133,7 @@
    * of that Context, and the associated defined servlets.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.64 $ $Date: 2002/05/12 04:06:19 $
  + * @version $Revision: 1.65 $ $Date: 2002/05/16 21:08:26 $
    */
   
   public final class ContextConfig
  @@ -412,11 +412,16 @@
           }
           if (container instanceof Engine) {
               Service service = ((Engine)container).getService();
  -            Connector [] connectors = service.findConnectors();
  -            for (int i = 0; i < connectors.length; i++) {
  -                secure = connectors[i].getSecure();
  -                if (secure) {
  -                    break;
  +            // The service can be null when Tomcat is run in embedded mode
  +            if (service == null) {
  +                secure = true;
  +            } else {
  +                Connector [] connectors = service.findConnectors();
  +                for (int i = 0; i < connectors.length; i++) {
  +                    secure = connectors[i].getSecure();
  +                    if (secure) {
  +                        break;
  +                    }
                   }
               }
           }
  
  
  

--
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