cvs commit: jakarta-tomcat-connectors/coyote - Imported sources

2001-06-13 Thread remm

remm01/06/13 18:08:04

  Log:
  Coyote is a proposal for a new connector API for Tomcat. It actually isn't
  that new, because it is derived from some of the components which are at the
  core of Tomcat 3.3.Those components were significantly simplified.
  
  This API can't be considered a final proposal yet, mainly because it didn't
  get any real world testing nor feedback.
  
  As a test case, I plan to port the current HTTP/1.1 connector which is part of
  Catalina to this API, and then write a Catalina adapter for Coyote.
  
  Dependencies :
  - j-t-c/util
  
  Status:
  
  Vendor Tag:   asf
  Release Tags: first
  
  N jakarta-tomcat-connectors/coyote/.cvsignore
  N jakarta-tomcat-connectors/coyote/build.properties.sample
  N jakarta-tomcat-connectors/coyote/build.xml
  N jakarta-tomcat-connectors/coyote/src/conf/MANIFEST.MF
  N jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Adapter.java
  N jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/AdapterEventCode.java
  N jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/AdapterListener.java
  N jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Connector.java
  N jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Constants.java
  N jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/InputBuffer.java
  N jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Note.java
  N jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/OutputBuffer.java
  N jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  N jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java
  N jakarta-tomcat-connectors/coyote/src/test/org/apache/coyote/SimpleAdapter.java
  
  No conflicts created by this import



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpConnector.java

2001-06-14 Thread remm

remm01/06/14 07:45:56

  Modified:catalina/src/share/org/apache/catalina/connector/http
HttpConnector.java
  Log:
  - Set TCP no delay to true on the accepted connection. In HTTP/1.1, not
setting it caused unnecessary delays in the TCP stack, since the connection
was usually not closed after processing the request.
Change suggested by Dylan Schell dylans at xs4all.nl
  
  Revision  ChangesPath
  1.16  +34 -4 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java
  
  Index: HttpConnector.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- HttpConnector.java2001/05/09 23:42:12 1.15
  +++ HttpConnector.java2001/06/14 14:45:55 1.16
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
 1.15 2001/05/09 23:42:12 craigmcc Exp $
  - * $Revision: 1.15 $
  - * $Date: 2001/05/09 23:42:12 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
 1.16 2001/06/14 14:45:55 remm Exp $
  + * $Revision: 1.16 $
  + * $Date: 2001/06/14 14:45:55 $
*
* 
*
  @@ -95,7 +95,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.15 $ $Date: 2001/05/09 23:42:12 $
  + * @version $Revision: 1.16 $ $Date: 2001/06/14 14:45:55 $
*/
   
   
  @@ -293,6 +293,12 @@
   private boolean allowChunking = true;
   
   
  +/**
  + * Use TCP no delay ?
  + */
  +private boolean tcpNoDelay = true;
  +
  +
   // - Properties
   
   
  @@ -713,6 +719,29 @@
   }
   
   
  +/**
  + * Return the TCP no delay flag value.
  + */
  +public boolean getTcpNoDelay() {
  +
  +return (this.tcpNoDelay);
  +
  +}
  +
  +
  +/**
  + * Set the TCP no delay flag which will be set on the socket after 
  + * accepting a connection.
  + * 
  + * @param tcpNoDelay The new TCP no delay flag
  + */
  +public void setTcpNoDelay(boolean tcpNoDelay) {
  +
  +this.tcpNoDelay = tcpNoDelay;
  +
  +}
  +
  +
   // - Public Methods
   
   
  @@ -905,6 +934,7 @@
   //log(run: Returned from 
serverSocket.accept());
   if (connectionTimeout  0)
   socket.setSoTimeout(connectionTimeout);
  +setTcpNoDelay(tcpNoDelay);
   } catch (AccessControlException ace) {
   log(socket accept security exception, ace);
   continue;
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup Catalina.java

2001-06-16 Thread remm

remm01/06/16 13:23:19

  Modified:catalina/src/share/org/apache/catalina/startup Catalina.java
  Log:
  - Add a rule for adding aliases (apparently, it had been forgotten).
The sytax is :
Host ...
   Aliasfoobar/Alias
/Host
Bug reported by Deacon Marcus deacon_marcus at wwtech.pl
  
  Revision  ChangesPath
  1.23  +7 -4  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java
  
  Index: Catalina.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Catalina.java 2001/05/23 22:06:31 1.22
  +++ Catalina.java 2001/06/16 20:23:19 1.23
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
 1.22 2001/05/23 22:06:31 craigmcc Exp $
  - * $Revision: 1.22 $
  - * $Date: 2001/05/23 22:06:31 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
 1.23 2001/06/16 20:23:19 remm Exp $
  + * $Revision: 1.23 $
  + * $Date: 2001/06/16 20:23:19 $
*
* 
*
  @@ -97,7 +97,7 @@
* /u
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.22 $ $Date: 2001/05/23 22:06:31 $
  + * @version $Revision: 1.23 $ $Date: 2001/06/16 20:23:19 $
*/
   
   public class Catalina {
  @@ -349,6 +349,9 @@
   configClass));
   mapper.addRule(Server/Service/Engine/Host, mapper.addChild
  (addChild, org.apache.catalina.Container));
  +
  +mapper.addRule(Server/Service/Engine/Host/Alias,
  +   mapper.methodSetter(addAlias, 0));
   
   mapper.addRule(Server/Service/Engine/Host/Cluster,
  mapper.objectCreate(null, className));
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpProcessor.java

2001-06-17 Thread remm

remm01/06/17 17:14:44

  Modified:catalina/src/share/org/apache/catalina/connector/http
HttpProcessor.java
  Log:
  - Handle requests on absolute URIs.
  
  Revision  ChangesPath
  1.26  +15 -4 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java
  
  Index: HttpProcessor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- HttpProcessor.java2001/05/16 17:55:42 1.25
  +++ HttpProcessor.java2001/06/18 00:14:44 1.26
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.25 2001/05/16 17:55:42 remm Exp $
  - * $Revision: 1.25 $
  - * $Date: 2001/05/16 17:55:42 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.26 2001/06/18 00:14:44 remm Exp $
  + * $Revision: 1.26 $
  + * $Date: 2001/06/18 00:14:44 $
*
* 
*
  @@ -107,7 +107,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.25 $ $Date: 2001/05/16 17:55:42 $
  + * @version $Revision: 1.26 $ $Date: 2001/06/18 00:14:44 $
*/
   
   final class HttpProcessor
  @@ -735,6 +735,17 @@
} else {
request.setQueryString(null);
uri = new String(requestLine.uri, 0, requestLine.uriEnd);
  +}
  +
  +// Checking for an absolute URI (with the HTTP protocol)
  +if (uri.startsWith(http://;)) {
  +// Parsing out protocol and host name
  +int pos = uri.indexOf('/', http://.length());
  +if (pos == -1) {
  +uri = ;
  +} else {
  +uri = uri.substring(pos);
  +}
   }
   
// Parse any requested session ID out of the request URI
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http SocketInputStream.java

2001-06-17 Thread remm

remm01/06/17 17:21:58

  Modified:catalina/src/share/org/apache/catalina/connector/http
SocketInputStream.java
  Log:
  - Handle HTTP/0.9 requests.
  
  Revision  ChangesPath
  1.7   +8 -4  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/SocketInputStream.java
  
  Index: SocketInputStream.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/SocketInputStream.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SocketInputStream.java2001/01/23 03:53:00 1.6
  +++ SocketInputStream.java2001/06/18 00:21:58 1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/SocketInputStream.java,v
 1.6 2001/01/23 03:53:00 remm Exp $
  - * $Revision: 1.6 $
  - * $Date: 2001/01/23 03:53:00 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/SocketInputStream.java,v
 1.7 2001/06/18 00:21:58 remm Exp $
  + * $Revision: 1.7 $
  + * $Date: 2001/06/18 00:21:58 $
*
* 
* 
  @@ -250,6 +250,8 @@
   
   space = false;
   
  +boolean eol = false;
  +
   while (!space) {
   // if the buffer is full, extend it
   if (readCount = maxRead) {
  @@ -275,6 +277,10 @@
   }
   if (buf[pos] == SP) {
   space = true;
  +} else if ((buf[pos] == CR) || (buf[pos] == LF)) {
  +// HTTP/0.9 style request
  +eol = true;
  +space = true;
   }
   requestLine.uri[readCount] = (char) buf[pos];
   readCount++;
  @@ -288,8 +294,6 @@
   maxRead = requestLine.protocol.length;
   readStart = pos;
   readCount = 0;
  -
  -boolean eol = false;
   
   while (!eol) {
   // if the buffer is full, extend it
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector HttpResponseBase.java

2001-06-17 Thread remm

remm01/06/17 23:03:39

  Modified:catalina/src/share/org/apache/catalina/connector
HttpResponseBase.java
  Log:
  - Don't send response header if HTTP/0.9.
  
  Revision  ChangesPath
  1.34  +9 -4  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java
  
  Index: HttpResponseBase.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- HttpResponseBase.java 2001/05/16 17:55:25 1.33
  +++ HttpResponseBase.java 2001/06/18 06:03:36 1.34
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java,v
 1.33 2001/05/16 17:55:25 remm Exp $
  - * $Revision: 1.33 $
  - * $Date: 2001/05/16 17:55:25 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java,v
 1.34 2001/06/18 06:03:36 remm Exp $
  + * $Revision: 1.34 $
  + * $Date: 2001/06/18 06:03:36 $
*
* 
*
  @@ -100,7 +100,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.33 $ $Date: 2001/05/16 17:55:25 $
  + * @version $Revision: 1.34 $ $Date: 2001/06/18 06:03:36 $
*/
   
   public class HttpResponseBase
  @@ -547,6 +547,11 @@
   
if (isCommitted())
return;
  +
  +if (HTTP/0.9.equals(request.getRequest().getProtocol())) {
  +committed = true;
  +return;
  +}
   
// Prepare a suitable output writer
OutputStreamWriter osr =
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpProcessor.java

2001-06-18 Thread remm

remm01/06/17 23:22:32

  Modified:catalina/src/share/org/apache/catalina/connector/http
HttpProcessor.java
  Log:
  - Don't hardcode the protocol name when stripping out the protocol and
host name when the client submits a full URL.
  
  Revision  ChangesPath
  1.27  +13 -11
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java
  
  Index: HttpProcessor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- HttpProcessor.java2001/06/18 00:14:44 1.26
  +++ HttpProcessor.java2001/06/18 06:22:27 1.27
  @@ -1,7 +1,6 @@
  -/*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.26 2001/06/18 00:14:44 remm Exp $
  - * $Revision: 1.26 $
  - * $Date: 2001/06/18 00:14:44 $
  +/* * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.27 2001/06/18 06:22:27 remm Exp $
  + * $Revision: 1.27 $
  + * $Date: 2001/06/18 06:22:27 $
*
* 
*
  @@ -107,7 +106,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.26 $ $Date: 2001/06/18 00:14:44 $
  + * @version $Revision: 1.27 $ $Date: 2001/06/18 06:22:27 $
*/
   
   final class HttpProcessor
  @@ -738,13 +737,16 @@
   }
   
   // Checking for an absolute URI (with the HTTP protocol)
  -if (uri.startsWith(http://;)) {
  +if (!uri.startsWith(/)) {
  +int pos = uri.indexOf(://);
   // Parsing out protocol and host name
  -int pos = uri.indexOf('/', http://.length());
  -if (pos == -1) {
  -uri = ;
  -} else {
  -uri = uri.substring(pos);
  +if (pos != -1) {
  +pos = uri.indexOf('/', pos + 3);
  +if (pos == -1) {
  +uri = ;
  +} else {
  +uri = uri.substring(pos);
  +}
   }
   }
   
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpConnector.java

2001-06-18 Thread remm

remm01/06/18 14:35:56

  Modified:catalina/src/share/org/apache/catalina/connector/http
HttpConnector.java
  Log:
  - Actually call setTcpNoDelay on the newly accepted socket.
  
  Revision  ChangesPath
  1.17  +5 -5  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java
  
  Index: HttpConnector.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- HttpConnector.java2001/06/14 14:45:55 1.16
  +++ HttpConnector.java2001/06/18 21:35:54 1.17
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
 1.16 2001/06/14 14:45:55 remm Exp $
  - * $Revision: 1.16 $
  - * $Date: 2001/06/14 14:45:55 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
 1.17 2001/06/18 21:35:54 remm Exp $
  + * $Revision: 1.17 $
  + * $Date: 2001/06/18 21:35:54 $
*
* 
*
  @@ -95,7 +95,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.16 $ $Date: 2001/06/14 14:45:55 $
  + * @version $Revision: 1.17 $ $Date: 2001/06/18 21:35:54 $
*/
   
   
  @@ -934,7 +934,7 @@
   //log(run: Returned from 
serverSocket.accept());
   if (connectionTimeout  0)
   socket.setSoTimeout(connectionTimeout);
  -setTcpNoDelay(tcpNoDelay);
  +socket.setTcpNoDelay(tcpNoDelay);
   } catch (AccessControlException ace) {
   log(socket accept security exception, ace);
   continue;
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpProcessor.java

2001-06-18 Thread remm

remm01/06/18 16:28:40

  Modified:catalina/src/share/org/apache/catalina/connector/http
HttpProcessor.java
  Log:
  - Skip leftover bytes before closing the socket.
  
  Revision  ChangesPath
  1.28  +19 -4 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java
  
  Index: HttpProcessor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- HttpProcessor.java2001/06/18 06:22:27 1.27
  +++ HttpProcessor.java2001/06/18 23:28:39 1.28
  @@ -1,6 +1,6 @@
  -/* * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.27 2001/06/18 06:22:27 remm Exp $
  - * $Revision: 1.27 $
  - * $Date: 2001/06/18 06:22:27 $
  +/* * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.28 2001/06/18 23:28:39 remm Exp $
  + * $Revision: 1.28 $
  + * $Date: 2001/06/18 23:28:39 $
*
* 
*
  @@ -106,7 +106,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.27 $ $Date: 2001/06/18 06:22:27 $
  + * @version $Revision: 1.28 $ $Date: 2001/06/18 23:28:39 $
*/
   
   final class HttpProcessor
  @@ -935,12 +935,27 @@
   }
   
try {
  +shutdownInput(input);
   socket.close();
} catch (IOException e) {
;
}
socket = null;
   
  +}
  +
  +
  +protected void shutdownInput(InputStream input)
  +throws IOException {
  +try {
  +int available = input.available();
  +// skip any unread (bogus) bytes
  +if (available  0) {
  +input.skip(available);
  +}
  +} catch (Exception e) {
  +;
  +}
   }
   
   
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappLoader.java

2001-06-18 Thread remm

remm01/06/18 19:12:50

  Added:   catalina/src/share/org/apache/catalina/loader
WebappLoader.java
  Log:
  - New classloader implementation, used for web applications only.
  - Extends URLClassLoader (to preserve maximum compatibility).
  - Does not require dynamic bindings to work.
  - Supports reloading of classes in /WEB-INF/classes.
  - Supports reloading of JARs. This is untested, and is only a convinience
feature (for example, when you forgot a JAR required by a webapp). In many
cases, a stop / start of the context (which destroys it and recreates it from
scratch) will be needed to avoid getting JVM linkage errors and class casts.
  - Improved efficiency a lot : no more double tracking of the classes and
resources, unified loaded resources repository (classes + resources).
  - Fixed lookup path : first classes repository, then JARs. It was impossible
to control the order of the repositories by directly using URLClassLoader.
  - To the outside world (if getURLs() is called), it appears as a file-based
URLClassLoader.
  - All the JARs in /WEB-INF/lib are extracted and copied to the work directory,
even if the resources are filesystem based. Otherwise, it is not possible to
actually manipulate the JARs which are in the webapp while they're open, at
least under Windows. This operation is relatively fast anyway.
  - Tested with the examples webapp, Slide and Jasper.
  - Note : Jasper reloading of the classes may still be broken.
  
  Revision  ChangesPath
  1.1  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java
  
  Index: WebappLoader.java
  ===
  /*
   * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.1 2001/06/19 02:12:49 remm Exp $
   * $Revision: 1.1 $
   * $Date: 2001/06/19 02:12:49 $
   *
   * 
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *notice, this list of conditions and the following disclaimer in
   *the documentation and/or other materials provided with the
   *distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *any, must include the following acknowlegement:  
   *   This product includes software developed by the 
   *Apache Software Foundation (http://www.apache.org/).
   *Alternately, this acknowlegement may appear in the software itself,
   *if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names The Jakarta Project, Tomcat, and Apache Software
   *Foundation must not be used to endorse or promote products derived
   *from this software without prior written permission. For written 
   *permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called Apache
   *nor may Apache appear in their names without prior written
   *permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * 
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * http://www.apache.org/.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  
  
  package org.apache.catalina.loader;
  
  
  import java.beans.PropertyChangeEvent;
  import java.beans.PropertyChangeListener;
  import java.beans.PropertyChangeSupport;
  import

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core StandardContext.java

2001-06-18 Thread remm

remm01/06/18 19:14:49

  Modified:catalina/src/share/org/apache/catalina/core
StandardContext.java
  Log:
  - Normalize the work directory path.
  - Use the new Webapp class loader instead of standard class loader.
Note : This is a one line change.
  
  Revision  ChangesPath
  1.63  +15 -8 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- StandardContext.java  2001/06/13 02:32:01 1.62
  +++ StandardContext.java  2001/06/19 02:14:48 1.63
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.62 2001/06/13 02:32:01 remm Exp $
  - * $Revision: 1.62 $
  - * $Date: 2001/06/13 02:32:01 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.63 2001/06/19 02:14:48 remm Exp $
  + * $Revision: 1.63 $
  + * $Date: 2001/06/19 02:14:48 $
*
* 
*
  @@ -128,7 +128,7 @@
   import org.apache.catalina.deploy.SecurityCollection;
   import org.apache.catalina.deploy.SecurityConstraint;
   import org.apache.catalina.loader.StandardClassLoader;
  -import org.apache.catalina.loader.StandardLoader;
  +import org.apache.catalina.loader.WebappLoader;
   import org.apache.catalina.session.StandardManager;
   import org.apache.catalina.util.CharsetMapper;
   import org.apache.catalina.util.RequestUtil;
  @@ -141,7 +141,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.62 $ $Date: 2001/06/13 02:32:01 $
  + * @version $Revision: 1.63 $ $Date: 2001/06/19 02:14:48 $
*/
   
   public class StandardContext
  @@ -3151,7 +3151,7 @@
   if (getLoader() == null) {  // (2) Required by Manager
   if (debug = 1)
   log(Configuring default Loader);
  -setLoader(new StandardLoader(getParentClassLoader()));
  +setLoader(new WebappLoader(getParentClassLoader()));
   }
   if (getManager() == null) { // (3) After prerequisites
   if (debug = 1)
  @@ -3740,8 +3740,15 @@
   
// Create this directory if necessary
File dir = new File(workDir);
  - if (!dir.isAbsolute())
  - dir = new File(System.getProperty(catalina.home), workDir);
  + if (!dir.isAbsolute()) {
  +File catalinaHome = new File(System.getProperty(catalina.home));
  +String catalinaHomePath = null;
  +try {
  +catalinaHomePath = catalinaHome.getCanonicalPath();
  +dir = new File(catalinaHomePath, workDir);
  +} catch (IOException e) {
  +}
  +}
dir.mkdirs();
   
// Set the appropriate servlet context attribute
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup ContextConfig.java

2001-06-18 Thread remm

remm01/06/18 19:20:32

  Modified:catalina/src/share/org/apache/catalina/startup
ContextConfig.java
  Log:
  - Stopping and starting any of the Catalina components is broken at the moment,
because the component is not reinitialized.
  - This fixes the problem (at least partially) for a Context.
  - I think this code should be moved to the container itself. I suggest adding
either a new Container.recycle() method or a new Lifecycle.recycle() method.
  
  Revision  ChangesPath
  1.47  +148 -5
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.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- ContextConfig.java2001/05/31 03:56:11 1.46
  +++ ContextConfig.java2001/06/19 02:20:32 1.47
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
 1.46 2001/05/31 03:56:11 remm Exp $
  - * $Revision: 1.46 $
  - * $Date: 2001/05/31 03:56:11 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
 1.47 2001/06/19 02:20:32 remm Exp $
  + * $Revision: 1.47 $
  + * $Date: 2001/06/19 02:20:32 $
*
* 
*
  @@ -106,6 +106,14 @@
   import org.apache.catalina.core.StandardContext;
   import org.apache.catalina.deploy.LoginConfig;
   import org.apache.catalina.deploy.SecurityConstraint;
  +import org.apache.catalina.deploy.ApplicationParameter;
  +import org.apache.catalina.deploy.ContextEjb;
  +import org.apache.catalina.deploy.ContextEnvironment;
  +import org.apache.catalina.deploy.ErrorPage;
  +import org.apache.catalina.deploy.FilterDef;
  +import org.apache.catalina.deploy.FilterMap;
  +import org.apache.catalina.deploy.ContextLocalEjb;
  +import org.apache.catalina.deploy.ContextResource;
   import org.apache.catalina.loader.Extension;
   import org.apache.catalina.util.StringManager;
   import org.apache.catalina.util.xml.SaxContext;
  @@ -120,7 +128,7 @@
* of that Context, and the associated defined servlets.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.46 $ $Date: 2001/05/31 03:56:11 $
  + * @version $Revision: 1.47 $ $Date: 2001/06/19 02:20:32 $
*/
   
   public final class ContextConfig
  @@ -859,10 +867,145 @@
   /**
* Process a stop event for this Context.
*/
  -private void stop() {
  +private synchronized void stop() {
   
if (debug  0)
log(sm.getString(contextConfig.stop));
  +
  +int i;
  +
  +// Removing children
  +Container[] children = context.findChildren();
  +for (i = 0; i  children.length; i++) {
  +context.removeChild(children[i]);
  +}
  +
  +// FIXME : remove mappers ?
  +
  +// Removing application listeners
  +String[] applicationListeners = context.findApplicationListeners();
  +for (i = 0; i  applicationListeners.length; i++) {
  +context.removeApplicationListener(applicationListeners[i]);
  +}
  +
  +// Removing application parameters
  +ApplicationParameter[] applicationParameters = 
  +context.findApplicationParameters();
  +for (i = 0; i  applicationParameters.length; i++) {
  +context.removeApplicationParameter
  +(applicationParameters[i].getName());
  +}
  +
  +// Removing security constraints
  +SecurityConstraint[] securityConstraints = context.findConstraints();
  +for (i = 0; i  securityConstraints.length; i++) {
  +context.removeConstraint(securityConstraints[i]);
  +}
  +
  +// Removing Ejbs
  +ContextEjb[] contextEjbs = context.findEjbs();
  +for (i = 0; i  contextEjbs.length; i++) {
  +context.removeEjb(contextEjbs[i].getName());
  +}
  +
  +// Removing environments
  +ContextEnvironment[] contextEnvironments = context.findEnvironments();
  +for (i = 0; i  contextEnvironments.length; i++) {
  +context.removeEnvironment(contextEnvironments[i].getName());
  +}
  +
  +// Removing errors pages
  +ErrorPage[] errorPages = context.findErrorPages();
  +for (i = 0; i  errorPages.length; i++) {
  +context.removeErrorPage(errorPages[i]);
  +}
  +
  +// Removing filter defs
  +FilterDef[] filterDefs = context.findFilterDefs();
  +for (i = 0; i  filterDefs.length; i++) {
  +context.removeFilterDef(filterDefs[i]);
  +}
  +
  +// Removing filter maps

cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper JspEngineContext.java

2001-06-18 Thread remm

remm01/06/18 21:17:27

  Modified:jasper/src/share/org/apache/jasper JspEngineContext.java
  Log:
  - Make Jasper dynamically retrieve the classloader instead of sticking with the
same classloader, which was breaking reloading (since Jasper was using the
old classloader, it was never able to pick up changes).
  
  Revision  ChangesPath
  1.9   +4 -4  
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspEngineContext.java
  
  Index: JspEngineContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspEngineContext.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JspEngineContext.java 2001/03/22 16:39:27 1.8
  +++ JspEngineContext.java 2001/06/19 04:17:26 1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspEngineContext.java,v
 1.8 2001/03/22 16:39:27 glenn Exp $
  - * $Revision: 1.8 $
  - * $Date: 2001/03/22 16:39:27 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspEngineContext.java,v
 1.9 2001/06/19 04:17:26 remm Exp $
  + * $Revision: 1.9 $
  + * $Date: 2001/06/19 04:17:26 $
*
* 
* 
  @@ -190,7 +190,7 @@
* this JSP? I don't think this is used right now -- akv. 
*/
   public ClassLoader getClassLoader() {
  -return loader;
  +return Thread.currentThread().getContextClassLoader();
   }
   
   /**
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappLoader.java

2001-06-19 Thread remm

remm01/06/19 10:38:02

  Modified:catalina/src/share/org/apache/catalina/loader
WebappLoader.java
  Log:
  - Add a permission for the work dir.
  
  Revision  ChangesPath
  1.2   +12 -4 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java
  
  Index: WebappLoader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebappLoader.java 2001/06/19 02:12:49 1.1
  +++ WebappLoader.java 2001/06/19 17:38:00 1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.1 2001/06/19 02:12:49 remm Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/06/19 02:12:49 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.2 2001/06/19 17:38:00 remm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2001/06/19 17:38:00 $
*
* 
*
  @@ -119,7 +119,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.1 $ $Date: 2001/06/19 02:12:49 $
  + * @version $Revision: 1.2 $ $Date: 2001/06/19 17:38:00 $
*/
   
   public class WebappLoader
  @@ -643,6 +643,14 @@
   ((WebappClassLoader)classLoader).setPermissions
   (rootUrl);
}
  +File workDir = 
  +(File) servletContext.getAttribute
  +(Globals.WORK_DIR_ATTR);
  +if (workDir != null) {
  +File libDir = new File(workDir, WEB-INF/lib/);
  +((WebappClassLoader)classLoader).setPermissions
  +(libDir.getAbsolutePath());
  +}
} catch (MalformedURLException e) {
}
}
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappLoader.java

2001-06-19 Thread remm

remm01/06/19 16:03:33

  Modified:catalina/src/share/org/apache/catalina/loader
WebappLoader.java
  Log:
  - Use the local context notifier. Should fix build failure with Jikes reported
by Jon.
  
  Revision  ChangesPath
  1.3   +6 -5  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java
  
  Index: WebappLoader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WebappLoader.java 2001/06/19 17:38:00 1.2
  +++ WebappLoader.java 2001/06/19 23:03:30 1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.2 2001/06/19 17:38:00 remm Exp $
  - * $Revision: 1.2 $
  - * $Date: 2001/06/19 17:38:00 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.3 2001/06/19 23:03:30 remm Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/06/19 23:03:30 $
*
* 
*
  @@ -119,7 +119,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.2 $ $Date: 2001/06/19 17:38:00 $
  + * @version $Revision: 1.3 $ $Date: 2001/06/19 23:03:30 $
*/
   
   public class WebappLoader
  @@ -803,7 +803,8 @@
*/
   private void notifyContext() {
   
  - ContextNotifier notifier = new ContextNotifier((Context) container);
  + WebappContextNotifier notifier = 
  +new WebappContextNotifier((Context) container);
(new Thread(notifier)).start();
   
   }
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappLoader.java

2001-06-19 Thread remm

remm01/06/19 19:29:14

  Modified:catalina/src/share/org/apache/catalina/loader
WebappLoader.java
  Log:
  - Add some temporary traces which could help debug the setup of the
repositories.
  
  Revision  ChangesPath
  1.4   +6 -4  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java
  
  Index: WebappLoader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WebappLoader.java 2001/06/19 23:03:30 1.3
  +++ WebappLoader.java 2001/06/20 02:29:13 1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.3 2001/06/19 23:03:30 remm Exp $
  - * $Revision: 1.3 $
  - * $Date: 2001/06/19 23:03:30 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.4 2001/06/20 02:29:13 remm Exp $
  + * $Revision: 1.4 $
  + * $Date: 2001/06/20 02:29:13 $
*
* 
*
  @@ -119,7 +119,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.3 $ $Date: 2001/06/19 23:03:30 $
  + * @version $Revision: 1.4 $ $Date: 2001/06/20 02:29:13 $
*/
   
   public class WebappLoader
  @@ -936,7 +936,9 @@
   } catch (NamingException e) {
   // Silent catch: it's valid that no /WEB-INF/lib directory 
   //exists
  +e.printStackTrace();
   } catch (IOException e) {
  +e.printStackTrace();
   }
   
   }
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader LocalStrings.properties WebappLoader.java

2001-06-20 Thread remm

remm01/06/20 18:39:10

  Modified:catalina/src/share/org/apache/catalina/loader
LocalStrings.properties WebappLoader.java
  Log:
  - Add additional log info so that I can figure out what's up with Scarab
running on Jon's box. It's no longer displayed on the console, but instead
put in the log files.
  - Rename StandardLoader - WebappLoader in the logs.
  - Add additional message strings.
  
  Revision  ChangesPath
  1.2   +14 -0 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/LocalStrings.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LocalStrings.properties   2000/08/11 22:42:03 1.1
  +++ LocalStrings.properties   2001/06/21 01:39:07 1.2
  @@ -13,3 +13,17 @@
   standardLoader.removeRepository=Removing repository {0}
   standardLoader.starting=Starting this Loader
   standardLoader.stopping=Stopping this Loader
  +webappLoader.addRepository=Adding repository {0}
  +webappLoader.deploy=Deploying class repositories to work directory {0}
  +webappLoader.jarDeploy=Deploy JAR {0} to {1}
  +webappLoader.classDeploy=Deploy class files {0} to {1}
  +webappLoader.alreadyStarted=Loader has already been started
  +webappLoader.checkInterval=Cannot set reload check interval to {0} seconds
  +webappLoader.notContext=Cannot auto-reload unless our Container is a Context
  +webappLoader.notReloadabe=Reloadable property is set to false
  +webappLoader.notStarted=Loader has not yet been started
  +webappLoader.reloadable=Cannot set reloadable property to {0}
  +webappLoader.reloading=Reloading checks are enabled for this Context
  +webappLoader.removeRepository=Removing repository {0}
  +webappLoader.starting=Starting this Loader
  +webappLoader.stopping=Stopping this Loader
  
  
  
  1.6   +27 -23
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java
  
  Index: WebappLoader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WebappLoader.java 2001/06/20 23:31:29 1.5
  +++ WebappLoader.java 2001/06/21 01:39:08 1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.5 2001/06/20 23:31:29 remm Exp $
  - * $Revision: 1.5 $
  - * $Date: 2001/06/20 23:31:29 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.6 2001/06/21 01:39:08 remm Exp $
  + * $Revision: 1.6 $
  + * $Date: 2001/06/21 01:39:08 $
*
* 
*
  @@ -119,7 +119,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.5 $ $Date: 2001/06/20 23:31:29 $
  + * @version $Revision: 1.6 $ $Date: 2001/06/21 01:39:08 $
*/
   
   public class WebappLoader
  @@ -130,7 +130,7 @@
   
   
   /**
  - * Construct a new StandardLoader with no defined parent class loader
  + * Construct a new WebappLoader with no defined parent class loader
* (so that the actual parent will be the system class loader).
*/
   public WebappLoader() {
  @@ -141,7 +141,7 @@
   
   
   /**
  - * Construct a new StandardLoader with the specified class loader
  + * Construct a new WebappLoader with the specified class loader
* to be defined as the parent of the ClassLoader we ultimately create.
*
* @param parent The parent class loader
  @@ -264,7 +264,7 @@
   /**
* Name to register for the background thread.
*/
  -private String threadName = StandardLoader;
  +private String threadName = WebappLoader;
   
   
   /**
  @@ -492,7 +492,7 @@
   public void addRepository(String repository) {
   
   if (debug = 1)
  - log(sm.getString(standardLoader.addRepository, repository));
  + log(sm.getString(webappLoader.addRepository, repository));
   for (int i = 0; i  repositories.length; i++) {
   if (repository.equals(repositories[i]))
   return;
  @@ -591,9 +591,9 @@
// Validate and update our current component state
if (started)
throw new LifecycleException
  - (sm.getString(standardLoader.alreadyStarted));
  + (sm.getString(webappLoader.alreadyStarted));
if (debug = 1)
  - log(sm.getString(standardLoader.starting));
  + log(sm.getString(webappLoader.starting));
lifecycle.fireLifecycleEvent(START_EVENT, null

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup Catalina.java

2001-06-20 Thread remm

remm01/06/20 20:42:35

  Modified:catalina/src/share/org/apache/catalina/startup Catalina.java
  Log:
  - Whenever a Loader element was specified in a Context, a StandardLoader
was created, regardless on whether or not a className attribute was specified.
This is now fixed, and the className attribute now works correctly.
  - The class implementing the loader interface must have a constructor accepting
as parameter the parent class loader of the loader.
  - If no class name is specified, it will create a WebappLoader.
  - Thanks to Jon and his patience for helping me locate and fix that bug :)
  
  Revision  ChangesPath
  1.24  +51 -13
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java
  
  Index: Catalina.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Catalina.java 2001/06/16 20:23:19 1.23
  +++ Catalina.java 2001/06/21 03:42:35 1.24
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
 1.23 2001/06/16 20:23:19 remm Exp $
  - * $Revision: 1.23 $
  - * $Date: 2001/06/16 20:23:19 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
 1.24 2001/06/21 03:42:35 remm Exp $
  + * $Revision: 1.24 $
  + * $Date: 2001/06/21 03:42:35 $
*
* 
*
  @@ -69,6 +69,7 @@
   import java.io.IOException;
   import java.io.OutputStream;
   import java.lang.reflect.InvocationTargetException;
  +import java.lang.reflect.Constructor;
   import java.net.Socket;
   import java.security.Security;
   import java.util.Stack;
  @@ -77,7 +78,7 @@
   import org.apache.catalina.LifecycleException;
   import org.apache.catalina.LifecycleListener;
   import org.apache.catalina.Server;
  -import org.apache.catalina.loader.StandardLoader;
  +import org.apache.catalina.Loader;
   import org.apache.catalina.util.xml.SaxContext;
   import org.apache.catalina.util.xml.XmlAction;
   import org.apache.catalina.util.xml.XmlMapper;
  @@ -97,7 +98,7 @@
* /u
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.23 $ $Date: 2001/06/16 20:23:19 $
  + * @version $Revision: 1.24 $ $Date: 2001/06/21 03:42:35 $
*/
   
   public class Catalina {
  @@ -358,12 +359,12 @@
   mapper.addRule(Server/Service/Engine/Host/Cluster,
  mapper.setProperties());
   mapper.addRule(Server/Service/Engine/Host/Cluster,
  -   mapper.addChild(setCluster, 
org.apache.catalina.Cluster));
  +   mapper.addChild(setCluster, 
  +   org.apache.catalina.Cluster));
   
   createStartMapperContext(Server/Service/Engine/Host/Context, mapper);
  -createStartMapperDefaultContext(
  -Server/Service/Engine/Host/DefaultContext,
  -mapper);
  +createStartMapperDefaultContext
  +(Server/Service/Engine/Host/DefaultContext, mapper);
   
   mapper.addRule(Server/Service/Engine/Host/Context/Manager/Store,
  mapper.objectCreate(null, className));
  @@ -536,8 +537,8 @@
   (addLifecycleListener,
org.apache.catalina.LifecycleListener));
   
  -mapper.addRule(prefix + /Loader,
  -   new CreateLoaderAction());
  +mapper.addRule(prefix + /Loader, new CreateLoaderAction
  +(org.apache.catalina.WebappLoader, className));
mapper.addRule(prefix + /Loader,
   mapper.setProperties());
mapper.addRule(prefix + /Loader, mapper.addChild
  @@ -863,12 +864,38 @@
   /**
* Construct a new action.
*/
  -public CreateLoaderAction() {
  +public CreateLoaderAction(String loaderClass) {
  +
  +this(loaderClass, null);
  +
  +}
  +
  +
  +/**
  + * Construct a new action.
  + */
  +public CreateLoaderAction(String loaderClass, String attributeName) {
  +
   super();
  +this.loaderClass = loaderClass;
  +this.attributeName = attributeName;
  +
   }
   
   
   /**
  + * Classname of the loader.
  + */
  +protected String loaderClass;
  +
  +
  +/**
  + * The attribute name of the optional override class (if any).
  + */
  +protected String attributeName;
  +
  +
  +/**
* Add the requested Loader implemenation.
*/
   public void start(SaxContext context) throws Exception {
  @@ -879,7 +906,18 @@
   ClassLoader parentClassLoader = container.getParentClassLoader

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup Catalina.java

2001-06-20 Thread remm

remm01/06/20 21:18:53

  Modified:catalina/src/share/org/apache/catalina/startup Catalina.java
  Log:
  - Set the javaURLContextFactory as the JNDI IC factory. That feature was
present some time ago, but was removed because of fear of conflicts (which
turns out not to be a problem at all).
  
  Revision  ChangesPath
  1.25  +6 -4  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java
  
  Index: Catalina.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- Catalina.java 2001/06/21 03:42:35 1.24
  +++ Catalina.java 2001/06/21 04:18:50 1.25
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
 1.24 2001/06/21 03:42:35 remm Exp $
  - * $Revision: 1.24 $
  - * $Date: 2001/06/21 03:42:35 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
 1.25 2001/06/21 04:18:50 remm Exp $
  + * $Revision: 1.25 $
  + * $Date: 2001/06/21 04:18:50 $
*
* 
*
  @@ -98,7 +98,7 @@
* /u
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.24 $ $Date: 2001/06/21 03:42:35 $
  + * @version $Revision: 1.25 $ $Date: 2001/06/21 04:18:50 $
*/
   
   public class Catalina {
  @@ -706,6 +706,8 @@
   value = value + : + oldValue;
   }
   System.setProperty(javax.naming.Context.URL_PKG_PREFIXES, value);
  +System.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY,
  +   org.apache.naming.java.javaURLContextFactory);
   }
   
// If a SecurityManager is being used, set properties for
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup Catalina.java

2001-06-21 Thread remm

remm01/06/21 19:03:00

  Modified:catalina/src/share/org/apache/catalina/startup Catalina.java
  Log:
  - Remove the StandardLoader classname from the comments.
  
  Revision  ChangesPath
  1.26  +5 -5  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java
  
  Index: Catalina.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Catalina.java 2001/06/21 04:18:50 1.25
  +++ Catalina.java 2001/06/22 02:02:59 1.26
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
 1.25 2001/06/21 04:18:50 remm Exp $
  - * $Revision: 1.25 $
  - * $Date: 2001/06/21 04:18:50 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
 1.26 2001/06/22 02:02:59 remm Exp $
  + * $Revision: 1.26 $
  + * $Date: 2001/06/22 02:02:59 $
*
* 
*
  @@ -98,7 +98,7 @@
* /u
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.25 $ $Date: 2001/06/21 04:18:50 $
  + * @version $Revision: 1.26 $ $Date: 2001/06/22 02:02:59 $
*/
   
   public class Catalina {
  @@ -855,7 +855,7 @@
   
   
   /**
  - * Class that creates a new StandardLoader instance, with the parent class
  + * Class that creates a new loader instance, with the parent class
* loader associated with the top object on the stack (which must be a
* Container), and pushes it on to the stack.
*/
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup Embedded.java

2001-06-21 Thread remm

remm01/06/21 19:03:44

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  - Embedded createLoader method will now create instances of
WebappLoader, instead of StandardLoader.
  
  Revision  ChangesPath
  1.8   +6 -6  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Embedded.java 2000/12/19 03:23:12 1.7
  +++ Embedded.java 2001/06/22 02:03:43 1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
 1.7 2000/12/19 03:23:12 craigmcc Exp $
  - * $Revision: 1.7 $
  - * $Date: 2000/12/19 03:23:12 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
 1.8 2001/06/22 02:03:43 remm Exp $
  + * $Revision: 1.8 $
  + * $Date: 2001/06/22 02:03:43 $
*
* 
*
  @@ -86,7 +86,7 @@
   import org.apache.catalina.core.StandardContext;
   import org.apache.catalina.core.StandardEngine;
   import org.apache.catalina.core.StandardHost;
  -import org.apache.catalina.loader.StandardLoader;
  +import org.apache.catalina.loader.WebappLoader;
   import org.apache.catalina.logger.FileLogger;
   import org.apache.catalina.logger.SystemOutLogger;
   import org.apache.catalina.net.SSLServerSocketFactory;
  @@ -148,7 +148,7 @@
* /pre
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.7 $ $Date: 2000/12/19 03:23:12 $
  + * @version $Revision: 1.8 $ $Date: 2001/06/22 02:03:43 $
*/
   
   public class Embedded implements Lifecycle {
  @@ -639,7 +639,7 @@
   logger.log(Creating Loader with parent class loader ' +
  parent + ');
   
  -StandardLoader loader = new StandardLoader(parent);
  +WebappLoader loader = new WebappLoader(parent);
   return (loader);
   
   }
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader Reloader.java StandardClassLoader.java

2001-06-21 Thread remm

remm01/06/21 19:04:12

  Modified:catalina/src/share/org/apache/catalina/loader Reloader.java
StandardClassLoader.java
  Log:
  - Remove the StandardLoader classname from the comments.
  
  Revision  ChangesPath
  1.4   +5 -5  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/Reloader.java
  
  Index: Reloader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/Reloader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Reloader.java 2001/01/23 22:12:32 1.3
  +++ Reloader.java 2001/06/22 02:04:09 1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/Reloader.java,v
 1.3 2001/01/23 22:12:32 glenn Exp $
  - * $Revision: 1.3 $
  - * $Date: 2001/01/23 22:12:32 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/Reloader.java,v
 1.4 2001/06/22 02:04:09 remm Exp $
  + * $Revision: 1.4 $
  + * $Date: 2001/06/22 02:04:09 $
*
* 
*
  @@ -68,10 +68,10 @@
   /**
* Internal interface that codeClassLoader/code implementations may
* optionally implement to support the auto-reload functionality of
  - * codeStandardLoader/code.
  + * the classloader associated with the context.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2001/01/23 22:12:32 $
  + * @version $Revision: 1.4 $ $Date: 2001/06/22 02:04:09 $
*/
   
   public interface Reloader {
  
  
  
  1.20  +5 -5  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardClassLoader.java
  
  Index: StandardClassLoader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardClassLoader.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- StandardClassLoader.java  2001/06/12 03:53:26 1.19
  +++ StandardClassLoader.java  2001/06/22 02:04:11 1.20
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardClassLoader.java,v
 1.19 2001/06/12 03:53:26 craigmcc Exp $
  - * $Revision: 1.19 $
  - * $Date: 2001/06/12 03:53:26 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardClassLoader.java,v
 1.20 2001/06/22 02:04:11 remm Exp $
  + * $Revision: 1.20 $
  + * $Date: 2001/06/22 02:04:11 $
*
* 
*
  @@ -93,7 +93,7 @@
* Subclass implementation of bjava.net.URLClassLoader/b that knows how
* to load classes from disk directories, as well as local and remote JAR
* files.  It also implements the codeReloader/code interface, to provide
  - * automatic reloading support to codeStandardLoader/code.
  + * automatic reloading support to the associated loader.
* p
* In all cases, URLs must conform to the contract specified by
* codeURLClassLoader/code - any URL that ends with a / character is
  @@ -110,7 +110,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.19 $ $Date: 2001/06/12 03:53:26 $
  + * @version $Revision: 1.20 $ $Date: 2001/06/22 02:04:11 $
*/
   
   public class StandardClassLoader
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappClassLoader.java

2001-06-22 Thread remm

remm01/06/22 10:29:22

  Modified:catalina/src/share/org/apache/catalina/loader
WebappClassLoader.java
  Log:
  - Forgot to rename StandardClassLoader - WebappClassLoader.
  
  Revision  ChangesPath
  1.3   +12 -12
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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WebappClassLoader.java2001/06/19 17:37:23 1.2
  +++ WebappClassLoader.java2001/06/22 17:29:22 1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
 1.2 2001/06/19 17:37:23 remm Exp $
  - * $Revision: 1.2 $
  - * $Date: 2001/06/19 17:37:23 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
 1.3 2001/06/22 17:29:22 remm Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/06/22 17:29:22 $
*
* 
*
  @@ -117,7 +117,7 @@
*
* @author Remy Maucherat
* @author Craig R. McClanahan
  - * @version $Revision: 1.2 $ $Date: 2001/06/19 17:37:23 $
  + * @version $Revision: 1.3 $ $Date: 2001/06/22 17:29:22 $
*/
   public class WebappClassLoader
   extends URLClassLoader
  @@ -576,10 +576,10 @@
loader = loader.getParent();
if (loader == null)
break;
  - if (!(loader instanceof StandardClassLoader))
  + if (!(loader instanceof WebappClassLoader))
continue;
   Extension extensions[] =
  -((StandardClassLoader) loader).findAvailable();
  +((WebappClassLoader) loader).findAvailable();
   for (int i = 0; i  extensions.length; i++)
   results.add(extensions[i]);
   }
  @@ -623,10 +623,10 @@
loader = loader.getParent();
   if (loader == null)
   break;
  -if (!(loader instanceof StandardClassLoader))
  +if (!(loader instanceof WebappClassLoader))
   continue;
   Extension extensions[] =
  -((StandardClassLoader) loader).findRequired();
  +((WebappClassLoader) loader).findRequired();
   for (int i = 0; i  extensions.length; i++)
   results.add(extensions[i]);
   }
  @@ -717,7 +717,7 @@
*/
   public String toString() {
   
  -StringBuffer sb = new StringBuffer(StandardClassLoader\r\n);
  +StringBuffer sb = new StringBuffer(WebappClassLoader\r\n);
   sb.append(  available:\r\n);
   Iterator available = this.available.iterator();
   while (available.hasNext()) {
  @@ -1187,7 +1187,7 @@
   
   /**
* Get the Permissions for a CodeSource.  If this instance
  - * of StandardClassLoader is for a web application context,
  + * of WebappClassLoader is for a web application context,
* add read FilePermissions for the base directory (if unpacked),
* the context URL, and jar file resources.
*
  @@ -1556,7 +1556,7 @@
*/
   private void log(String message) {
   
  - System.out.println(StandardClassLoader:  + message);
  + System.out.println(WebappClassLoader:  + message);
   
   }
   
  @@ -1569,7 +1569,7 @@
*/
   private void log(String message, Throwable throwable) {
   
  - System.out.println(StandardClassLoader:  + message);
  + System.out.println(WebappClassLoader:  + message);
throwable.printStackTrace(System.out);
   
   }
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core StandardContext.java

2001-06-23 Thread remm

remm01/06/23 14:55:39

  Modified:catalina/src/share/org/apache/catalina/core
StandardContext.java
  Log:
  - Reset the Jasper class loader when reloading, so that a new one will be
created. Jasper was always using the old (destroyed) CL before.
  - Make the work directory attribute a protected attribute (since its value will
never have to change). That protects it when clearing the attributes during a
reload (before, the CL setup was failing after a reload because it couldn't find
the work attribute).
  - Cleaned up a bit the binding / unbing order. Before, the old CL was still
bound when reloading the classes for the listeners. This shouldn't have
any real world effect, but it still is more correct this way.
  
  Revision  ChangesPath
  1.66  +36 -7 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- StandardContext.java  2001/06/23 19:50:30 1.65
  +++ StandardContext.java  2001/06/23 21:55:39 1.66
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.65 2001/06/23 19:50:30 craigmcc Exp $
  - * $Revision: 1.65 $
  - * $Date: 2001/06/23 19:50:30 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.66 2001/06/23 21:55:39 remm Exp $
  + * $Revision: 1.66 $
  + * $Date: 2001/06/23 21:55:39 $
*
* 
*
  @@ -141,7 +141,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.65 $ $Date: 2001/06/23 19:50:30 $
  + * @version $Revision: 1.66 $ $Date: 2001/06/23 21:55:39 $
*/
   
   public class StandardContext
  @@ -2305,8 +2305,8 @@
   }
   
   // Clear all application-originated servlet context attributes
  -//if (context != null)
  -//context.clearAttributes();
  +if (context != null)
  +context.clearAttributes();
   
   // Shut down filters and application event listeners
   filterStop();
  @@ -2321,6 +2321,12 @@
}
}
   
  +// Binding thread
  +unbindThread();
  +
  +// Dump the old Jasper loader
  +jasperLoader = null;
  +
   // Shut down our application class loader
if ((loader != null)  (loader instanceof Lifecycle)) {
try {
  @@ -2352,6 +2358,18 @@
   }
   }
   
  +// Binding thread
  +bindThread();
  +
  +ClassLoader oldCtxClassLoader = 
  +Thread.currentThread().getContextClassLoader();
  + ClassLoader classLoader = loader.getClassLoader();
  +
  +// Set the context class loader
  +if (classLoader != null) {
  +Thread.currentThread().setContextClassLoader(classLoader);
  +}
  +
   // Restart our session manager (AFTER naming context recreated/bound)
   if ((manager != null)  (manager instanceof Lifecycle)) {
   try {
  @@ -2375,6 +2393,11 @@
   }
   }
   
  +// Set the context class loader to the old class loader
  +if (classLoader != null) {
  +Thread.currentThread().setContextClassLoader(oldCtxClassLoader);
  +}
  +
   // Restart our currently defined servlets
for (int i = 0; i  children.length; i++) {
   if (!ok)
  @@ -3329,6 +3352,9 @@
   // Unbinding thread
   unbindThread();
   
  +// Dump the old Jasper loader
  +jasperLoader = null;
  +
   if (debug = 1)
   log(Stopping complete);
   
  @@ -3769,7 +3795,10 @@
   
// Set the appropriate servlet context attribute
getServletContext().setAttribute(Globals.WORK_DIR_ATTR, dir);
  -
  +if (getServletContext() instanceof ApplicationContext)
  +((ApplicationContext) getServletContext()).setAttributeReadOnly
  +(Globals.WORK_DIR_ATTR);
  +
   }
   
   
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core StandardWrapper.java

2001-06-23 Thread remm

remm01/06/23 14:56:38

  Modified:catalina/src/share/org/apache/catalina/core
StandardWrapper.java
  Log:
  - Make sure the old CL is bound after loading the servlet class. If there was
an exception, the new CL could remain bound.
  
  Revision  ChangesPath
  1.25  +40 -13
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapper.java
  
  Index: StandardWrapper.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapper.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- StandardWrapper.java  2001/05/14 04:51:19 1.24
  +++ StandardWrapper.java  2001/06/23 21:56:38 1.25
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapper.java,v
 1.24 2001/05/14 04:51:19 craigmcc Exp $
  - * $Revision: 1.24 $
  - * $Date: 2001/05/14 04:51:19 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapper.java,v
 1.25 2001/06/23 21:56:38 remm Exp $
  + * $Revision: 1.25 $
  + * $Date: 2001/06/23 21:56:38 $
*
* 
*
  @@ -105,7 +105,7 @@
* make them efficient are counter-productive.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.24 $ $Date: 2001/05/14 04:51:19 $
  + * @version $Revision: 1.25 $ $Date: 2001/06/23 21:56:38 $
*/
   
   public final class StandardWrapper
  @@ -785,24 +785,39 @@
   log(sm.getString(standardWrapper.jasperLoader, getName()));
   }
   
  +// Set the context class loader
  +if (classLoader != null) {
  +Thread.currentThread().setContextClassLoader(classLoader);
  +}
  +
// Load the specified servlet class from the appropriate class loader
Class classClass = null;
try {
  - if (classLoader != null)
  + if (classLoader != null) {
classClass = classLoader.loadClass(actualClass);
  - else
  + } else {
classClass = Class.forName(actualClass);
  +}
} catch (ClassNotFoundException e) {
unavailable(null);
  +// Restore the context ClassLoader
  + if (classLoader != null) {
  +Thread.currentThread().setContextClassLoader
  +(oldCtxClassLoader);
  +}
throw new ServletException
(sm.getString(standardWrapper.missingClass, actualClass),
 e);
}
if (classClass == null) {
  - unavailable(null);
  - throw new ServletException
  - (sm.getString(standardWrapper.missingClass, actualClass));
  - }
  +unavailable(null);
  +if (classLoader != null) {
  +Thread.currentThread().setContextClassLoader
  +(oldCtxClassLoader);
  +}
  +throw new ServletException
  +(sm.getString(standardWrapper.missingClass, actualClass));
  +}
   
// Instantiate and initialize an instance of the servlet class itself
Servlet servlet = null;
  @@ -810,10 +825,20 @@
servlet = (Servlet) classClass.newInstance();
} catch (ClassCastException e) {
unavailable(null);
  +// Restore the context ClassLoader
  + if (classLoader != null) {
  +Thread.currentThread().setContextClassLoader
  +(oldCtxClassLoader);
  +}
throw new ServletException
(sm.getString(standardWrapper.notServlet, actualClass), e);
} catch (Throwable e) {
unavailable(null);
  +// Restore the context ClassLoader
  + if (classLoader != null) {
  +Thread.currentThread().setContextClassLoader
  +(oldCtxClassLoader);
  +}
throw new ServletException
(sm.getString(standardWrapper.instantiate, actualClass), e);
}
  @@ -829,7 +854,6 @@
try {
instanceSupport.fireInstanceEvent(InstanceEvent.BEFORE_INIT_EVENT,
  servlet);
  -Thread.currentThread().setContextClassLoader(classLoader);
servlet.init(facade);
instanceSupport.fireInstanceEvent(InstanceEvent.AFTER_INIT_EVENT,
  servlet);
  @@ -852,8 +876,11 @@
throw new ServletException
(sm.getString(standardWrapper.initException, getName()), f);
} finally {
  -// restore the context ClassLoader
  -Thread.currentThread().setContextClassLoader(oldCtxClassLoader);
  +// Restore

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappLoader.java

2001-06-23 Thread remm

remm01/06/23 15:30:05

  Modified:catalina/src/share/org/apache/catalina/loader
WebappLoader.java
  Log:
  - Don't copy the JARs to the work directory if filesystem based.
  
  Revision  ChangesPath
  1.7   +34 -20
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java
  
  Index: WebappLoader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- WebappLoader.java 2001/06/21 01:39:08 1.6
  +++ WebappLoader.java 2001/06/23 22:30:04 1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.6 2001/06/21 01:39:08 remm Exp $
  - * $Revision: 1.6 $
  - * $Date: 2001/06/21 01:39:08 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.7 2001/06/23 22:30:04 remm Exp $
  + * $Revision: 1.7 $
  + * $Date: 2001/06/23 22:30:04 $
*
* 
*
  @@ -119,7 +119,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.6 $ $Date: 2001/06/21 01:39:08 $
  + * @version $Revision: 1.7 $ $Date: 2001/06/23 22:30:04 $
*/
   
   public class WebappLoader
  @@ -608,12 +608,13 @@
   
// Construct a class loader based on our current repositories list
try {
  - if (parentClassLoader == null)
  - classLoader = new WebappClassLoader(container.getResources());
  - else
  - classLoader = new WebappClassLoader
  -(parentClassLoader, container.getResources());
   
  +if (parentClassLoader == null) {
  +classLoader = new WebappClassLoader(container.getResources());
  +} else {
  +classLoader = new WebappClassLoader
  +(parentClassLoader, container.getResources());
  +}
   classLoader.setDebug(this.debug);
   classLoader.setDelegate(this.delegate);
   
  @@ -907,8 +908,18 @@
   
   if (libDir != null) {
   
  -File destDir = new File(workDir, libPath);
  -destDir.mkdirs();
  +boolean copyJars = false;
  +String absoluteLibPath = servletContext.getRealPath(libPath);
  +
  +File destDir = null;
  +
  +if (absoluteLibPath != null) {
  +destDir = new File(absoluteLibPath);
  +} else {
  +copyJars = true;
  +destDir = new File(workDir, libPath);
  +destDir.mkdirs();
  +}
   
   // Looking up directory /WEB-INF/lib in the context
   try {
  @@ -929,18 +940,21 @@
destFile.getAbsolutePath()));
   
   Resource jarResource = (Resource) binding.getObject();
  -if (copy(jarResource.streamContent(), 
  - new FileOutputStream(destFile))) {
  -if (classpath.length() != 0)
  -classpath.append(File.pathSeparator);
  -classpath.append(destFile.getAbsolutePath());
  +if (copyJars) {
  +if (!copy(jarResource.streamContent(), 
  +  new FileOutputStream(destFile)))
  +continue;
   }
  -
  +
  +if (classpath.length() != 0)
  +classpath.append(File.pathSeparator);
  +classpath.append(destFile.getAbsolutePath());
  +
   JarFile jarFile = new JarFile(destFile);
  -
  +
   classLoader.addJar(filename, jarFile, destFile);
   addRepository(filename);
  -
  +
   }
   } catch (NamingException e) {
   // Silent catch: it's valid that no /WEB-INF/lib directory 
  @@ -1255,7 +1269,7 @@
*/
   public void run() {
   
  - context.reload();
  +context.reload();
   
   }
   
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappClassLoader.java

2001-06-23 Thread remm

remm01/06/23 18:16:07

  Modified:catalina/src/share/org/apache/catalina/loader
WebappClassLoader.java
  Log:
  - The call to findResourceInternal should be wrapped in a privileged action.
Bug reported by Craig R. McClanahan
  
  Revision  ChangesPath
  1.6   +15 -6 
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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WebappClassLoader.java2001/06/23 22:38:03 1.5
  +++ WebappClassLoader.java2001/06/24 01:16:06 1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
 1.5 2001/06/23 22:38:03 remm Exp $
  - * $Revision: 1.5 $
  - * $Date: 2001/06/23 22:38:03 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
 1.6 2001/06/24 01:16:06 remm Exp $
  + * $Revision: 1.6 $
  + * $Date: 2001/06/24 01:16:06 $
*
* 
*
  @@ -124,7 +124,7 @@
*
* @author Remy Maucherat
* @author Craig R. McClanahan
  - * @version $Revision: 1.5 $ $Date: 2001/06/23 22:38:03 $
  + * @version $Revision: 1.6 $ $Date: 2001/06/24 01:16:06 $
*/
   public class WebappClassLoader
   extends URLClassLoader
  @@ -840,7 +840,7 @@
*
* @param name Name of the resource to be found
*/
  -public URL findResource(String name) {
  +public URL findResource(final String name) {
   
   if (debug = 3)
   log(findResource( + name + ));
  @@ -849,7 +849,16 @@
   
   ResourceEntry entry = (ResourceEntry) resourceEntries.get(name);
   if (entry == null) {
  -entry = findResourceInternal(name, name);
  +if (securityManager != null) {
  +entry = (ResourceEntry) AccessController.doPrivileged
  +(new PrivilegedAction() {
  +public Object run() {
  +return findResourceInternal(name, name);
  +}
  +}, accessController);
  +} else {
  +entry = findResourceInternal(name, name);
  +}
   }
   if (entry != null) {
   url = entry.source;
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/conf catalina.policy

2001-06-29 Thread remm

remm01/06/29 14:53:45

  Modified:catalina/src/conf catalina.policy
  Log:
  - Package name typo fix.
Patch submitted by Gennis Emerson gemerson at acm.org
  
  Revision  ChangesPath
  1.14  +2 -2  jakarta-tomcat-4.0/catalina/src/conf/catalina.policy
  
  Index: catalina.policy
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/conf/catalina.policy,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- catalina.policy   2001/06/29 18:01:09 1.13
  +++ catalina.policy   2001/06/29 21:53:43 1.14
  @@ -8,7 +8,7 @@
   //
   // * Read access to the document root directory
   //
  -// $Id: catalina.policy,v 1.13 2001/06/29 18:01:09 glenn Exp $
  +// $Id: catalina.policy,v 1.14 2001/06/29 21:53:43 remm Exp $
   // 
   
   
  @@ -85,7 +85,7 @@
   grant { 
   // Required for JNDI lookup of named JDBC DataSource's and
   // javamail named MimePart DataSource used to send mail
  -permission java.utim.PropertyPermission java.home, read;
  +permission java.util.PropertyPermission java.home, read;
   permission java.util.PropertyPermission java.naming.*, read;
   permission java.util.PropertyPermission javax.sql.*, read;
   
  
  
  



cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote ActionCode.java ActionHook.java OutputBuffer.java Request.java Response.java AdapterEventCode.java AdapterListener.java Note.java

2001-07-09 Thread remm

remm01/07/09 19:55:05

  Modified:coyote/src/java/org/apache/coyote OutputBuffer.java
Request.java Response.java
  Added:   coyote/src/java/org/apache/coyote ActionCode.java
ActionHook.java
  Removed: coyote/src/java/org/apache/coyote AdapterEventCode.java
AdapterListener.java Note.java
  Log:
  - Various updates to the Coyote API.
Note: The API can't be considered frozen until the port of at least one
connector is complete.
  - Status update : I have started porting the Java HTTP/1.1 connector.
I will patially rewrite it for more memory efficiency and a few additional
features.
  - On the adapter side, I'll write a simple adapter which will output the full
request information back to the client, and then I'll write an adapter
for Catalina.
  
  Revision  ChangesPath
  1.2   +0 -6  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/OutputBuffer.java
  
  Index: OutputBuffer.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/OutputBuffer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- OutputBuffer.java 2001/06/14 01:07:57 1.1
  +++ OutputBuffer.java 2001/07/10 02:55:01 1.2
  @@ -73,10 +73,4 @@
   throws IOException;
   
   
  -public void reset();
  -
  -
  -public void close();
  -
  -
   }
  
  
  
  1.2   +3 -8  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Request.java  2001/06/14 01:07:57 1.1
  +++ Request.java  2001/07/10 02:55:02 1.2
  @@ -153,7 +153,7 @@
   /**
* Notes.
*/
  -protected Note notes[] = new Note[Constants.MAX_NOTES];
  +protected Object notes[] = new Object[Constants.MAX_NOTES];
   
   
   /**
  @@ -349,12 +349,12 @@
   //  Per-Request notes 
   
   
  -public final void setNote(int pos, Note value) {
  +public final void setNote(int pos, Object value) {
notes[pos] = value;
   }
   
   
  -public final Note getNote(int pos) {
  +public final Object getNote(int pos) {
return notes[pos];
   }
   
  @@ -378,11 +378,6 @@
   serverPort=-1;

scookies.recycle();
  -
  -for (int i=0; i  Constants.MAX_NOTES; i++) {
  -if (notes[i] != null)
  -notes[i].recycle();
  -}
   
   unparsedURIMB.recycle();
   uriMB.recycle();
  
  
  
  1.2   +21 -23
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java
  
  Index: Response.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Response.java 2001/06/14 01:07:57 1.1
  +++ Response.java 2001/07/10 02:55:02 1.2
  @@ -111,7 +111,7 @@
   /**
* Notes.
*/
  -protected Note notes[] = new Note[Constants.MAX_NOTES];
  +protected Object notes[] = new Object[Constants.MAX_NOTES];
   
   
   /**
  @@ -136,9 +136,9 @@
   
   
   /**
  - * Adapter listener.
  + * Action hook.
*/
  -public AdapterListener listener;
  +public ActionHook hook;
   
   
   // - Properties
  @@ -159,35 +159,35 @@
   }
   
   
  -public AdapterListener getListener() {
  -return listener;
  +public ActionHook getHook() {
  +return hook;
   }
   
   
  -public void setAdapterListener(AdapterListener listener) {
  -this.listener = listener;
  +public void setHook(ActionHook hook) {
  +this.hook = hook;
   }
   
   
   //  Per-Response notes 
   
   
  -public final void setNote(int pos, Note value) {
  +public final void setNote(int pos, Object value) {
notes[pos] = value;
   }
   
   
  -public final Note getNote(int pos) {
  +public final Object getNote(int pos) {
return notes[pos];
   }
   
   
  -//  Events 
  +//  Actions 
   
   
  -public void sendEvent(AdapterEventCode eventCode, Object param) {
  -if (listener != null) {
  -listener.event(eventCode, param);
  +public void action(ActionCode actionCode, Object param) {
  +if (hook != null

cvs commit: jakarta-tomcat-4.0/catalina/src/bin catalina.bat

2001-07-10 Thread remm

remm01/07/10 00:35:46

  Modified:catalina/src/bin catalina.bat
  Log:
  - Syntax fix.
Patch submitted by Sergey A. Lipnevich sergeyli at pisem.net
  
  Revision  ChangesPath
  1.15  +2 -2  jakarta-tomcat-4.0/catalina/src/bin/catalina.bat
  
  Index: catalina.bat
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/catalina.bat,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- catalina.bat  2001/01/03 19:55:45 1.14
  +++ catalina.bat  2001/07/10 07:35:43 1.15
  @@ -12,7 +12,7 @@
   rem
   rem   JAVA_HOME Must point at your Java Development Kit installation.
   rem
  -rem $Id: catalina.bat,v 1.14 2001/01/03 19:55:45 craigmcc Exp $
  +rem $Id: catalina.bat,v 1.15 2001/07/10 07:35:43 remm Exp $
   rem ---
   
   
  @@ -68,7 +68,7 @@
   if %1 == stop goto doStop
   
   :doUsage
  -echo Usage:  catalina ( env | run | start | stop )
  +echo Usage:  catalina ( env ^| run ^| start ^| stop )
   echo Commands:
   echo   env -   Set up environment variables that Catalina would use
   echo   run -   Start Catalina in the current window
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpConnector.java

2001-07-10 Thread remm

remm01/07/10 00:36:44

  Modified:catalina/src/share/org/apache/catalina/connector/http
HttpConnector.java
  Log:
  - Negative value for maxProcessors means unlimited number of processors.
Bug reported by Kumar Mettu mettu.kumar at redspark.com
  
  Revision  ChangesPath
  1.18  +17 -11
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java
  
  Index: HttpConnector.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- HttpConnector.java2001/06/18 21:35:54 1.17
  +++ HttpConnector.java2001/07/10 07:36:42 1.18
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
 1.17 2001/06/18 21:35:54 remm Exp $
  - * $Revision: 1.17 $
  - * $Date: 2001/06/18 21:35:54 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
 1.18 2001/07/10 07:36:42 remm Exp $
  + * $Revision: 1.18 $
  + * $Date: 2001/07/10 07:36:42 $
*
* 
*
  @@ -95,7 +95,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.17 $ $Date: 2001/06/18 21:35:54 $
  + * @version $Revision: 1.18 $ $Date: 2001/07/10 07:36:42 $
*/
   
   
  @@ -805,18 +805,24 @@
   
synchronized (processors) {
if (processors.size()  0) {
  -//if (debug = 2)
  -//log(createProcessor: Reusing existing 
processor);
  +// if (debug = 2)
  +// log(createProcessor: Reusing existing processor);
return ((HttpProcessor) processors.pop());
   }
if ((maxProcessors  0)  (curProcessors  maxProcessors)) {
  -//if (debug = 2)
  -//log(createProcessor: Creating new 
processor);
  +// if (debug = 2)
  +// log(createProcessor: Creating new processor);
return (newProcessor());
   } else {
  -//if (debug = 2)
  -//log(createProcessor: Cannot create new 
processor);
  - return (null);
  +if (maxProcessors  0) {
  +// if (debug = 2)
  +// log(createProcessor: Creating new processor);
  +return (newProcessor());
  + } else {
  +// if (debug = 2)
  +// log(createProcessor: Cannot create new processor);
  +return (null);
  +}
   }
}
   
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http10 HttpConnector.java

2001-07-10 Thread remm

remm01/07/10 00:37:08

  Modified:catalina/src/share/org/apache/catalina/connector/http10
HttpConnector.java
  Log:
  - Negative value for maxProcessors means unlimited number of processors.
Bug reported by Kumar Mettu mettu.kumar at redspark.com
  
  Revision  ChangesPath
  1.7   +12 -7 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http10/HttpConnector.java
  
  Index: HttpConnector.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http10/HttpConnector.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- HttpConnector.java2001/05/09 23:42:14 1.6
  +++ HttpConnector.java2001/07/10 07:37:05 1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http10/HttpConnector.java,v
 1.6 2001/05/09 23:42:14 craigmcc Exp $
  - * $Revision: 1.6 $
  - * $Date: 2001/05/09 23:42:14 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http10/HttpConnector.java,v
 1.7 2001/07/10 07:37:05 remm Exp $
  + * $Revision: 1.7 $
  + * $Date: 2001/07/10 07:37:05 $
*
* 
*
  @@ -94,7 +94,7 @@
* purposes.  Not intended to be the final solution.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.6 $ $Date: 2001/05/09 23:42:14 $
  + * @version $Revision: 1.7 $ $Date: 2001/07/10 07:37:05 $
*/
   
   
  @@ -742,10 +742,15 @@
synchronized (processors) {
if (processors.size()  0)
return ((HttpProcessor) processors.pop());
  - if ((maxProcessors  0)  (curProcessors  maxProcessors))
  + if ((maxProcessors  0)  (curProcessors  maxProcessors)) {
return (newProcessor());
  - else
  - return (null);
  + } else {
  +if (maxProcessors  0) {
  +return (newProcessor());
  +} else {
  +return (null);
  +}
  +}
}
   
   }
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session LocalStrings.properties StandardSession.java

2001-07-10 Thread remm

remm01/07/10 15:08:30

  Modified:catalina/src/share/org/apache/catalina/session
LocalStrings.properties StandardSession.java
  Log:
  - Specifying a null name will result in a illegal arg exception being thrown.
Bug reported by Kumar Mettu mettu.kumar at redspark.com
  
  Revision  ChangesPath
  1.8   +1 -0  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/LocalStrings.properties,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- LocalStrings.properties   2001/04/26 01:40:55 1.7
  +++ LocalStrings.properties   2001/07/10 22:08:25 1.8
  @@ -42,6 +42,7 @@
   standardSession.sessionEvent=Session event listener threw exception
   standardSession.setAttribute.ise=setAttribute: Non-serializable attribute
   standardSession.setAttribute.ise=setAttribute: Session already invalidated
  +standardSession.setAttribute.namenull=setAttribute: name parameter cannot be null
   standardSession.sessionCreated=Created Session id = {0}
   persistentManager.loading=Loading {0} persisted sessions
   persistentManager.unloading=Saving {0} persisted sessions
  
  
  
  1.22  +9 -4  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardSession.java
  
  Index: StandardSession.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardSession.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- StandardSession.java  2001/07/10 03:18:57 1.21
  +++ StandardSession.java  2001/07/10 22:08:27 1.22
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardSession.java,v
 1.21 2001/07/10 03:18:57 jon Exp $
  - * $Revision: 1.21 $
  - * $Date: 2001/07/10 03:18:57 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardSession.java,v
 1.22 2001/07/10 22:08:27 remm Exp $
  + * $Revision: 1.22 $
  + * $Date: 2001/07/10 22:08:27 $
*
* 
*
  @@ -111,7 +111,7 @@
* @author Craig R. McClanahan
* @author Sean Legassick
* @author a href=mailto:[EMAIL PROTECTED];Jon S. Stevens/a
  - * @version $Revision: 1.21 $ $Date: 2001/07/10 03:18:57 $
  + * @version $Revision: 1.22 $ $Date: 2001/07/10 22:08:27 $
*/
   
   class StandardSession
  @@ -1021,6 +1021,11 @@
*  invalidated session
*/
   public void setAttribute(String name, Object value) {
  +
  +// Name cannot be null
  +if (name == null)
  +throw new IllegalArgumentException
  +(sm.getString(standardSession.setAttribute.namenull));
   
   // Null value is the same as removeAttribute()
   if (value == null) {
  
  
  



cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime PageContextImpl.java

2001-07-11 Thread remm

remm01/07/11 15:51:43

  Modified:jasper/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  - Fix infinite looping bug when doing an include followed by a forward.
The included attribute is now unset before forwarding, so that the JSP we
forward to doesn't think it's been included.
Bug reported by Eduardo Pelegri-Llopart.
  
  Revision  ChangesPath
  1.12  +13 -4 
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PageContextImpl.java  2001/07/10 20:20:02 1.11
  +++ PageContextImpl.java  2001/07/11 22:51:40 1.12
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
 1.11 2001/07/10 20:20:02 horwat Exp $
  - * $Revision: 1.11 $
  - * $Date: 2001/07/10 20:20:02 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
 1.12 2001/07/11 22:51:40 remm Exp $
  + * $Revision: 1.12 $
  + * $Date: 2001/07/11 22:51:40 $
*
* 
*
  @@ -396,7 +396,16 @@
   throws ServletException, IOException
   {
   String path = getAbsolutePathRelativeToContext(relativeUrlPath);
  -context.getRequestDispatcher(path).forward(request, response);
  +String includeUri 
  += (String) request.getAttribute(Constants.INC_SERVLET_PATH);
  +if (includeUri != null)
  +request.removeAttribute(Constants.INC_SERVLET_PATH);
  +try {
  +context.getRequestDispatcher(path).forward(request, response);
  +} finally {
  +if (includeUri != null)
  +request.setAttribute(Constants.INC_SERVLET_PATH, includeUri);
  +}
   }
   
   Stack writerStack = new Stack();
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory TyrexDataSourceFactory.java

2001-07-12 Thread remm

remm01/07/12 01:07:33

  Modified:catalina/src/share/org/apache/naming/factory
TyrexDataSourceFactory.java
  Log:
  - Support for Tyrex 0.9.7, which doesn't register the JDBC
driver automatically.
  
  Revision  ChangesPath
  1.3   +16 -10
jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/TyrexDataSourceFactory.java
  
  Index: TyrexDataSourceFactory.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/TyrexDataSourceFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TyrexDataSourceFactory.java   2000/11/04 22:27:06 1.2
  +++ TyrexDataSourceFactory.java   2001/07/12 08:07:27 1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/TyrexDataSourceFactory.java,v
 1.2 2000/11/04 22:27:06 remm Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/11/04 22:27:06 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/TyrexDataSourceFactory.java,v
 1.3 2001/07/12 08:07:27 remm Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/07/12 08:07:27 $
*
* 
*
  @@ -65,6 +65,8 @@
   package org.apache.naming.factory;
   
   import java.util.Hashtable;
  +import java.sql.Driver;
  +import java.sql.DriverManager;
   import javax.naming.Name;
   import javax.naming.Context;
   import javax.naming.NamingException;
  @@ -100,7 +102,7 @@
* /ul
* 
* @author Remy Maucherat
  - * @version $Revision: 1.2 $ $Date: 2000/11/04 22:27:06 $
  + * @version $Revision: 1.3 $ $Date: 2001/07/12 08:07:27 $
*/
   
   public class TyrexDataSourceFactory
  @@ -195,12 +197,19 @@
   ds.setDriverName(DEFAULT_DRIVER_NAME);
   }
   currentRefAddr = ref.get(DRIVER_CLASS_NAME);
  +String driverClassName = null;
   if (currentRefAddr != null) {
  -ds.setDriverClassName
  -(currentRefAddr.getContent().toString());
  +driverClassName = 
  +currentRefAddr.getContent().toString();
   } else {
  -ds.setDriverName(DEFAULT_DRIVER_CLASS_NAME);
  +driverClassName = DEFAULT_DRIVER_CLASS_NAME;
   }
  +ds.setDriverClassName(driverClassName);
  +
  +// Loading and registering JDBC driver
  +Class driverClass = Class.forName(driverClassName);
  +Driver databaseDriver = (Driver) driverClass.newInstance();
  +DriverManager.registerDriver(databaseDriver);
   
   if (ref.getClassName().equals
   (tyrex.jdbc.ServerDataSource)) {
  @@ -220,9 +229,6 @@
   return ds;
   
   } catch (Throwable t) {
  -// TEMP
  -t.printStackTrace();
  -// END TEMP
   // Another factory could handle this, so just give up
   return null;
   }
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina build.xml

2001-07-12 Thread remm

remm01/07/12 01:35:14

  Modified:catalina build.xml
  Log:
  - Don't skip building the standard object factories (they had been modified to
dynamically load the other factories, instead of relying on static linking).
  
  Revision  ChangesPath
  1.47  +0 -5  jakarta-tomcat-4.0/catalina/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/build.xml,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- build.xml 2001/06/22 20:08:40 1.46
  +++ build.xml 2001/07/12 08:35:06 1.47
  @@ -15,7 +15,6 @@
 property name=catalina.jaxp.parser.jar value=crimson.jar/
   
 property name=servletapi.home   value=../../jakarta-servletapi-4/dist/
  -  property name=avalon.dist   value=../../dist/avalon/
   
 property name=test.failonerror  value=true/
 property name=test.runner   value=junit.textui.TestRunner/
  @@ -138,10 +137,6 @@
excludes=**/CVS/**
 exclude name=**/factory/Tyrex*.java 
  unless=tyrex.present /
  -  exclude name=**/factory/ResourceFactory.java 
  -   unless=jdbcse.present /
  -  exclude name=**/factory/TransactionFactory.java 
  -   unless=jta.present /
 exclude name=**/factory/MailSessionFactory.java
  unless=javamail.present /
 exclude name=**/factory/SendMailFactory.java
  
  
  



cvs commit: jakarta-tomcat-4.0/webapps/examples/jsp index.html

2001-07-12 Thread remm

remm01/07/12 02:25:02

  Modified:webapps/examples/jsp index.html
  Log:
  - Fix links in the jsp examples HTML page.
Patch submitted by Hiten Pandya h_pandya5 at hotmail.com
  
  Revision  ChangesPath
  1.2   +3 -3  jakarta-tomcat-4.0/webapps/examples/jsp/index.html
  
  Index: index.html
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/examples/jsp/index.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- index.html2000/08/17 00:58:03 1.1
  +++ index.html2001/07/12 09:24:54 1.2
  @@ -88,15 +88,15 @@
   tr VALIGN=TOP
   tdCheckboxnbsp;/td
   
  -td VALIGN=TOP WIDTH=30%a href=/checkbox/check.htmlimg 
SRC=../images/execute.gif HSPACE=4 BORDER=0  align=TOP/aa 
href=checkbox/check.htmlExecute/a/td
  +td VALIGN=TOP WIDTH=30%a href=checkbox/check.htmlimg 
SRC=../images/execute.gif HSPACE=4 BORDER=0  align=TOP/aa 
href=checkbox/check.htmlExecute/a/td
   
  -td WIDTH=30%a href=colors/cresult.htmlimg SRC=../images/code.gif 
HSPACE=4 BORDER=0 height=24 width=24 align=TOP/aa 
href=checkbox/cresult.htmlSource/a/td
  +td WIDTH=30%a href=checkbox/cresult.htmlimg SRC=../images/code.gif 
HSPACE=4 BORDER=0 height=24 width=24 align=TOP/aa 
href=checkbox/cresult.htmlSource/a/td
   /tr
   
   tr VALIGN=TOP
   tdColornbsp;/td
   
  -td VALIGN=TOP WIDTH=30%a href=/colors/colors.htmlimg 
SRC=../images/execute.gif HSPACE=4 BORDER=0  align=TOP/aa 
href=colors/colors.htmlExecute/a/td
  +td VALIGN=TOP WIDTH=30%a href=colors/colors.htmlimg 
SRC=../images/execute.gif HSPACE=4 BORDER=0  align=TOP/aa 
href=colors/colors.htmlExecute/a/td
   
   td WIDTH=30%a href=colors/clr.html.htmlimg SRC=../images/code.gif 
HSPACE=4 BORDER=0 height=24 width=24 align=TOP/aa 
href=colors/clr.htmlSource/a/td
   /tr
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappClassLoader.java

2001-07-12 Thread remm

remm01/07/12 14:22:32

  Modified:catalina/src/share/org/apache/catalina/loader
WebappClassLoader.java
  Log:
  - The addRepository call will now add the specified repository (if it's a valid URL)
to the superclass (URLClassLoader) so that repositories which are not
standard webapp class repositories can be added to the classloader.
  - If the internal class loading fails, WebappClassLoader will now call
super.findClass.
  - Implementation note : class and JAR reloading is not supported in non standard
class repositories.
  - WebappClassLoader should now behave the same way StandardClassLoader
did.
  - Should fix integration issues with the J2EE RI.
  
  Revision  ChangesPath
  1.8   +37 -10
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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WebappClassLoader.java2001/06/26 21:02:18 1.7
  +++ WebappClassLoader.java2001/07/12 21:22:25 1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
 1.7 2001/06/26 21:02:18 glenn Exp $
  - * $Revision: 1.7 $
  - * $Date: 2001/06/26 21:02:18 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
 1.8 2001/07/12 21:22:25 remm Exp $
  + * $Revision: 1.8 $
  + * $Date: 2001/07/12 21:22:25 $
*
* 
*
  @@ -123,7 +123,7 @@
*
* @author Remy Maucherat
* @author Craig R. McClanahan
  - * @version $Revision: 1.7 $ $Date: 2001/06/26 21:02:18 $
  + * @version $Revision: 1.8 $ $Date: 2001/07/12 21:22:25 $
*/
   public class WebappClassLoader
   extends URLClassLoader
  @@ -448,7 +448,19 @@
*/
   public void addRepository(String repository) {
   
  -addRepository(repository, new File(repository));
  +// Ignore any of the standard repositories, as they are set up using 
  +// either addJar or addRepository
  +if (repository.startsWith(/WEB-INF/lib)
  +|| repository.startsWith(/WEB-INF/classes))
  +return;
  +
  +// Add this repository to our underlying class loader
  +try {
  +URL url = new URL(repository);
  +super.addURL(url);
  +} catch (MalformedURLException e) {
  +throw new IllegalArgumentException(e.toString());
  +}
   
   }
   
  @@ -463,7 +475,7 @@
* @exception IllegalArgumentException if the specified repository is
*  invalid or does not exist
*/
  -public synchronized void addRepository(String repository, File file) {
  +synchronized void addRepository(String repository, File file) {
   
   // Note : There should be only one (of course), but I think we should 
   // keep this a bit generic
  @@ -495,7 +507,7 @@
   }
   
   
  -public synchronized void addJar(String jar, JarFile jarFile, File file)
  +synchronized void addJar(String jar, JarFile jarFile, File file)
   throws IOException {
   
   if (jar == null)
  @@ -809,7 +821,7 @@
   Class clazz = null;
   try {
if (debug = 4)
  - log(  super.findClass( + name + ));
  + log(  findClassInternal( + name + ));
try {
clazz = findClassInternal(name);
   } catch(AccessControlException ace) {
  @@ -821,6 +833,17 @@
throw e;
}
   if (clazz == null) {
  +try {
  +clazz = super.findClass(name);
  +} catch(AccessControlException ace) {
  +throw new ClassNotFoundException(name);
  +} catch (RuntimeException e) {
  +if (debug = 4)
  +log(  --RuntimeException Rethrown, e);
  +throw e;
  +}
  +}
  +if (clazz == null) {
   if (debug = 3)
   log(-- Returning ClassNotFoundException);
   throw new ClassNotFoundException(name);
  @@ -1262,9 +1285,11 @@
*/
   public URL[] getURLs() {
   
  +URL[] external = super.getURLs();
  +
   int filesLength = files.length;
   int jarFilesLength = jarRealFiles.length;
  -int length = filesLength + jarFilesLength;
  +int length = filesLength + jarFilesLength + external.length;
   int i;
   
   try {
  @@ -1273,8 +1298,10 @@
   for (i = 0; i  length; i

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappLoader.java

2001-07-12 Thread remm

remm01/07/12 14:24:15

  Modified:catalina/src/share/org/apache/catalina/loader
WebappLoader.java
  Log:
  - Cleanup of the classpath generation.
  - Implemented addRepository the way it was implemented in StandardLoader.
  - Should fix integration issues with the J2EE RI.
  
  Revision  ChangesPath
  1.8   +25 -36
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java
  
  Index: WebappLoader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WebappLoader.java 2001/06/23 22:30:04 1.7
  +++ WebappLoader.java 2001/07/12 21:24:09 1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.7 2001/06/23 22:30:04 remm Exp $
  - * $Revision: 1.7 $
  - * $Date: 2001/06/23 22:30:04 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.8 2001/07/12 21:24:09 remm Exp $
  + * $Revision: 1.8 $
  + * $Date: 2001/07/12 21:24:09 $
*
* 
*
  @@ -119,7 +119,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.7 $ $Date: 2001/06/23 22:30:04 $
  + * @version $Revision: 1.8 $ $Date: 2001/07/12 21:24:09 $
*/
   
   public class WebappLoader
  @@ -267,13 +267,6 @@
   private String threadName = WebappLoader;
   
   
  -/**
  - * Classpath (which can be used by any webapp which would need to compile
  - * classes, like a JSP engine.
  - */
  -protected StringBuffer classpath = new StringBuffer();
  -
  -
   // - Properties
   
   
  @@ -493,6 +486,7 @@
   
   if (debug = 1)
log(sm.getString(webappLoader.addRepository, repository));
  +
   for (int i = 0; i  repositories.length; i++) {
   if (repository.equals(repositories[i]))
   return;
  @@ -503,6 +497,11 @@
results[repositories.length] = repository;
repositories = results;
   
  + if (started  (classLoader != null)) {
  + classLoader.addRepository(repository);
  + setClassPath();
  + }
  +
   }
   
   
  @@ -618,9 +617,13 @@
   classLoader.setDebug(this.debug);
   classLoader.setDelegate(this.delegate);
   
  +for (int i = 0; i  repositories.length; i++) {
  +classLoader.addRepository(repositories[i]);
  +}
  +
   // Configure our repositories
  -setClassPath();
   setRepositories();
  +setClassPath();
   
if (container instanceof Context) {
// Tell the class loader the root of the context
  @@ -832,9 +835,6 @@
   
   log(sm.getString(webappLoader.deploy, workDir.getAbsolutePath()));
   
  -// Reset repositories
  -repositories = new String[0];
  -
   DirContext resources = container.getResources();
   
   // Setting up the class repository (/WEB-INF/classes), if it exists
  @@ -861,18 +861,12 @@
   
   if (absoluteClassesPath != null) {
   
  -if (classpath.length() != 0)
  -classpath.append(File.pathSeparator);
  -classpath.append(absoluteClassesPath);
   classRepository = new File(absoluteClassesPath);
   
   } else {
   
  -if (classpath.length() != 0)
  -classpath.append(File.pathSeparator);
   classRepository = new File(workDir, classesPath);
   classRepository.mkdirs();
  -classpath.append(classRepository.getAbsolutePath());
   
   log(sm.getString(webappLoader.classDeploy, classesPath,
classRepository.getAbsolutePath()));
  @@ -884,9 +878,6 @@
   // Adding the repository to the class loader
   classLoader.addRepository(classesPath + /, classRepository);
   
  -// Add to the local repository list
  -addRepository(classesPath + /);
  -
   }
   
   // Setting up the JAR repository (/WEB-INF/lib), if it exists
  @@ -946,30 +937,20 @@
   continue;
   }
   
  -if (classpath.length() != 0)
  -classpath.append(File.pathSeparator);
  -classpath.append(destFile.getAbsolutePath());
  -
   JarFile jarFile = new JarFile(destFile);
   
   classLoader.addJar(filename, jarFile, destFile

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappLoader.java

2001-07-12 Thread remm

remm01/07/12 16:42:59

  Modified:catalina/src/share/org/apache/catalina/loader
WebappLoader.java
  Log:
  - Fix classpath generation problem on Unix.
  
  Revision  ChangesPath
  1.9   +4 -6  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java
  
  Index: WebappLoader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WebappLoader.java 2001/07/12 21:24:09 1.8
  +++ WebappLoader.java 2001/07/12 23:42:57 1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.8 2001/07/12 21:24:09 remm Exp $
  - * $Revision: 1.8 $
  - * $Date: 2001/07/12 21:24:09 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.9 2001/07/12 23:42:57 remm Exp $
  + * $Revision: 1.9 $
  + * $Date: 2001/07/12 23:42:57 $
*
* 
*
  @@ -119,7 +119,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.8 $ $Date: 2001/07/12 21:24:09 $
  + * @version $Revision: 1.9 $ $Date: 2001/07/12 23:42:57 $
*/
   
   public class WebappLoader
  @@ -983,8 +983,6 @@
   String repository = repositories[i].toString();
   if (repository.startsWith(file://))
   repository = repository.substring(7);
  -else if (repository.startsWith(file:/))
  -repository = repository.substring(6);
   else if (repository.startsWith(file:))
   repository = repository.substring(5);
   else if (repository.startsWith(jndi:))
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappLoader.java

2001-07-12 Thread remm

remm01/07/12 18:47:50

  Modified:catalina/src/share/org/apache/catalina/loader
WebappLoader.java
  Log:
  - Cleanup of the permission generation in the new WebappLoader.
  
  Revision  ChangesPath
  1.10  +85 -37
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java
  
  Index: WebappLoader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- WebappLoader.java 2001/07/12 23:42:57 1.9
  +++ WebappLoader.java 2001/07/13 01:47:47 1.10
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.9 2001/07/12 23:42:57 remm Exp $
  - * $Revision: 1.9 $
  - * $Date: 2001/07/12 23:42:57 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.10 2001/07/13 01:47:47 remm Exp $
  + * $Revision: 1.10 $
  + * $Date: 2001/07/13 01:47:47 $
*
* 
*
  @@ -119,7 +119,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.9 $ $Date: 2001/07/12 23:42:57 $
  + * @version $Revision: 1.10 $ $Date: 2001/07/13 01:47:47 $
*/
   
   public class WebappLoader
  @@ -625,44 +625,15 @@
   setRepositories();
   setClassPath();
   
  - if (container instanceof Context) {
  - // Tell the class loader the root of the context
  - ServletContext servletContext = 
  -((Context) container).getServletContext();
  - try {
  - URL contextURL = servletContext.getResource(/);
  - if( contextURL != null ) {
  - ((WebappClassLoader)classLoader).setPermissions
  -(contextURL);
  -String jarUrl = jar: + contextURL.toString() 
  -+ WEB-INF/lib/;
  -((WebappClassLoader)classLoader).setPermissions
  -(jarUrl);  
  -}
  -String contextRoot = servletContext.getRealPath(/);
  -if (contextRoot != null) {
  -((WebappClassLoader)classLoader).setPermissions
  -(contextRoot);
  -String rootUrl = file: + contextRoot;
  -((WebappClassLoader)classLoader).setPermissions
  -(rootUrl);
  - }
  -File workDir = 
  -(File) servletContext.getAttribute
  -(Globals.WORK_DIR_ATTR);
  -if (workDir != null) {
  -File libDir = new File(workDir, WEB-INF/lib/);
  -((WebappClassLoader)classLoader).setPermissions
  -(libDir.getAbsolutePath());
  -}
  - } catch (MalformedURLException e) {
  - }
  - }
  +setPermissions();
  +
if (classLoader instanceof Lifecycle)
((Lifecycle) classLoader).start();
  +
   // Binding the Webapp class loader to the directory context
   DirContextURLStreamHandler.bind
   ((ClassLoader) classLoader, this.container.getResources());
  +
} catch (Throwable t) {
throw new LifecycleException(start: , t);
}
  @@ -811,6 +782,83 @@
   new WebappContextNotifier((Context) container);
(new Thread(notifier)).start();
   
  +}
  +
  +
  +/**
  + * Configure associated class loader permissions.
  + */
  +private void setPermissions() {
  +
  +if (System.getSecurityManager() == null)
  +return;
  +if (!(container instanceof Context))
  +return;
  +
  +// Tell the class loader the root of the context
  +ServletContext servletContext = 
  +((Context) container).getServletContext();
  +
  +try {
  +
  +URL classesURL = 
  +servletContext.getResource(/WEB-INF/classes/);
  +if (classesURL != null)
  +classLoader.setPermissions(classesURL);
  +
  +URL libURL = servletContext.getResource(/WEB-INF/lib/);
  +if (libURL != null) {
  +classLoader.setPermissions(libURL);
  +}
  +
  +String contextRoot = servletContext.getRealPath(/);
  +if (contextRoot != null) {
  +
  +if (libURL != null

cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime JspException.java

2001-07-12 Thread remm

remm01/07/12 18:49:32

  Added:   jasper/src/share/org/apache/jasper/runtime JspException.java
  Log:
  - Add new runtime JspException, which extends JasperException, to allow
setting tougher security restrictions.
  - (Justy, if it's not ok to do that, let me know)
  
  Revision  ChangesPath
  1.1  
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime/JspException.java
  
  Index: JspException.java
  ===
  /*
   * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime/JspException.java,v
 1.1 2001/07/13 01:49:31 remm Exp $
   * $Revision: 1.1 $
   * $Date: 2001/07/13 01:49:31 $
   *
   * 
   * 
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *notice, this list of conditions and the following disclaimer in
   *the documentation and/or other materials provided with the
   *distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *any, must include the following acknowlegement:  
   *   This product includes software developed by the 
   *Apache Software Foundation (http://www.apache.org/).
   *Alternately, this acknowlegement may appear in the software itself,
   *if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names The Jakarta Project, Tomcat, and Apache Software
   *Foundation must not be used to endorse or promote products derived
   *from this software without prior written permission. For written 
   *permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called Apache
   *nor may Apache appear in their names without prior written
   *permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * 
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * http://www.apache.org/.
   *
   */ 
  
  package org.apache.jasper.runtime;
  
  /**
   * Base class for all exceptions generated by the JSP engine. Makes it
   * convienient to catch just this at the top-level. 
   *
   * @author Anil K. Vijendran
   */
  public class JspException extends org.apache.jasper.JasperException {
  
  public JspException(String reason) {
super(reason);
  }
  
  /**
   * Creates a JasperException with the embedded exception and the reason for
   * throwing a JasperException
   */
  public JspException (String reason, Throwable exception) {
super(reason, exception);
  }
  
  /**
   * Creates a JasperException with the embedded exception
   */
  public JspException (Throwable exception) {
super(exception);
  }
  }
  
  
  



cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler JspParseEventListener.java

2001-07-12 Thread remm

remm01/07/12 18:50:57

  Modified:jasper/src/share/org/apache/jasper/compiler
JspParseEventListener.java
  Log:
  - Generate code with JspException instead of JasperException, which fixes
an instantiation problem when running with a security manager.
  
  Revision  ChangesPath
  1.32  +4 -4  
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java
  
  Index: JspParseEventListener.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- JspParseEventListener.java2001/07/10 23:50:26 1.31
  +++ JspParseEventListener.java2001/07/13 01:50:55 1.32
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
 1.31 2001/07/10 23:50:26 horwat Exp $
  - * $Revision: 1.31 $
  - * $Date: 2001/07/10 23:50:26 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
 1.32 2001/07/13 01:50:55 remm Exp $
  + * $Revision: 1.32 $
  + * $Date: 2001/07/13 01:50:55 $
*
* 
*
  @@ -296,7 +296,7 @@
   writer.println(private static boolean _jspx_inited = false;);
   writer.println();
   
  -writer.println(public final void _jspx_init() throws 
org.apache.jasper.JasperException {);
  +writer.println(public final void _jspx_init() throws 
org.apache.jasper.runtime.JspException {);
   writer.pushIndent();
generateAll(InitMethodPhase.class);
   writer.popIndent();
  
  
  



cvs commit: jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes SnoopServlet.java

2001-07-12 Thread remm

remm01/07/12 22:06:02

  Modified:webapps/examples/WEB-INF/classes SnoopServlet.java
  Log:
  - If there are no cookies, getCookies will return null.
  
  Revision  ChangesPath
  1.2   +7 -4  
jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes/SnoopServlet.java
  
  Index: SnoopServlet.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes/SnoopServlet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SnoopServlet.java 2000/08/17 00:57:53 1.1
  +++ SnoopServlet.java 2001/07/13 05:05:58 1.2
  @@ -1,4 +1,4 @@
  -/* $Id: SnoopServlet.java,v 1.1 2000/08/17 00:57:53 horwat Exp $
  +/* $Id: SnoopServlet.java,v 1.2 2001/07/13 05:05:58 remm Exp $
*
*/
   
  @@ -97,9 +97,12 @@
   out.println();  
   out.println(Cookies in this request:);
   Cookie[] cookies = request.getCookies();
  -for (int i = 0; i  cookies.length; i++) {
  -Cookie cookie = cookies[i];
  -out.println(+ cookie.getName() +  =  + cookie.getValue());
  +if (cookies != null) {
  +for (int i = 0; i  cookies.length; i++) {
  +Cookie cookie = cookies[i];
  +out.println(+ cookie.getName() +  =  
  ++ cookie.getValue());
  +}
   }
   out.println();
   
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpRequestLine.java

2001-07-12 Thread remm

remm01/07/12 22:09:38

  Modified:catalina/src/share/org/apache/catalina/connector/http
HttpRequestLine.java
  Log:
  - Raise the maximum size of the buffers, which was a bit too restrictive.
  
  Revision  ChangesPath
  1.4   +7 -7  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestLine.java
  
  Index: HttpRequestLine.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestLine.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HttpRequestLine.java  2001/05/16 17:52:17 1.3
  +++ HttpRequestLine.java  2001/07/13 05:09:32 1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestLine.java,v
 1.3 2001/05/16 17:52:17 remm Exp $
  - * $Revision: 1.3 $
  - * $Date: 2001/05/16 17:52:17 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestLine.java,v
 1.4 2001/07/13 05:09:32 remm Exp $
  + * $Revision: 1.4 $
  + * $Date: 2001/07/13 05:09:32 $
*
* 
*
  @@ -75,7 +75,7 @@
* HTTP request line enum type.
*
* @author Remy Maucherat
  - * @version $Revision: 1.3 $ $Date: 2001/05/16 17:52:17 $
  + * @version $Revision: 1.4 $ $Date: 2001/07/13 05:09:32 $
*/
   
   final class HttpRequestLine {
  @@ -87,9 +87,9 @@
   public static final int INITIAL_METHOD_SIZE = 8;
   public static final int INITIAL_URI_SIZE = 64;
   public static final int INITIAL_PROTOCOL_SIZE = 8;
  -public static final int MAX_METHOD_SIZE = 128;
  -public static final int MAX_URI_SIZE = 4096;
  -public static final int MAX_PROTOCOL_SIZE = 32;
  +public static final int MAX_METHOD_SIZE = 1024;
  +public static final int MAX_URI_SIZE = 32768;
  +public static final int MAX_PROTOCOL_SIZE = 1024;
   
   
   // --- Constructors
  
  
  



cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler CharDataGenerator.java MappedCharDataGenerator.java

2001-07-13 Thread remm

remm01/07/13 12:17:13

  Modified:jasper/src/share/org/apache/jasper/compiler
CharDataGenerator.java MappedCharDataGenerator.java
  Log:
  - With Jasper's ServletWriter, println(String) != print(String) followed by 
println(),
because it adds the indentation. I think println(String) shouldn't do the 
identation,
but we'll keep that fix for later :)
  
  Revision  ChangesPath
  1.3   +5 -4  
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/CharDataGenerator.java
  
  Index: CharDataGenerator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/CharDataGenerator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CharDataGenerator.java2001/07/12 21:41:08 1.2
  +++ CharDataGenerator.java2001/07/13 19:17:07 1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/CharDataGenerator.java,v
 1.2 2001/07/12 21:41:08 horwat Exp $
  - * $Revision: 1.2 $
  - * $Date: 2001/07/12 21:41:08 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/CharDataGenerator.java,v
 1.3 2001/07/13 19:17:07 remm Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/07/13 19:17:07 $
*
* 
* 
  @@ -126,7 +126,8 @@
}
}
writer.print(sb.toString());
  - writer.println(\););
  +writer.print(\););
  +writer.println();
   }
   
   
  
  
  
  1.3   +5 -4  
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/MappedCharDataGenerator.java
  
  Index: MappedCharDataGenerator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/MappedCharDataGenerator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MappedCharDataGenerator.java  2001/07/12 21:41:06 1.2
  +++ MappedCharDataGenerator.java  2001/07/13 19:17:08 1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/MappedCharDataGenerator.java,v
 1.2 2001/07/12 21:41:06 horwat Exp $
  - * $Revision: 1.2 $
  - * $Date: 2001/07/12 21:41:06 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/MappedCharDataGenerator.java,v
 1.3 2001/07/13 19:17:08 remm Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/07/13 19:17:08 $
*
* 
* 
  @@ -116,6 +116,7 @@
}
}
writer.print(sb.toString());
  - writer.println(\););
  +writer.print(\););
  +writer.println();
   }
   }
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/bin catalina.bat

2001-07-13 Thread remm

remm01/07/13 15:37:21

  Modified:catalina/src/bin catalina.bat
  Log:
  - Need quotes if CATALINA_HOME contains spaces.
  
  Revision  ChangesPath
  1.16  +2 -2  jakarta-tomcat-4.0/catalina/src/bin/catalina.bat
  
  Index: catalina.bat
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/catalina.bat,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- catalina.bat  2001/07/10 07:35:43 1.15
  +++ catalina.bat  2001/07/13 22:37:20 1.16
  @@ -12,7 +12,7 @@
   rem
   rem   JAVA_HOME Must point at your Java Development Kit installation.
   rem
  -rem $Id: catalina.bat,v 1.15 2001/07/10 07:35:43 remm Exp $
  +rem $Id: catalina.bat,v 1.16 2001/07/13 22:37:20 remm Exp $
   rem ---
   
   
  @@ -97,7 +97,7 @@
   goto cleanup
   
   :doStop
  -%_RUNJAVA% %CATALINA_OPTS% -Dcatalina.home=%CATALINA_HOME% 
org.apache.catalina.startup.Bootstrap %2 %3 %4 %5 %6 %7 %8 %9 stop
  +%_RUNJAVA% %CATALINA_OPTS% -Dcatalina.home=%CATALINA_HOME% 
org.apache.catalina.startup.Bootstrap %2 %3 %4 %5 %6 %7 %8 %9 stop
   goto cleanup
   
   
  
  
  



cvs commit: jakarta-tomcat-4.0 tomcat.nsi tomcat.ico build.xml

2001-07-13 Thread remm

remm01/07/13 16:15:28

  Modified:.build.xml
  Added:   .tomcat.nsi tomcat.ico
  Log:
  - Add an experimental installer based on Nullsoft Installer. I just
started toying with it a couple hours ago, but it's so easy to use I was able
to generate an install script for Tomcat in no time.
  - It's Windows-only, sorry. I like native installers a lot better. The main advantage
of using Nullsoft's is that :
- It's free (open source)
- It's easy to use
- It's small and fast
  - The installer will only be able to set CATALINA_HOME under Win2k or WinXP.
Under older versions of Windows, you may have to set it manually. You need
to log off and back on before you can use Tomcat 4.0.
  - The uninstaller won't remove the CATALINA_HOME env variable it creates
(attempting to do it wiped out all my user env variables on my setup, so
I removed it until I figure out how to do it right).
  - I'll upload (if I have enough karma) a generated installer to the
Tomcat 4 nightly directory, so that people can easily try it (and complain :))
  - Comments are welcome :)
  - Download Nullsoft Installer (only needed to generate the installer) at
http://www.winamp.com/nsdn/superpimp
  - Thanks to Henri for suggesting we should have a look at it.
  
  Revision  ChangesPath
  1.24  +13 -0 jakarta-tomcat-4.0/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/build.xml,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- build.xml 2001/05/22 01:59:04 1.23
  +++ build.xml 2001/07/13 23:15:28 1.24
  @@ -162,6 +162,19 @@
 /target
   
   
  +  !-- = DIST: Create Windows Installer === --
  +  target name=installer depends=dist
  +echo message=Builds a Windows installer based on Nullsoft Installer/
  +echo message=The target requires Nullsoft Installer to be in your PATH/
  +copy file=tomcat.ico tofile=${tomcat.dist}/tomcat.ico/
  +copy file=tomcat.nsi tofile=${tomcat.dist}/tomcat.nsi/
  +copy file=README.txt tofile=${tomcat.dist}/README.txt/
  +exec dir=${tomcat.dist} executable=makensis.exe
  +  arg value=tomcat.nsi/
  +/exec
  +  /target
  +
  +
 !-- == DIST: Clean Directory === --
 target name=dist-clean
   delete dir=${tomcat.dist}/
  
  
  
  1.1  jakarta-tomcat-4.0/tomcat.nsi
  
  Index: tomcat.nsi
  ===
  
  ; Tomcat 4 script for Nullsoft Installer
  
  !ifdef NO_COMPRESSION
  SetCompress off
  SetDatablockOptimize off
  !endif
  
  !ifdef NO_CRC
  CRCCheck off
  !endif
  
  Name NSIS
  Caption Jakarta Tomcat 4.0
  OutFile tomcat4.exe
  
  #BGGradient 00 80 FF
  #InstallColors FF8080 00
  
  LicenseText You must read the following license before installing:
  LicenseData LICENSE
  ComponentText This will install the Jakarta Tomcat 4.0 servlet container on your 
computer:
  InstType Normal
  InstType Full (w/ Source Code)
  AutoCloseWindow false
  ShowInstDetails show
  DirText Please select a location to install Tomcat 4.0 (or use the default):
  SetOverwrite on
  SetDateSave on
  !ifdef HAVE_UPX
!packhdr tmp.dat upx\upx --best --compress-icons=1 tmp.dat
  !endif
  
  InstallDir $PROGRAMFILES\Jakarta Tomcat 4.0
  InstallDirRegKey HKLM SOFTWARE\Apache\Jakarta\Tomcat 4.0 
  
  Section Tomcat 4.0 (required)
SectionIn 1 2
SetOutPath $INSTDIR
File tomcat.ico
File LICENSE
File README.txt
File /r bin
File /r common
File /r conf
File /r jasper
File /r lib
File /r logs
File /r server
File /r webapps
File /r work
  SectionEnd
  
  Section JSP Development Shell Extensions
SectionIn 1 2
  
; back up old value of .nsi
ReadRegStr $1 HKCR .jsp 
StrCmp $1  Label1
  StrCmp $1 JSPFile Label1
  WriteRegStr HKCR .jsp backup_val $1
  Label1:
  
WriteRegStr HKCR .jsp  JSPFile
WriteRegStr HKCR JSPFile  Java Server Pages source
WriteRegStr HKCR JSPFile\shell  open
WriteRegStr HKCR JSPFile\DefaultIcon  $INSTDIR\tomcat.ico
WriteRegStr HKCR JSPFile\shell\open\command  'notepad.exe %1'
WriteRegStr HKCR JSPFile\shell\compile  Compile JSP
WriteRegStr HKCR JSPFile\shell\compile\command  '$INSTDIR\bin\jspc.bat %1'
  SectionEnd
  
  Section Tomcat 4.0 Start Menu Group
SectionIn 1 2
SetOutPath $SMPROGRAMS\Tomcat 4.0
CreateShortCut $SMPROGRAMS\Tomcat 4.0\Tomcat Home Page.lnk \
   http://jakarta.apache.org/tomcat;
CreateShortCut $SMPROGRAMS\Tomcat 4.0\Uninstall Tomcat 4.0.lnk \
   $INSTDIR\uninst-tomcat4.exe
CreateShortCut $SMPROGRAMS\Tomcat 4.0\Tomcat 4.0 Documentation.lnk \
   http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html;
CreateShortCut

cvs commit: jakarta-tomcat-4.0 tomcat.nsi

2001-07-13 Thread remm

remm01/07/13 20:03:40

  Modified:.tomcat.nsi
  Log:
  - Plenty of fixes
  - Don't try to modify the env variables in the registry
  - The shortcuts should now run with Win9x (since they don't rely anymore on
CATALINA_HOME being set)
  - Add a warning dialog explaining that the JAVA_HOME env variable must be set
  - Added additional categories (docs, examples)
  - NOTE : The default installation won't work at the moment unless Catalina
config is edited to remove references to the examples webapp
  - Minimum install is 1.6M
  - Desinstallation works :)
  
  Revision  ChangesPath
  1.2   +90 -52jakarta-tomcat-4.0/tomcat.nsi
  
  Index: tomcat.nsi
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/tomcat.nsi,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- tomcat.nsi2001/07/13 23:15:28 1.1
  +++ tomcat.nsi2001/07/14 03:03:39 1.2
  @@ -1,41 +1,35 @@
   
   ; Tomcat 4 script for Nullsoft Installer
   
  -!ifdef NO_COMPRESSION
  -SetCompress off
  -SetDatablockOptimize off
  -!endif
  -
  -!ifdef NO_CRC
  -CRCCheck off
  -!endif
  -
  -Name NSIS
  +Name jakarta-tomcat-4.0
   Caption Jakarta Tomcat 4.0
   OutFile tomcat4.exe
  -
  -#BGGradient 00 80 FF
  -#InstallColors FF8080 00
  +CRCCheck on
  +SetCompress force
  +SetDatablockOptimize on
  +
  +BGGradient 00 80 FF
  +InstallColors FF8080 00
  +Icon tomcat.ico
   
   LicenseText You must read the following license before installing:
   LicenseData LICENSE
   ComponentText This will install the Jakarta Tomcat 4.0 servlet container on your 
computer:
   InstType Normal
  +InstType Minimum
   InstType Full (w/ Source Code)
   AutoCloseWindow false
   ShowInstDetails show
   DirText Please select a location to install Tomcat 4.0 (or use the default):
   SetOverwrite on
   SetDateSave on
  -!ifdef HAVE_UPX
  -  !packhdr tmp.dat upx\upx --best --compress-icons=1 tmp.dat
  -!endif
   
   InstallDir $PROGRAMFILES\Jakarta Tomcat 4.0
   InstallDirRegKey HKLM SOFTWARE\Apache\Jakarta\Tomcat 4.0 
   
   Section Tomcat 4.0 (required)
  -  SectionIn 1 2
  +
  +  SectionIn 1 2 3
 SetOutPath $INSTDIR
 File tomcat.ico
 File LICENSE
  @@ -47,58 +41,95 @@
 File /r lib
 File /r logs
 File /r server
  -  File /r webapps
 File /r work
  +  SetOutPath $INSTDIR\webapps
  +  File /r webapps\manager
  +  SetOutPath $INSTDIR\webapps\ROOT
  +  File /r webapps\ROOT\WEB-INF
  +  File webapps\ROOT\*.*
  +
   SectionEnd
   
   Section JSP Development Shell Extensions
  -  SectionIn 1 2
   
  -  ; back up old value of .nsi
  +  SectionIn 1 2 3
  +  ; back up old value of .jsp
 ReadRegStr $1 HKCR .jsp 
 StrCmp $1  Label1
   StrCmp $1 JSPFile Label1
   WriteRegStr HKCR .jsp backup_val $1
  +
   Label1:
   
 WriteRegStr HKCR .jsp  JSPFile
 WriteRegStr HKCR JSPFile  Java Server Pages source
 WriteRegStr HKCR JSPFile\shell  open
  -  WriteRegStr HKCR JSPFile\DefaultIcon  $INSTDIR\tomcat.ico
  +  WriteRegStr HKCR JSPFile\DefaultIcon  $INSTDIR\tomcat.ico
 WriteRegStr HKCR JSPFile\shell\open\command  'notepad.exe %1'
  -  WriteRegStr HKCR JSPFile\shell\compile  Compile JSP
  -  WriteRegStr HKCR JSPFile\shell\compile\command  '$INSTDIR\bin\jspc.bat %1'
  +
   SectionEnd
   
   Section Tomcat 4.0 Start Menu Group
  -  SectionIn 1 2
  +
  +  SectionIn 1 2 3
  +
 SetOutPath $SMPROGRAMS\Tomcat 4.0
  +
 CreateShortCut $SMPROGRAMS\Tomcat 4.0\Tomcat Home Page.lnk \
http://jakarta.apache.org/tomcat;
  +
 CreateShortCut $SMPROGRAMS\Tomcat 4.0\Uninstall Tomcat 4.0.lnk \
$INSTDIR\uninst-tomcat4.exe
  +
 CreateShortCut $SMPROGRAMS\Tomcat 4.0\Tomcat 4.0 Documentation.lnk \
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html;
  +
 CreateShortCut $SMPROGRAMS\Tomcat 4.0\Tomcat 4.0 Program Directory.lnk \
$INSTDIR
  +
 CreateShortCut $SMPROGRAMS\Tomcat 4.0\Start Tomcat.lnk \
  - $INSTDIR\bin\startup.bat
  + %JAVA_HOME%\bin\java \
  + '-cp $INSTDIR\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar 
-Dcatalina.home=$INSTDIR org.apache.catalina.startup.Bootstrap start' \
  + $INSTDIR\tomcat.ico 0 SW_SHOWNORMAL
  +
 CreateShortCut $SMPROGRAMS\Tomcat 4.0\Stop Tomcat.lnk \
  - $INSTDIR\bin\shutdown.bat
  + %JAVA_HOME%\bin\java \
  + '-cp $INSTDIR\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar 
-Dcatalina.home=$INSTDIR org.apache.catalina.startup.Bootstrap stop' \
  + $INSTDIR\tomcat.ico 0 SW_SHOWMINIMIZED
  +
  +SectionEnd
  +
  +SectionDivider
  +
  +Section Tomcat 4.0 Documentation
  +
  +  SectionIn 1 3
  +  SetOutPath $INSTDIR\webapps
  +  File /r webapps\ROOT
  +
  +SectionEnd
  +
  +Section Example Web Applications
  +
  +  SectionIn 1 3

cvs commit: jakarta-tomcat-4.0 tomcat.nsi

2001-07-14 Thread remm

remm01/07/13 23:47:12

  Modified:.tomcat.nsi
  Log:
  - Add some links for documentation only if doncumentation is installed.
  - Fix minor issues with desinstallation.
  
  Revision  ChangesPath
  1.3   +25 -9 jakarta-tomcat-4.0/tomcat.nsi
  
  Index: tomcat.nsi
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/tomcat.nsi,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- tomcat.nsi2001/07/14 03:03:39 1.2
  +++ tomcat.nsi2001/07/14 06:47:12 1.3
  @@ -81,9 +81,6 @@
 CreateShortCut $SMPROGRAMS\Tomcat 4.0\Uninstall Tomcat 4.0.lnk \
$INSTDIR\uninst-tomcat4.exe
   
  -  CreateShortCut $SMPROGRAMS\Tomcat 4.0\Tomcat 4.0 Documentation.lnk \
  - http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html;
  -
 CreateShortCut $SMPROGRAMS\Tomcat 4.0\Tomcat 4.0 Program Directory.lnk \
$INSTDIR
   
  @@ -107,6 +104,24 @@
 SetOutPath $INSTDIR\webapps
 File /r webapps\ROOT
   
  +  IfFileExists $SMPROGRAMS\Tomcat 4.0 0 NoLinks
  +
  +  SetOutPath $SMPROGRAMS\Tomcat 4.0\Documentation
  +
  +  CreateShortCut $SMPROGRAMS\Tomcat 4.0\Documentation\Tomcat Documentation.lnk \
  + $INSTDIR\webapps\ROOT\docs\index.html
  +
  +  CreateShortCut $SMPROGRAMS\Tomcat 4.0\Documentation\Catalina Javadoc.lnk \
  + $INSTDIR\webapps\ROOT\catalina-javadoc\index.html
  +
  +  CreateShortCut $SMPROGRAMS\Tomcat 4.0\Documentation\Jasper Javadoc.lnk \
  + $INSTDIR\webapps\ROOT\jasper-javadoc\index.html
  +
  +  CreateShortCut $SMPROGRAMS\Tomcat 4.0\Documentation\Servlet API Javadoc.lnk \
  + $INSTDIR\webapps\ROOT\servletapi-javadoc\index.html
  +
  + NoLinks:
  +
   SectionEnd
   
   Section Example Web Applications
  @@ -166,6 +181,8 @@
   
   Section Uninstall
   
  +  Delete $INSTDIR\uninst-tomcat4.exe
  +
 ReadRegStr $1 HKCR .jsp 
 StrCmp $1 JSPFile 0 NoOwn ; only do this if we own it
   ReadRegStr $1 HKCR .jsp backup_val
  @@ -180,8 +197,7 @@
 DeleteRegKey HKCR JSPFile
 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomcat 4.0
 DeleteRegKey HKLM SOFTWARE\Apache\Jakarta\Tomcat 4.0
  -  Delete $SMPROGRAMS\Tomcat 4.0\*.lnk
  -  RMDir $SMPROGRAMS\Tomcat 4.0
  +  RMDir /r $SMPROGRAMS\Tomcat 4.0
 Delete $INSTDIR\tomcat.ico
 Delete $INSTDIR\LICENSE
 Delete $INSTDIR\README.txt
  @@ -202,13 +218,13 @@
 RMDir $INSTDIR
   
 ; if $INSTDIR was removed, skip these next ones
  -  IfFileExists $INSTDIR 0 Removed 
  +  IfFileExists $INSTDIR 0 Removed 
   MessageBox MB_YESNO|MB_ICONQUESTION \
 Remove all files in your Tomcat 4.0 directory? (If you have anything\
you created that you want to keep, click No) IDNO Removed
  -Delete $INSTDIR\*.* ; this would be skipped if the user hits no
  -RMDir /r $INSTDIR
  -IfFileExists $INSTDIR 0 Removed 
  +Delete $INSTDIR\*.* ; this would be skipped if the user hits no
  +RMDir /r $INSTDIR
  +IfFileExists $INSTDIR 0 Removed 
 MessageBox MB_OK|MB_ICONEXCLAMATION \
Note: $INSTDIR could not be removed.
 Removed:
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader LocalStrings.properties WebappClassLoader.java WebappLoader.java

2001-07-14 Thread remm

remm01/07/13 23:51:40

  Modified:catalina/src/share/org/apache/catalina/loader
LocalStrings.properties WebappClassLoader.java
WebappLoader.java
  Log:
  - Fix a race condition in the modified method, as reported by Jon Stevens.
One of the arrays could be could be bigger than the other by one elemnt.
  - If there is an exception in modified, it is now logged and caught, instead of
killing the thread which tracks modifications.
  
  Revision  ChangesPath
  1.3   +1 -0  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/LocalStrings.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LocalStrings.properties   2001/06/21 01:39:07 1.2
  +++ LocalStrings.properties   2001/07/14 06:51:39 1.3
  @@ -27,3 +27,4 @@
   webappLoader.removeRepository=Removing repository {0}
   webappLoader.starting=Starting this Loader
   webappLoader.stopping=Stopping this Loader
  +webappLoader.failModifiedCheck=Error tracking modifications
  
  
  
  1.9   +22 -12
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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WebappClassLoader.java2001/07/12 21:22:25 1.8
  +++ WebappClassLoader.java2001/07/14 06:51:39 1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
 1.8 2001/07/12 21:22:25 remm Exp $
  - * $Revision: 1.8 $
  - * $Date: 2001/07/12 21:22:25 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
 1.9 2001/07/14 06:51:39 remm Exp $
  + * $Revision: 1.9 $
  + * $Date: 2001/07/14 06:51:39 $
*
* 
*
  @@ -123,7 +123,7 @@
*
* @author Remy Maucherat
* @author Craig R. McClanahan
  - * @version $Revision: 1.8 $ $Date: 2001/07/12 21:22:25 $
  + * @version $Revision: 1.9 $ $Date: 2001/07/14 06:51:39 $
*/
   public class WebappClassLoader
   extends URLClassLoader
  @@ -687,13 +687,23 @@
   // Checking for modified loaded resources
   int length = paths.length;
   
  +// A rare race condition can occur in the updates of the two arrays
  +// It's totally ok if the latest class added is not checked (it will
  +// be checked the next time
  +int length2 = lastModifiedDates.length;
  +if (length  length2)
  +length = length2;
  +
   for (int i = 0; i  length; i++) {
   try {
   long lastModified = 
   ((ResourceAttributes) resources.getAttributes(paths[i]))
   .getLastModified().getTime();
   if (lastModified != lastModifiedDates[i]) {
  -log(  Resource ' + paths[i] + ' was modified);
  +log(  Resource ' + paths[i] 
  ++ ' was modified; Date is now:  
  ++ new java.util.Date(lastModified) +  Was: 
  ++ new java.util.Date(lastModifiedDates[i]));
   return (true);
   }
   } catch (NamingException e) {
  @@ -1535,19 +1545,19 @@
   
   int j;
   
  -String[] result = new String[paths.length + 1];
  -for (j = 0; j  paths.length; j++) {
  -result[j] = paths[j];
  -}
  -result[paths.length] = fullPath;
  -paths = result;
  -
   long[] result2 = new long[lastModifiedDates.length + 1];
   for (j = 0; j  lastModifiedDates.length; j++) {
   result2[j] = lastModifiedDates[j];
   }
   result2[lastModifiedDates.length] = entry.lastModified;
   lastModifiedDates = result2;
  +
  +String[] result = new String[paths.length + 1];
  +for (j = 0; j  paths.length; j++) {
  +result[j] = paths[j];
  +}
  +result[paths.length] = fullPath;
  +paths = result;
   
   }
   
  
  
  
  1.11  +12 -7 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader

cvs commit: jakarta-tomcat-4.0/resources - New directory

2001-07-14 Thread remm

remm01/07/14 20:23:55

  jakarta-tomcat-4.0/resources - New directory



cvs commit: jakarta-tomcat-4.0 tomcat.nsi

2001-07-15 Thread remm

remm01/07/15 00:43:27

  Modified:.tomcat.nsi
  Log:
  - Never overwrite the configuration files when installing. That will allow fast
installation of a new build by running the installer and selecting a minimum
installation (upgrading a build with Windows was really annoying to do
by hand before).
  - Add links to edit the configuration files (with the notepad at the moment).
  - Don't delete the configuration files by default when uninstalling.
  - Add new alternate server configuration used with the minimum installation.
  
  Revision  ChangesPath
  1.4   +45 -24jakarta-tomcat-4.0/tomcat.nsi
  
  Index: tomcat.nsi
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/tomcat.nsi,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- tomcat.nsi2001/07/14 06:47:12 1.3
  +++ tomcat.nsi2001/07/15 07:43:27 1.4
  @@ -25,7 +25,7 @@
   SetDateSave on
   
   InstallDir $PROGRAMFILES\Jakarta Tomcat 4.0
  -InstallDirRegKey HKLM SOFTWARE\Apache\Jakarta\Tomcat 4.0 
  +InstallDirRegKey HKLM SOFTWARE\Apache\Jakarta Tomcat 4.0 
   
   Section Tomcat 4.0 (required)
   
  @@ -36,7 +36,6 @@
 File README.txt
 File /r bin
 File /r common
  -  File /r conf
 File /r jasper
 File /r lib
 File /r logs
  @@ -73,27 +72,38 @@
   
 SectionIn 1 2 3
   
  -  SetOutPath $SMPROGRAMS\Tomcat 4.0
  +  SetOutPath $SMPROGRAMS\Jakarta Tomcat 4.0
   
  -  CreateShortCut $SMPROGRAMS\Tomcat 4.0\Tomcat Home Page.lnk \
  +  CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Tomcat Home Page.lnk \
http://jakarta.apache.org/tomcat;
   
  -  CreateShortCut $SMPROGRAMS\Tomcat 4.0\Uninstall Tomcat 4.0.lnk \
  +  CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Uninstall Tomcat 4.0.lnk \
$INSTDIR\uninst-tomcat4.exe
   
  -  CreateShortCut $SMPROGRAMS\Tomcat 4.0\Tomcat 4.0 Program Directory.lnk \
  +  CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Tomcat 4.0 Program Directory.lnk \
$INSTDIR
   
  -  CreateShortCut $SMPROGRAMS\Tomcat 4.0\Start Tomcat.lnk \
  - %JAVA_HOME%\bin\java \
  +  CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Start Tomcat.lnk \
  + %JAVA_HOME%\bin\java.exe \
'-cp $INSTDIR\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar 
-Dcatalina.home=$INSTDIR org.apache.catalina.startup.Bootstrap start' \
$INSTDIR\tomcat.ico 0 SW_SHOWNORMAL
   
  -  CreateShortCut $SMPROGRAMS\Tomcat 4.0\Stop Tomcat.lnk \
  - %JAVA_HOME%\bin\java \
  +  CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Stop Tomcat.lnk \
  + %JAVA_HOME%\bin\java.exe \
'-cp $INSTDIR\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar 
-Dcatalina.home=$INSTDIR org.apache.catalina.startup.Bootstrap stop' \
$INSTDIR\tomcat.ico 0 SW_SHOWMINIMIZED
   
  +  SetOutPath $SMPROGRAMS\Jakarta Tomcat 4.0\Configuration
  +
  +  CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Configuration\Edit Server 
Configuration.lnk \
  + notepad $INSTDIR\conf\server.xml
  +
  +  CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Configuration\Edit Webapp 
Defaults.lnk \
  + notepad $INSTDIR\conf\web.xml
  +
  +  CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Configuration\Edit Users.lnk \
  + notepad $INSTDIR\conf\tomcat-users.xml
  +
   SectionEnd
   
   SectionDivider
  @@ -104,20 +114,20 @@
 SetOutPath $INSTDIR\webapps
 File /r webapps\ROOT
   
  -  IfFileExists $SMPROGRAMS\Tomcat 4.0 0 NoLinks
  +  IfFileExists $SMPROGRAMS\Jakarta Tomcat 4.0 0 NoLinks
   
  -  SetOutPath $SMPROGRAMS\Tomcat 4.0\Documentation
  +  SetOutPath $SMPROGRAMS\Jakarta Tomcat 4.0\Documentation
   
  -  CreateShortCut $SMPROGRAMS\Tomcat 4.0\Documentation\Tomcat Documentation.lnk \
  +  CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Documentation\Tomcat 
Documentation.lnk \
$INSTDIR\webapps\ROOT\docs\index.html
   
  -  CreateShortCut $SMPROGRAMS\Tomcat 4.0\Documentation\Catalina Javadoc.lnk \
  +  CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Documentation\Catalina 
Javadoc.lnk \
$INSTDIR\webapps\ROOT\catalina-javadoc\index.html
   
  -  CreateShortCut $SMPROGRAMS\Tomcat 4.0\Documentation\Jasper Javadoc.lnk \
  +  CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Documentation\Jasper Javadoc.lnk \
$INSTDIR\webapps\ROOT\jasper-javadoc\index.html
   
  -  CreateShortCut $SMPROGRAMS\Tomcat 4.0\Documentation\Servlet API Javadoc.lnk \
  +  CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Documentation\Servlet API 
Javadoc.lnk \
$INSTDIR\webapps\ROOT\servletapi-javadoc\index.html
   
NoLinks:
  @@ -127,6 +137,11 @@
   Section Example Web Applications
   
 SectionIn 1 3
  +
  +  SetOverwrite off
  +  SetOutPath $INSTDIR\conf
  +  File conf\server.xml

cvs commit: jakarta-tomcat-4.0 build.xml

2001-07-15 Thread remm

remm01/07/15 00:49:09

  Modified:.build.xml
  Log:
  - A few resources were moved around.
  
  Revision  ChangesPath
  1.25  +1 -1  jakarta-tomcat-4.0/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/build.xml,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- build.xml 2001/07/13 23:15:28 1.24
  +++ build.xml 2001/07/15 07:49:08 1.25
  @@ -166,7 +166,7 @@
 target name=installer depends=dist
   echo message=Builds a Windows installer based on Nullsoft Installer/
   echo message=The target requires Nullsoft Installer to be in your PATH/
  -copy file=tomcat.ico tofile=${tomcat.dist}/tomcat.ico/
  +copy file=resources/tomcat.ico tofile=${tomcat.dist}/tomcat.ico/
   copy file=tomcat.nsi tofile=${tomcat.dist}/tomcat.nsi/
   copy file=README.txt tofile=${tomcat.dist}/README.txt/
   exec dir=${tomcat.dist} executable=makensis.exe
  
  
  



cvs commit: jakarta-tomcat-4.0 tomcat.ico

2001-07-15 Thread remm

remm01/07/15 00:49:17

  Removed: .tomcat.ico
  Log:
  - A few resources were moved around.



cvs commit: jakarta-tomcat-4.0/catalina/src/conf server-noexamples.xml.config

2001-07-15 Thread remm

remm01/07/15 00:51:26

  Added:   catalina/src/conf server-noexamples.xml.config
  Log:
  - Add new configuration used for the examples-less installation.
  
  Revision  ChangesPath
  1.1  
jakarta-tomcat-4.0/catalina/src/conf/server-noexamples.xml.config
  
  Index: server-noexamples.xml.config
  ===
  !-- Alternate Example-less Configuration File --
  !-- Note that component elements are nested corresponding to their
   parent-child relationships with each other --
  
  !-- A Server is a singleton element that represents the entire JVM,
   which may contain one or more Service instances.  The Server
   listens for a shutdown command on the indicated port.
  
   Note:  A Server is not itself a Container, so you may not
   define subcomponents such as Valves or Loggers at this level.
   --
  
  Server port=8005 shutdown=SHUTDOWN debug=0
  
  
!-- A Service is a collection of one or more Connectors that share
 a single Container (and therefore the web applications visible
 within that Container).  Normally, that Container is an Engine,
 but this is not required.
  
 Note:  A Service is not itself a Container, so you may not
 define subcomponents such as Valves or Loggers at this level.
 --
  
!-- Define the Tomcat Stand-Alone Service --
Service name=Tomcat-Standalone
  
  !-- A Connector represents an endpoint by which requests are received
   and responses are returned.  Each Connector passes requests on to the
   associated Container (normally an Engine) for processing.
  
   By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
   You can also enable an SSL HTTP/1.1 Connector on port 8443 by
   following the instructions below and uncommenting the second Connector
   entry.  SSL support requires the following steps:
   * Download and install JSSE 1.0.2 or later, and put the JAR files
 into $JAVA_HOME/jre/lib/ext.
   * Edit $JAVA_HOME/jre/lib/security/java.security and add
   security.provider.2=com.sun.net.ssl.internal.ssl.Provider
   * Execute: keytool -genkey -alias tomcat -keyalg RSA
 with a password value of changeit.
  
   By default, DNS lookups are enabled when a web application calls
   request.getRemoteHost().  This can have an adverse impact on
   performance, so you can disable it by setting the
   enableLookups attribute to false.  When DNS lookups are disabled,
   request.getRemoteHost() will return the String version of the
   IP address of the remote client.
  --
  
  !-- Define a non-SSL HTTP/1.1 Connector on port 8080 --
  Connector className=org.apache.catalina.connector.http.HttpConnector
 port=8080 minProcessors=5 maxProcessors=75
 enableLookups=true redirectPort=8443
 acceptCount=10 debug=0 connectionTimeout=6/
  !-- Note : To disable connection timeouts, set connectionTimeout value 
   to -1 --
  
  !-- Define an SSL HTTP/1.1 Connector on port 8443 --
  !--
  Connector className=org.apache.catalina.connector.http.HttpConnector
 port=8443 minProcessors=5 maxProcessors=75
 enableLookups=true
   acceptCount=10 debug=0 scheme=https secure=true
Factory className=org.apache.catalina.net.SSLServerSocketFactory
 clientAuth=false protocol=TLS/
  /Connector
  --
  
  !-- Define a Proxied HTTP/1.1 Connector on port 8081 --
  !-- See proxy documentation for more information about using this. --
  !--
  Connector className=org.apache.catalina.connector.http.HttpConnector
 port=8081 minProcessors=5 maxProcessors=75
 enableLookups=true
 acceptCount=10 debug=0 connectionTimeout=6
 proxyPort=80/
  --
  
  !-- Define a non-SSL HTTP/1.0 Test Connector on port 8082 --
  !--
  Connector className=org.apache.catalina.connector.http10.HttpConnector
 port=8082 minProcessors=5 maxProcessors=75
 enableLookups=true redirectPort=8443
 acceptCount=10 debug=0/
  --
  
  !-- 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). --
  
  !-- Define the top level container in our container hierarchy --
  Engine name=Standalone defaultHost=localhost debug=0
  
!-- The request dumper valve dumps useful debugging information about
 the request headers and cookies that were received, and the response

cvs commit: jakarta-tomcat-4.0/resources tomcat.ico

2001-07-15 Thread remm

remm01/07/15 00:51:50

  Added:   resources tomcat.ico
  Log:
  - A few resources were moved around.
  
  Revision  ChangesPath
  1.1  jakarta-tomcat-4.0/resources/tomcat.ico
  
Binary file
  
  



cvs commit: jakarta-tomcat-4.0/resources INSTALLLICENSE main.ico tickno.bmp tickyes.bmp uninst.ico

2001-07-15 Thread remm

remm01/07/15 12:17:32

  Added:   resources INSTALLLICENSE main.ico tickno.bmp tickyes.bmp
uninst.ico
  Log:
  - Add additional icons and resources.
  
  Revision  ChangesPath
  1.1  jakarta-tomcat-4.0/resources/INSTALLLICENSE
  
  Index: INSTALLLICENSE
  ===
  ==
   
 The Apache Software License,  Version 1.1
   
Copyright (c) 1999, 2000, 2001  The Apache Software Foundation.
All rights reserved.   
   
  ==
   
  Redistribution and use in source and binary forms,  with or without modi-
  fication, are permitted provided that the following conditions are met:  
   
  1. Redistributions of source code  must retain the above copyright notice
 notice, this list of conditions and the following disclaimer. 
   
  2. Redistributions  in binary  form  must  reproduce the  above copyright
 notice,  this list of conditions  and the following  disclaimer in the
 documentation and/or other materials provided with the distribution.  
   
  3. The end-user documentation  included with the redistribution,  if any,
 must include the following acknowlegement:
   
This product includes  software developed  by the Apache  Software
 Foundation http://www.apache.org/. 
   
 Alternately, this acknowlegement may appear in the software itself, if
 and wherever such third-party acknowlegements normally appear.
   
  4. The names  The  Jakarta  Project,  Tomcat,  and  Apache  Software
 Foundation  must not be used  to endorse or promote  products derived
 from this  software without  prior  written  permission.  For  written
 permission, please contact [EMAIL PROTECTED].   
   
  5. Products derived from this software may not be called Apache nor may
 Apache appear in their names without prior written permission of the
 Apache Software Foundation.   
   
  THIS SOFTWARE IS PROVIDED AS IS AND ANY EXPRESSED 
  OR IMPLIED WARRANTIES INCLUDING, BUT NOT LIMITED TO,  
  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
  FOR  A PARTICULAR PURPOSE  ARE DISCLAIMED.  IN NO EVENT 
  SHALL THE APACHE  SOFTWARE  FOUNDATION OR  ITS 
  CONTRIBUTORS  BE LIABLE  FOR ANY DIRECT,  INDIRECT,   
  INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR  CONSEQUENTIAL
  DAMAGES (INCLUDING,  BUT NOT LIMITED TO,  PROCUREMENT 
  OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE,  DATA,  
  OR PROFITS;  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND  
  ON ANY  THEORY  OF  LIABILITY,  WHETHER IN  CONTRACT,
  STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR 
  OTHERWISE) ARISING IN ANY  WAY  OUT OF  THE  USE OF  THIS  
  SOFTWARE,  EVEN  IF  ADVISED  OF THE POSSIBILITY 
  OF SUCH DAMAGE.  
   
  ==
   
  This software  consists of voluntary  contributions made  by many indivi-
  duals on behalf of the  Apache Software Foundation.  For more information
  on the Apache Software Foundation, please see http://www.apache.org/.  
   
  ==
  
  
  
  1.1  jakarta-tomcat-4.0/resources/main.ico
  
Binary file
  
  
  1.1  jakarta-tomcat-4.0/resources/tickno.bmp
  
Binary file
  
  
  1.1  jakarta-tomcat-4.0/resources/tickyes.bmp
  
Binary file
  
  
  1.1  jakarta-tomcat-4.0/resources/uninst.ico
  
Binary file
  
  



cvs commit: jakarta-tomcat-4.0 build.xml tomcat.nsi

2001-07-15 Thread remm

remm01/07/15 12:39:07

  Modified:.build.xml tomcat.nsi
  Log:
  - Use the new resources.
  - Warn about JAVA_HOME before starting the installation.
  
  Revision  ChangesPath
  1.26  +6 -4  jakarta-tomcat-4.0/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/build.xml,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- build.xml 2001/07/15 07:49:08 1.25
  +++ build.xml 2001/07/15 19:39:06 1.26
  @@ -166,11 +166,13 @@
 target name=installer depends=dist
   echo message=Builds a Windows installer based on Nullsoft Installer/
   echo message=The target requires Nullsoft Installer to be in your PATH/
  -copy file=resources/tomcat.ico tofile=${tomcat.dist}/tomcat.ico/
  -copy file=tomcat.nsi tofile=${tomcat.dist}/tomcat.nsi/
  -copy file=README.txt tofile=${tomcat.dist}/README.txt/
  +copy todir=${tomcat.dist}
  +  fileset dir=resources /
  +/copy
  +copy file=tomcat.nsi tofile=${tomcat.dist}/tomcat.nsi /
  +copy file=README.txt tofile=${tomcat.dist}/README.txt /
   exec dir=${tomcat.dist} executable=makensis.exe
  -  arg value=tomcat.nsi/
  +  arg value=tomcat.nsi /
   /exec
 /target
   
  
  
  
  1.5   +17 -5 jakarta-tomcat-4.0/tomcat.nsi
  
  Index: tomcat.nsi
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/tomcat.nsi,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- tomcat.nsi2001/07/15 07:43:27 1.4
  +++ tomcat.nsi2001/07/15 19:39:06 1.5
  @@ -1,5 +1,6 @@
   
   ; Tomcat 4 script for Nullsoft Installer
  +; $Id: tomcat.nsi,v 1.5 2001/07/15 19:39:06 remm Exp $
   
   Name jakarta-tomcat-4.0
   Caption Jakarta Tomcat 4.0
  @@ -10,10 +11,14 @@
   
   BGGradient 00 80 FF
   InstallColors FF8080 00
  -Icon tomcat.ico
   
  +Icon main.ico
  +UninstallIcon uninst.ico 
  +EnabledBitmap tickyes.bmp 
  +DisabledBitmap tickno.bmp
  +
   LicenseText You must read the following license before installing:
  -LicenseData LICENSE
  +LicenseData INSTALLLICENSE
   ComponentText This will install the Jakarta Tomcat 4.0 servlet container on your 
computer:
   InstType Normal
   InstType Minimum
  @@ -183,11 +188,18 @@
   
   SectionEnd
   
  +Function .onInit
  +
  +MessageBox MB_YESNO|MB_ICONEXCLAMATION If not done already, you need to set 
the JAVA_HOME \
  +environment variable and have it point to your JDK installation directory. \
  +Answer No to quit the installer if your environment is not properly set. IDYES 
NoAbort
  +  Abort ; causes installer to quit.
  +  NoAbort:
  +
  +FunctionEnd
  +
   Function .onInstSuccess
   
  -MessageBox MB_OK|MB_ICONEXCLAMATION \
  -  If not done already, you need to set the JAVA_HOME environment\
  - variable and have it point to your JDK installation directory.
 MessageBox MB_YESNO|MB_ICONQUESTION \
Setup has completed. View readme file now? \
IDNO NoReadme
  
  
  



cvs commit: jakarta-tomcat-4.0 tomcat.nsi

2001-07-15 Thread remm

remm01/07/15 19:47:02

  Modified:.tomcat.nsi
  Log:
  - Find the path to JavaHome in the registry instead of using an environment
variable.
  - Will complain if no JDK is found.
  
  Revision  ChangesPath
  1.6   +19 -9 jakarta-tomcat-4.0/tomcat.nsi
  
  Index: tomcat.nsi
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/tomcat.nsi,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- tomcat.nsi2001/07/15 19:39:06 1.5
  +++ tomcat.nsi2001/07/16 02:47:02 1.6
  @@ -1,6 +1,6 @@
   
   ; Tomcat 4 script for Nullsoft Installer
  -; $Id: tomcat.nsi,v 1.5 2001/07/15 19:39:06 remm Exp $
  +; $Id: tomcat.nsi,v 1.6 2001/07/16 02:47:02 remm Exp $
   
   Name jakarta-tomcat-4.0
   Caption Jakarta Tomcat 4.0
  @@ -77,6 +77,9 @@
   
 SectionIn 1 2 3
   
  +  ReadRegStr $1 HKLM SOFTWARE\JavaSoft\Java Development Kit CurrentVersion
  +  ReadRegStr $2 HKLM SOFTWARE\JavaSoft\Java Development Kit\$1 JavaHome
  +
 SetOutPath $SMPROGRAMS\Jakarta Tomcat 4.0
   
 CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Tomcat Home Page.lnk \
  @@ -89,13 +92,13 @@
$INSTDIR
   
 CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Start Tomcat.lnk \
  - %JAVA_HOME%\bin\java.exe \
  - '-cp $INSTDIR\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar 
-Dcatalina.home=$INSTDIR org.apache.catalina.startup.Bootstrap start' \
  + $2\bin\java.exe \
  + '-cp $INSTDIR\bin\bootstrap.jar;$2\lib\tools.jar 
-Dcatalina.home=$INSTDIR org.apache.catalina.startup.Bootstrap start' \
$INSTDIR\tomcat.ico 0 SW_SHOWNORMAL
   
 CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Stop Tomcat.lnk \
  - %JAVA_HOME%\bin\java.exe \
  - '-cp $INSTDIR\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar 
-Dcatalina.home=$INSTDIR org.apache.catalina.startup.Bootstrap stop' \
  + $2\bin\java.exe \
  + '-cp $INSTDIR\bin\bootstrap.jar;$2\lib\tools.jar 
-Dcatalina.home=$INSTDIR org.apache.catalina.startup.Bootstrap stop' \
$INSTDIR\tomcat.ico 0 SW_SHOWMINIMIZED
   
 SetOutPath $SMPROGRAMS\Jakarta Tomcat 4.0\Configuration
  @@ -189,12 +192,19 @@
   SectionEnd
   
   Function .onInit
  +
  +  ClearErrors
  +
  +  ReadRegStr $1 HKLM SOFTWARE\JavaSoft\Java Development Kit CurrentVersion
  +  ReadRegStr $2 HKLM SOFTWARE\JavaSoft\Java Development Kit\$1 JavaHome
  +
  +  IfErrors 0 NoAbort
  +MessageBox MB_OK Couldn't find a Java Development Kit installed on this \
  +computer. Please download one from http://java.sun.com.;
  +Abort
   
  -MessageBox MB_YESNO|MB_ICONEXCLAMATION If not done already, you need to set 
the JAVA_HOME \
  -environment variable and have it point to your JDK installation directory. \
  -Answer No to quit the installer if your environment is not properly set. IDYES 
NoAbort
  -  Abort ; causes installer to quit.
 NoAbort:
  +MessageBox MB_OK Using Java Development Kit version $1 found in $2
   
   FunctionEnd
   
  
  
  



cvs commit: jakarta-tomcat-4.0 build.xml tomcat.nsi

2001-07-16 Thread remm

remm01/07/15 23:56:35

  Modified:.build.xml tomcat.nsi
  Log:
  - More tweaks.
  - Don't display the README.txt (which contains irrelevant information).
  
  Revision  ChangesPath
  1.27  +0 -1  jakarta-tomcat-4.0/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/build.xml,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- build.xml 2001/07/15 19:39:06 1.26
  +++ build.xml 2001/07/16 06:56:35 1.27
  @@ -170,7 +170,6 @@
 fileset dir=resources /
   /copy
   copy file=tomcat.nsi tofile=${tomcat.dist}/tomcat.nsi /
  -copy file=README.txt tofile=${tomcat.dist}/README.txt /
   exec dir=${tomcat.dist} executable=makensis.exe
 arg value=tomcat.nsi /
   /exec
  
  
  
  1.7   +4 -10 jakarta-tomcat-4.0/tomcat.nsi
  
  Index: tomcat.nsi
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/tomcat.nsi,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- tomcat.nsi2001/07/16 02:47:02 1.6
  +++ tomcat.nsi2001/07/16 06:56:35 1.7
  @@ -1,6 +1,6 @@
   
   ; Tomcat 4 script for Nullsoft Installer
  -; $Id: tomcat.nsi,v 1.6 2001/07/16 02:47:02 remm Exp $
  +; $Id: tomcat.nsi,v 1.7 2001/07/16 06:56:35 remm Exp $
   
   Name jakarta-tomcat-4.0
   Caption Jakarta Tomcat 4.0
  @@ -38,7 +38,6 @@
 SetOutPath $INSTDIR
 File tomcat.ico
 File LICENSE
  -  File README.txt
 File /r bin
 File /r common
 File /r jasper
  @@ -93,12 +92,12 @@
   
 CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Start Tomcat.lnk \
$2\bin\java.exe \
  - '-cp $INSTDIR\bin\bootstrap.jar;$2\lib\tools.jar 
-Dcatalina.home=$INSTDIR org.apache.catalina.startup.Bootstrap start' \
  + '-jar -cp $2\lib\tools.jar -Dcatalina.home=$INSTDIR 
$INSTDIR\bin\bootstrap.jar start' \
$INSTDIR\tomcat.ico 0 SW_SHOWNORMAL
   
 CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Stop Tomcat.lnk \
$2\bin\java.exe \
  - '-cp $INSTDIR\bin\bootstrap.jar;$2\lib\tools.jar 
-Dcatalina.home=$INSTDIR org.apache.catalina.startup.Bootstrap stop' \
  + '-Dcatalina.home=$INSTDIR $INSTDIR\bin\bootstrap.jar stop' \
$INSTDIR\tomcat.ico 0 SW_SHOWMINIMIZED
   
 SetOutPath $SMPROGRAMS\Jakarta Tomcat 4.0\Configuration
  @@ -210,11 +209,7 @@
   
   Function .onInstSuccess
   
  -  MessageBox MB_YESNO|MB_ICONQUESTION \
  - Setup has completed. View readme file now? \
  - IDNO NoReadme
  -ExecShell open '$INSTDIR\README.txt'
  -  NoReadme:
  +  ExecShell open '$SMPROGRAMS\Jakarta Tomcat 4.0'
   
   FunctionEnd
   
  @@ -242,7 +237,6 @@
 RMDir /r $SMPROGRAMS\Jakarta Tomcat 4.0
 Delete $INSTDIR\tomcat.ico
 Delete $INSTDIR\LICENSE
  -  Delete $INSTDIR\README.txt
 RMDir /r $INSTDIR\bin
 RMDir /r $INSTDIR\common
 Delete $INSTDIR\conf\*.dtd
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/etc - New directory

2001-07-16 Thread remm

remm01/07/15 23:56:48

  jakarta-tomcat-4.0/catalina/etc - New directory



cvs commit: jakarta-tomcat-4.0/catalina/etc bootstrap.MF

2001-07-16 Thread remm

remm01/07/15 23:57:09

  Added:   catalina/etc bootstrap.MF
  Log:
  - Add a manifest file for bootstrap.jar.
  
  Revision  ChangesPath
  1.1  jakarta-tomcat-4.0/catalina/etc/bootstrap.MF
  
  Index: bootstrap.MF
  ===
  Manifest-Version: 1.0
  Main-Class: org.apache.catalina.startup.Bootstrap
  Specification-Title: Catalina
  Specification-Version: 1.0
  
  



cvs commit: jakarta-tomcat-4.0/catalina build.xml

2001-07-16 Thread remm

remm01/07/15 23:57:18

  Modified:catalina build.xml
  Log:
  - Add a manifest file for bootstrap.jar.
  
  Revision  ChangesPath
  1.48  +1 -0  jakarta-tomcat-4.0/catalina/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/build.xml,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- build.xml 2001/07/12 08:35:06 1.47
  +++ build.xml 2001/07/16 06:57:18 1.48
  @@ -160,6 +160,7 @@
   jar   jarfile=${catalina.build}/bin/bootstrap.jar
  basedir=${catalina.build}/classes
  
includes=org/apache/catalina/startup/Bootstrap.class,org/apache/catalina/loader/StandardClassLoader*.class,org/apache/catalina/loader/Extension.class,org/apache/catalina/loader/Reloader.class,org/apache/catalina/startup/SecurityManagerDebug.class,org/apache/naming/JndiPermission.class
 
  +   manifest=etc/bootstrap.MF
  /
   jar   jarfile=${catalina.build}/common/lib/naming.jar
  basedir=${catalina.build}/classes
  
  
  



cvs commit: jakarta-tomcat-4.0 tomcat.nsi

2001-07-16 Thread remm

remm01/07/16 00:50:33

  Modified:.tomcat.nsi
  Log:
  - Forgot '-jar'.
  
  Revision  ChangesPath
  1.8   +2 -2  jakarta-tomcat-4.0/tomcat.nsi
  
  Index: tomcat.nsi
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/tomcat.nsi,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- tomcat.nsi2001/07/16 06:56:35 1.7
  +++ tomcat.nsi2001/07/16 07:50:33 1.8
  @@ -1,6 +1,6 @@
   
   ; Tomcat 4 script for Nullsoft Installer
  -; $Id: tomcat.nsi,v 1.7 2001/07/16 06:56:35 remm Exp $
  +; $Id: tomcat.nsi,v 1.8 2001/07/16 07:50:33 remm Exp $
   
   Name jakarta-tomcat-4.0
   Caption Jakarta Tomcat 4.0
  @@ -97,7 +97,7 @@
   
 CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Stop Tomcat.lnk \
$2\bin\java.exe \
  - '-Dcatalina.home=$INSTDIR $INSTDIR\bin\bootstrap.jar stop' \
  + '-jar -Dcatalina.home=$INSTDIR $INSTDIR\bin\bootstrap.jar 
stop' \
$INSTDIR\tomcat.ico 0 SW_SHOWMINIMIZED
   
 SetOutPath $SMPROGRAMS\Jakarta Tomcat 4.0\Configuration
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpProcessor.java

2001-07-16 Thread remm

remm01/07/16 14:55:17

  Modified:catalina/src/share/org/apache/catalina/connector/http
HttpProcessor.java
  Log:
  - Quick and dirty normalization of the URI. Obviously the code is not
optimized. I will write (errr, cut  paste from TC 3.3 code, actually) an
optimized version when I refactor the connector to port it to Coyote.
Unfortunately, I lost my prototype work in my HD crash this WE, so it will get
delayed a bit (I'm lucky I had committed my Coyote changes already).
  - I hope the fix is adequate (Craig ?). Since the URI gets normalized way before
going in the mapper, it should be.
  
  Revision  ChangesPath
  1.29  +80 -5 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java
  
  Index: HttpProcessor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- HttpProcessor.java2001/06/18 23:28:39 1.28
  +++ HttpProcessor.java2001/07/16 21:55:17 1.29
  @@ -1,6 +1,6 @@
  -/* * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.28 2001/06/18 23:28:39 remm Exp $
  - * $Revision: 1.28 $
  - * $Date: 2001/06/18 23:28:39 $
  +/* * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.29 2001/07/16 21:55:17 remm Exp $
  + * $Revision: 1.29 $
  + * $Date: 2001/07/16 21:55:17 $
*
* 
*
  @@ -106,7 +106,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.28 $ $Date: 2001/06/18 23:28:39 $
  + * @version $Revision: 1.29 $ $Date: 2001/07/16 21:55:17 $
*/
   
   final class HttpProcessor
  @@ -773,16 +773,91 @@
request.setRequestedSessionURL(false);
}
   
  +// Normalize URI (using String operations at the moment)
  +String normalizedUri = normalize(uri);
  +if (debug = 1)
  +log(Normalized: ' + uri + ' to ' + normalizedUri + ');
  +
  +if (normalizedUri == null) {
  + log( Invalid request URI: ' + uri + ');
  +throw new IOException(Invalid URI:  + uri + ');
  +}
  +
// Set the corresponding request properties
((HttpRequest) request).setMethod(method);
request.setProtocol(protocol);
  - ((HttpRequest) request).setRequestURI(uri);
  + ((HttpRequest) request).setRequestURI(normalizedUri);
request.setSecure(connector.getSecure());
request.setScheme(connector.getScheme());
   
if (debug = 1)
log( Request is ' + method + ' for ' + uri +
' with protocol ' + protocol + ');
  +
  +}
  +
  +
  +/**
  + * Return a context-relative path, beginning with a /, that represents
  + * the canonical version of the specified path after .. and . elements
  + * are resolved out.  If the specified path attempts to go outside the
  + * boundaries of the current context (i.e. too many .. path elements
  + * are present), return codenull/code instead.
  + *
  + * @param path Path to be normalized
  + */
  +protected String normalize(String path) {
  +
  +if (path == null)
  +return null;
  +
  +// Create a place for the normalized path
  +String normalized = path;
  +
  +if (normalized == null)
  +return (null);
  +
  +if (normalized.equals(/.))
  +return /;
  +
  + // Normalize the slashes and add leading slash if necessary
  + if (normalized.indexOf('\\') = 0)
  + normalized = normalized.replace('\\', '/');
  + if (!normalized.startsWith(/))
  + normalized = / + normalized;
  +
  + // Resolve occurrences of // in the normalized path
  + while (true) {
  + int index = normalized.indexOf(//);
  + if (index  0)
  + break;
  + normalized = normalized.substring(0, index) +
  + normalized.substring(index + 1);
  + }
  +
  + // Resolve occurrences of /./ in the normalized path
  + while (true) {
  + int index = normalized.indexOf(/./);
  + if (index  0)
  + break;
  + normalized = normalized.substring(0, index) +
  + normalized.substring(index + 2);
  + }
  +
  + // Resolve occurrences of /../ in the normalized path
  + while (true) {
  + int index = normalized.indexOf(/../);
  + if (index  0)
  + break;
  + if (index == 0)
  + return (null);  // Trying to go outside our context
  + int index2 = normalized.lastIndexOf('/', index - 1

cvs commit: jakarta-tomcat-4.0 build.xml tomcat.nsi

2001-07-16 Thread remm

remm01/07/16 16:07:46

  Modified:.build.xml tomcat.nsi
  Log:
  - Display some JRE information about the VM.
  - Don't assume that NSIS is in the path. Instead, assume it's in the default
installation directory. The nsis.home variable can be used to change the
NSIS path. Thanks to Amy Roh for testing.
  
  Revision  ChangesPath
  1.28  +4 -2  jakarta-tomcat-4.0/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/build.xml,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- build.xml 2001/07/16 06:56:35 1.27
  +++ build.xml 2001/07/16 23:07:46 1.28
  @@ -5,6 +5,8 @@
 property file=build.properties/
 property file=${user.home}/build.properties/
   
  +  property name=nsis.home   value=c:\program files\nsis/
  +
 property name=catalina.build  value=${basedir}/catalina/build/
 property name=jasper.buildvalue=${basedir}/jasper/build/
 property name=servletapi.home value=../jakarta-servletapi-4/dist/
  @@ -165,12 +167,12 @@
 !-- = DIST: Create Windows Installer === --
 target name=installer depends=dist
   echo message=Builds a Windows installer based on Nullsoft Installer/
  -echo message=The target requires Nullsoft Installer to be in your PATH/
  +echo message=NSIS must be installed in the default directory/
   copy todir=${tomcat.dist}
 fileset dir=resources /
   /copy
   copy file=tomcat.nsi tofile=${tomcat.dist}/tomcat.nsi /
  -exec dir=${tomcat.dist} executable=makensis.exe
  +exec dir=${tomcat.dist} executable=${nsis.home}\makensis.exe
 arg value=tomcat.nsi /
   /exec
 /target
  
  
  
  1.9   +4 -2  jakarta-tomcat-4.0/tomcat.nsi
  
  Index: tomcat.nsi
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/tomcat.nsi,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- tomcat.nsi2001/07/16 07:50:33 1.8
  +++ tomcat.nsi2001/07/16 23:07:46 1.9
  @@ -1,6 +1,6 @@
   
   ; Tomcat 4 script for Nullsoft Installer
  -; $Id: tomcat.nsi,v 1.8 2001/07/16 07:50:33 remm Exp $
  +; $Id: tomcat.nsi,v 1.9 2001/07/16 23:07:46 remm Exp $
   
   Name jakarta-tomcat-4.0
   Caption Jakarta Tomcat 4.0
  @@ -196,6 +196,8 @@
   
 ReadRegStr $1 HKLM SOFTWARE\JavaSoft\Java Development Kit CurrentVersion
 ReadRegStr $2 HKLM SOFTWARE\JavaSoft\Java Development Kit\$1 JavaHome
  +  ReadRegStr $3 HKLM SOFTWARE\JavaSoft\Java Runtime Environment CurrentVersion
  +  ReadRegStr $4 HKLM SOFTWARE\JavaSoft\Java Runtime Environment\$3 RuntimeLib
   
 IfErrors 0 NoAbort
   MessageBox MB_OK Couldn't find a Java Development Kit installed on this \
  @@ -203,7 +205,7 @@
   Abort
   
 NoAbort:
  -MessageBox MB_OK Using Java Development Kit version $1 found in $2
  +MessageBox MB_OK Using Java Development Kit version $1 found in $2$\r$\nUsing 
Java Runtime Environment version $3 found in $4
   
   FunctionEnd
   
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpRequestImpl.java

2001-07-16 Thread remm

remm01/07/16 18:00:34

  Modified:catalina/src/share/org/apache/catalina/connector/http
HttpRequestImpl.java
  Log:
  - Check for protocol to be null.
  
  Revision  ChangesPath
  1.10  +5 -5  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestImpl.java
  
  Index: HttpRequestImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestImpl.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- HttpRequestImpl.java  2001/05/08 05:58:44 1.9
  +++ HttpRequestImpl.java  2001/07/17 01:00:34 1.10
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestImpl.java,v
 1.9 2001/05/08 05:58:44 craigmcc Exp $
  - * $Revision: 1.9 $
  - * $Date: 2001/05/08 05:58:44 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestImpl.java,v
 1.10 2001/07/17 01:00:34 remm Exp $
  + * $Revision: 1.10 $
  + * $Date: 2001/07/17 01:00:34 $
*
* 
*
  @@ -81,7 +81,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.9 $ $Date: 2001/05/08 05:58:44 $
  + * @version $Revision: 1.10 $ $Date: 2001/07/17 01:00:34 $
*/
   
   final class HttpRequestImpl
  @@ -311,7 +311,7 @@
   // If neither a reader or an is have been opened, do it to consume
   // request bytes, if any
   if ((reader == null)  (stream == null)  (getContentLength() != 0)
  - (getProtocol().equals(HTTP/1.1)))
  + (getProtocol() != null)  (getProtocol().equals(HTTP/1.1)))
   getInputStream();
   
   super.finishRequest();
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpProcessor.java

2001-07-16 Thread remm

remm01/07/16 18:04:29

  Modified:catalina/src/share/org/apache/catalina/connector/http
HttpProcessor.java
  Log:
  - %25, %2F, %2E and %5C are now forbidden in the request URI. I hope this
is not a problem with multi-byte characters.
  - Medium risk fix : always finish the response. That could lead to connection
management problems. That has to be changed since otherwise no HTTP error
report would be generated when something bad happened when parsing
the request.
  
  Revision  ChangesPath
  1.30  +31 -16
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java
  
  Index: HttpProcessor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- HttpProcessor.java2001/07/16 21:55:17 1.29
  +++ HttpProcessor.java2001/07/17 01:04:29 1.30
  @@ -1,6 +1,6 @@
  -/* * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.29 2001/07/16 21:55:17 remm Exp $
  - * $Revision: 1.29 $
  - * $Date: 2001/07/16 21:55:17 $
  +/* * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.30 2001/07/17 01:04:29 remm Exp $
  + * $Revision: 1.30 $
  + * $Date: 2001/07/17 01:04:29 $
*
* 
*
  @@ -106,7 +106,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.29 $ $Date: 2001/07/16 21:55:17 $
  + * @version $Revision: 1.30 $ $Date: 2001/07/17 01:04:29 $
*/
   
   final class HttpProcessor
  @@ -778,18 +778,22 @@
   if (debug = 1)
   log(Normalized: ' + uri + ' to ' + normalizedUri + ');
   
  -if (normalizedUri == null) {
  - log( Invalid request URI: ' + uri + ');
  -throw new IOException(Invalid URI:  + uri + ');
  -}
  -
// Set the corresponding request properties
((HttpRequest) request).setMethod(method);
request.setProtocol(protocol);
  - ((HttpRequest) request).setRequestURI(normalizedUri);
  +if (normalizedUri != null) {
  +((HttpRequest) request).setRequestURI(normalizedUri);
  +} else {
  +((HttpRequest) request).setRequestURI(uri);
  +}
request.setSecure(connector.getSecure());
request.setScheme(connector.getScheme());
   
  +if (normalizedUri == null) {
  + log( Invalid request URI: ' + uri + ');
  +throw new ServletException(Invalid URI:  + uri + ');
  +}
  +
if (debug = 1)
log( Request is ' + method + ' for ' + uri +
' with protocol ' + protocol + ');
  @@ -814,8 +818,13 @@
   // Create a place for the normalized path
   String normalized = path;
   
  -if (normalized == null)
  -return (null);
  +// Prevent encoding '%', '/', '.' and '\', which are special reserved
  +// characters
  +if ((normalized.indexOf(%25)  0) || (normalized.indexOf(%2F)  0)
  +|| (normalized.indexOf(%2E)  0) 
  +|| (normalized.indexOf(%5C)  0)) {
  +return null;
  +}
   
   if (normalized.equals(/.))
   return /;
  @@ -933,6 +942,14 @@
   }
   } catch (EOFException e) {
   ok = false;
  +} catch (ServletException e) {
  +ok = false;
  +try {
  +((HttpServletResponse) response.getResponse())
  +.sendError(HttpServletResponse.SC_BAD_REQUEST);
  +} catch (Exception f) {
  +;
  +}
   } catch (InterruptedIOException e) {
   if (debug  1) {
   try {
  @@ -986,10 +1003,8 @@
   
   // Finish up the handling of the request
   try {
  -if (ok) {
  -response.finishResponse();
  -request.finishRequest();
  -}
  +response.finishResponse();
  +request.finishRequest();
   if (output != null)
   output.flush();
   } catch (IOException e) {
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpProcessor.java

2001-07-16 Thread remm

remm01/07/16 21:14:26

  Modified:catalina/src/share/org/apache/catalina/connector/http
HttpProcessor.java
  Log:
  - Handle lowercase / uppercase, etc, etc. Patch by Craig + Marc (who should
have committed that themselves, I have terrible problems with my connection in the
evening).
  
  Revision  ChangesPath
  1.31  +11 -7 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java
  
  Index: HttpProcessor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- HttpProcessor.java2001/07/17 01:04:29 1.30
  +++ HttpProcessor.java2001/07/17 04:14:25 1.31
  @@ -1,6 +1,6 @@
  -/* * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.30 2001/07/17 01:04:29 remm Exp $
  - * $Revision: 1.30 $
  - * $Date: 2001/07/17 01:04:29 $
  +/* * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.31 2001/07/17 04:14:25 remm Exp $
  + * $Revision: 1.31 $
  + * $Date: 2001/07/17 04:14:25 $
*
* 
*
  @@ -106,7 +106,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.30 $ $Date: 2001/07/17 01:04:29 $
  + * @version $Revision: 1.31 $ $Date: 2001/07/17 04:14:25 $
*/
   
   final class HttpProcessor
  @@ -820,9 +820,13 @@
   
   // Prevent encoding '%', '/', '.' and '\', which are special reserved
   // characters
  -if ((normalized.indexOf(%25)  0) || (normalized.indexOf(%2F)  0)
  -|| (normalized.indexOf(%2E)  0) 
  -|| (normalized.indexOf(%5C)  0)) {
  +if ((normalized.indexOf(%25) = 0) 
  + || (normalized.indexOf(%2F) = 0)
  +|| (normalized.indexOf(%2E) = 0) 
  +|| (normalized.indexOf(%5C) = 0)
  + || (normalized.indexOf(%2f) = 0)
  +|| (normalized.indexOf(%2e) = 0) 
  +|| (normalized.indexOf(%5c) = 0)) {
   return null;
   }
   
  
  
  



cvs commit: jakarta-tomcat-4.0 build.xml tomcat.nsi

2001-07-18 Thread remm

remm01/07/18 11:32:49

  Modified:.build.xml tomcat.nsi
  Log:
  - Additional tweaks to make the shorcuts command line shorter (it's limited to
255 chars - originally, with the default install, it was 231 chars, so using any 
long path
for the JDK would have broken the shotcuts).
  - Add an installation taget for a Windows system service (should work on
WinNT, Win2k, WinXP). It shouldn't hurt to run that under 9x / Me, but it
shouldn't do anything. The service is based on JavaService, and a binary
is now needed to build the installer target.
  - Before uninstalling, stop the service !!! I'll add shell calls to stop it for you.
  - Obviously, the installation should be done as root.
  - More tweaks are needed for service shutdown. A specialized version
of the Bootstrap and Catalina class will be written (since with JNI we have
only one VM, no need for a socket, but the shutdown has to be syncronous).
That will improve the security too, since right now, any user can kill Tomcat
even when it's run as a service by issuing the shutdown command.
  
  Revision  ChangesPath
  1.29  +15 -12jakarta-tomcat-4.0/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/build.xml,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- build.xml 2001/07/16 23:07:46 1.28
  +++ build.xml 2001/07/18 18:32:49 1.29
  @@ -5,19 +5,20 @@
 property file=build.properties/
 property file=${user.home}/build.properties/
   
  -  property name=nsis.home   value=c:\program files\nsis/
  +  property name=nsis.homevalue=c:\program files\nsis/
  +  property name=javaservice.home value=../javaservice/
   
  -  property name=catalina.build  value=${basedir}/catalina/build/
  -  property name=jasper.buildvalue=${basedir}/jasper/build/
  -  property name=servletapi.home value=../jakarta-servletapi-4/dist/
  -  property name=tomcat.buildvalue=${basedir}/build/
  -  property name=tomcat.dist value=${basedir}/dist/
  -  property name=webapps.build   value=${basedir}/webapps/build/
  -  property name=webapps.distvalue=${basedir}/webapps/dist/
  -
  -  property name=catalina.deploy value=${tomcat.build}/
  -  property name=jasper.deploy   value=${tomcat.build}/
  -  property name=webapps.deploy  value=${tomcat.build}/
  +  property name=catalina.build   value=${basedir}/catalina/build/
  +  property name=jasper.build value=${basedir}/jasper/build/
  +  property name=servletapi.home  value=../jakarta-servletapi-4/dist/
  +  property name=tomcat.build value=${basedir}/build/
  +  property name=tomcat.dist  value=${basedir}/dist/
  +  property name=webapps.buildvalue=${basedir}/webapps/build/
  +  property name=webapps.dist value=${basedir}/webapps/dist/
  +
  +  property name=catalina.deploy  value=${tomcat.build}/
  +  property name=jasper.deployvalue=${tomcat.build}/
  +  property name=webapps.deploy   value=${tomcat.build}/
   
   
 !-- = DEPLOY: Create Directories === --
  @@ -171,6 +172,8 @@
   copy todir=${tomcat.dist}
 fileset dir=resources /
   /copy
  +copy file=${javaservice.home}/bin/JavaService.exe 
  + tofile=${tomcat.dist}/bin/tomcat.exe /
   copy file=tomcat.nsi tofile=${tomcat.dist}/tomcat.nsi /
   exec dir=${tomcat.dist} executable=${nsis.home}\makensis.exe
 arg value=tomcat.nsi /
  
  
  
  1.10  +72 -2 jakarta-tomcat-4.0/tomcat.nsi
  
  Index: tomcat.nsi
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/tomcat.nsi,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- tomcat.nsi2001/07/16 23:07:46 1.9
  +++ tomcat.nsi2001/07/18 18:32:49 1.10
  @@ -1,6 +1,6 @@
   
   ; Tomcat 4 script for Nullsoft Installer
  -; $Id: tomcat.nsi,v 1.9 2001/07/16 23:07:46 remm Exp $
  +; $Id: tomcat.nsi,v 1.10 2001/07/18 18:32:49 remm Exp $
   
   Name jakarta-tomcat-4.0
   Caption Jakarta Tomcat 4.0
  @@ -35,6 +35,7 @@
   Section Tomcat 4.0 (required)
   
 SectionIn 1 2 3
  +
 SetOutPath $INSTDIR
 File tomcat.ico
 File LICENSE
  @@ -51,6 +52,27 @@
 File /r webapps\ROOT\WEB-INF
 File webapps\ROOT\*.*
   
  +  ReadRegStr $1 HKLM SOFTWARE\JavaSoft\Java Development Kit CurrentVersion
  +  ReadRegStr $2 HKLM SOFTWARE\JavaSoft\Java Development Kit\$1 JavaHome
  +
  +  CopyFiles $2\lib\tools.jar $INSTDIR\common\lib 5
  +
  +SectionEnd
  +
  +Section NT Service (NT/2k/XP only)
  +
  +  SectionIn 1 2 3
  +
  +  ReadRegStr $1 HKLM SOFTWARE\JavaSoft\Java Development Kit CurrentVersion
  +  ReadRegStr $2 HKLM SOFTWARE\JavaSoft\Java Development Kit\$1 JavaHome
  +  
  +  SetOutPath $INSTDIR\bin
  +  File /oname=tomcat.exe bin\tomcat.exe
  +  
  +  ExecWait '$INSTDIR\bin\tomcat.exe -install

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup BootstrapService.java CatalinaService.java

2001-07-18 Thread remm

remm01/07/18 15:46:50

  Added:   catalina/src/share/org/apache/catalina/startup
BootstrapService.java CatalinaService.java
  Log:
  - Add a Bootstrap and a Catalina class which do a synchronous stop operation without
using a socket (which is a lot more secure, obviously).
  - Still doesn't solve the shutdown problem unfortunately, since Catalina's
shutdown takes a very long time (without using any CPU time; I still don't know 
the reason for this), and
NT will kill the service after about 30s idle. With only one or two
contexts, the shutdown is faster, and will suceed.
The error message added to NT's event log is :
The Jakarta Tomcat service has timed out during a stop request and is being 
terminated.
  
  Revision  ChangesPath
  1.1  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/BootstrapService.java
  
  Index: BootstrapService.java
  ===
  /*
   * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/BootstrapService.java,v
 1.1 2001/07/18 22:46:50 remm Exp $
   * $Revision: 1.1 $
   * $Date: 2001/07/18 22:46:50 $
   *
   * 
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *notice, this list of conditions and the following disclaimer in
   *the documentation and/or other materials provided with the
   *distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *any, must include the following acknowlegement:
   *   This product includes software developed by the
   *Apache Software Foundation (http://www.apache.org/).
   *Alternately, this acknowlegement may appear in the software itself,
   *if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names The Jakarta Project, Tomcat, and Apache Software
   *Foundation must not be used to endorse or promote products derived
   *from this software without prior written permission. For written
   *permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called Apache
   *nor may Apache appear in their names without prior written
   *permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * 
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * http://www.apache.org/.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */
  
  
  package org.apache.catalina.startup;
  
  
  import java.io.File;
  import java.io.IOException;
  import java.lang.reflect.Method;
  import java.net.MalformedURLException;
  import java.net.URL;
  import java.util.ArrayList;
  import org.apache.catalina.loader.Extension;
  import org.apache.catalina.loader.StandardClassLoader;
  
  
  /**
   * Special version of the Catalina bootstrap, designed to be invoked with JNI,
   * and designed to allow easier wrapping by system level components, which
   * would otherwise be confused by the asychronous startup and shutdown Catalina
   * uses. This class should be used to run Catalina as a system service under
   * Windows NT and clones.
   *
   * @author Craig R. McClanahan
   * @author Remy Maucherat
   * @version $Revision: 1.1 $ $Date: 2001/07/18 22:46:50 $
   */
  
  public final class BootstrapService

cvs commit: jakarta-tomcat-4.0/catalina build.xml

2001-07-18 Thread remm

remm01/07/18 15:47:29

  Modified:catalina build.xml
  Log:
  - Bundle the BootstrapService class in bootstrap.jar.
  
  Revision  ChangesPath
  1.49  +2 -2  jakarta-tomcat-4.0/catalina/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/build.xml,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- build.xml 2001/07/16 06:57:18 1.48
  +++ build.xml 2001/07/18 22:47:29 1.49
  @@ -159,7 +159,7 @@
   !-- Construct bootstrap JAR file --
   jar   jarfile=${catalina.build}/bin/bootstrap.jar
  basedir=${catalina.build}/classes
  -   
includes=org/apache/catalina/startup/Bootstrap.class,org/apache/catalina/loader/StandardClassLoader*.class,org/apache/catalina/loader/Extension.class,org/apache/catalina/loader/Reloader.class,org/apache/catalina/startup/SecurityManagerDebug.class,org/apache/naming/JndiPermission.class
 
  +   
includes=org/apache/catalina/startup/Bootstrap.class,org/apache/catalina/startup/BootstrapService.class,org/apache/catalina/loader/StandardClassLoader*.class,org/apache/catalina/loader/Extension.class,org/apache/catalina/loader/Reloader.class,org/apache/catalina/startup/SecurityManagerDebug.class,org/apache/naming/JndiPermission.class
 
  manifest=etc/bootstrap.MF
  /
   jar   jarfile=${catalina.build}/common/lib/naming.jar
  @@ -334,7 +334,7 @@
 target name=deploy-main depends=deploy-static
   jar  jarfile=${catalina.deploy}/server/lib/catalina.jar
 basedir=${catalina.build}/classes 
  -  
excludes=**/org/apache/naming/**,**/connector/warp/**,org/apache/catalina/startup/Bootstrap.class,org/apache/catalina/loader/StandardClassLoader*.class,org/apache/catalina/loader/Extension.class,org/apache/catalina/loader/Reloader.class,org/apache/catalina/startup/SecurityManagerDebug.class
 /
  +  
excludes=**/org/apache/naming/**,**/connector/warp/**,org/apache/catalina/startup/Bootstrap.class,org/apache/catalina/startup/BootstrapService.class,org/apache/catalina/loader/StandardClassLoader*.class,org/apache/catalina/loader/Extension.class,org/apache/catalina/loader/Reloader.class,org/apache/catalina/startup/SecurityManagerDebug.class
 /
   jar  jarfile=${catalina.deploy}/server/lib/warp.jar
 basedir=${catalina.build}/classes 
 includes=**/connector/warp/** /
  
  
  



cvs commit: jakarta-tomcat-4.0 tomcat.nsi

2001-07-18 Thread remm

remm01/07/18 15:49:02

  Modified:.tomcat.nsi
  Log:
  - Use BootstrapService class instead of Bootstrap.
  
  Revision  ChangesPath
  1.11  +3 -3  jakarta-tomcat-4.0/tomcat.nsi
  
  Index: tomcat.nsi
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/tomcat.nsi,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- tomcat.nsi2001/07/18 18:32:49 1.10
  +++ tomcat.nsi2001/07/18 22:49:02 1.11
  @@ -1,6 +1,6 @@
   
   ; Tomcat 4 script for Nullsoft Installer
  -; $Id: tomcat.nsi,v 1.10 2001/07/18 18:32:49 remm Exp $
  +; $Id: tomcat.nsi,v 1.11 2001/07/18 22:49:02 remm Exp $
   
   Name jakarta-tomcat-4.0
   Caption Jakarta Tomcat 4.0
  @@ -55,7 +55,7 @@
 ReadRegStr $1 HKLM SOFTWARE\JavaSoft\Java Development Kit CurrentVersion
 ReadRegStr $2 HKLM SOFTWARE\JavaSoft\Java Development Kit\$1 JavaHome
   
  -  CopyFiles $2\lib\tools.jar $INSTDIR\common\lib 5
  +  CopyFiles $2\lib\tools.jar $INSTDIR\common\lib 4500
   
   SectionEnd
   
  @@ -69,7 +69,7 @@
 SetOutPath $INSTDIR\bin
 File /oname=tomcat.exe bin\tomcat.exe
 
  -  ExecWait '$INSTDIR\bin\tomcat.exe -install Jakarta Tomcat 
$2\jre\bin\hotspot\jvm.dll -Djava.class.path=$INSTDIR\bin\bootstrap.jar 
-Dcatalina.home=$INSTDIR -start org.apache.catalina.startup.Bootstrap -params start 
-stop org.apache.catalina.startup.Bootstrap -params stop -out 
$INSTDIR\logs\stdout.log -err $INSTDIR\logs\stderr.log'
  +  ExecWait '$INSTDIR\bin\tomcat.exe -install Jakarta Tomcat 
$2\jre\bin\hotspot\jvm.dll -Djava.class.path=$INSTDIR\bin\bootstrap.jar 
-Dcatalina.home=$INSTDIR -start org.apache.catalina.startup.BootstrapService -params 
start -stop org.apache.catalina.startup.BootstrapService -params stop -out 
$INSTDIR\logs\stdout.log -err $INSTDIR\logs\stderr.log'
 
 ClearErrors
   
  
  
  



cvs commit: jakarta-tomcat-4.0 tomcat.nsi

2001-07-18 Thread remm

remm01/07/18 16:14:04

  Modified:.tomcat.nsi
  Log:
  - Don't install the system service by default.
  
  Revision  ChangesPath
  1.12  +2 -2  jakarta-tomcat-4.0/tomcat.nsi
  
  Index: tomcat.nsi
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/tomcat.nsi,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- tomcat.nsi2001/07/18 22:49:02 1.11
  +++ tomcat.nsi2001/07/18 23:14:03 1.12
  @@ -1,6 +1,6 @@
   
   ; Tomcat 4 script for Nullsoft Installer
  -; $Id: tomcat.nsi,v 1.11 2001/07/18 22:49:02 remm Exp $
  +; $Id: tomcat.nsi,v 1.12 2001/07/18 23:14:03 remm Exp $
   
   Name jakarta-tomcat-4.0
   Caption Jakarta Tomcat 4.0
  @@ -61,7 +61,7 @@
   
   Section NT Service (NT/2k/XP only)
   
  -  SectionIn 1 2 3
  +  SectionIn 3
   
 ReadRegStr $1 HKLM SOFTWARE\JavaSoft\Java Development Kit CurrentVersion
 ReadRegStr $2 HKLM SOFTWARE\JavaSoft\Java Development Kit\$1 JavaHome
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappClassLoader.java

2001-07-22 Thread remm

remm01/07/22 14:23:17

  Modified:catalina/src/share/org/apache/catalina/loader
WebappClassLoader.java
  Log:
  - Fix for bug #2725 (non JARs files put in /WEB-INF/lib cause constant
reloads of a reloadable context).
Reported by Jeff Turner jeff at socialchange.net.au.
  
  Revision  ChangesPath
  1.11  +25 -12
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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- WebappClassLoader.java2001/07/22 20:25:10 1.10
  +++ WebappClassLoader.java2001/07/22 21:23:17 1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
 1.10 2001/07/22 20:25:10 pier Exp $
  - * $Revision: 1.10 $
  - * $Date: 2001/07/22 20:25:10 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
 1.11 2001/07/22 21:23:17 remm Exp $
  + * $Revision: 1.11 $
  + * $Date: 2001/07/22 21:23:17 $
*
* 
*
  @@ -123,7 +123,7 @@
*
* @author Remy Maucherat
* @author Craig R. McClanahan
  - * @version $Revision: 1.10 $ $Date: 2001/07/22 20:25:10 $
  + * @version $Revision: 1.11 $ $Date: 2001/07/22 21:23:17 $
*/
   public class WebappClassLoader
   extends URLClassLoader
  @@ -719,20 +719,33 @@
   
   try {
   NamingEnumeration enum = resources.listBindings(getJarPath());
  -int i;
  -for (i = 0; enum.hasMoreElements()  (i  length); i++) {
  +int i = 0;
  +while (enum.hasMoreElements()  (i  length)) {
   NameClassPair ncPair = (NameClassPair) enum.nextElement();
  -if (!ncPair.getName().equals(jarNames[i])) {
  +String name = ncPair.getName();
  +// Ignore non JARs present in the lib folder
  +if (!name.endsWith(.jar))
  +continue;
  +if (!name.equals(jarNames[i])) {
   // Missing JAR
  -log(Additional JARs have been added : '
  -+ ncPair.getName() + ');
  +log(Additional JARs have been added : ' 
  ++ name + ');
   return (true);
   }
  +i++;
   }
   if (enum.hasMoreElements()) {
  -// There was more JARs
  -log(Additional JARs have been added);
  -return (true);
  +while (enum.hasMoreElements()) {
  +NameClassPair ncPair = 
  +(NameClassPair) enum.nextElement();
  +String name = ncPair.getName();
  +// Additional non-JAR files are allowed
  +if (name.endsWith(.jar)) {
  +// There was more JARs
  +log(Additional JARs have been added);
  +return (true);
  +}
  +}
   } else if (i  jarNames.length) {
   // There was less JARs
   log(Additional JARs have been added);
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina build.xml

2001-07-22 Thread remm

remm01/07/22 20:12:02

  Modified:catalina build.xml
  Log:
  - Build the service classes (../service/java), and put
org.apache.service.Service and org.apache.service.ServiceController in
bootstrap.jar.
  
  Revision  ChangesPath
  1.50  +5 -1  jakarta-tomcat-4.0/catalina/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/build.xml,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- build.xml 2001/07/18 22:47:29 1.49
  +++ build.xml 2001/07/23 03:12:02 1.50
  @@ -130,6 +130,10 @@
classname=javax.mail.internet.MimeMessage /
   available property=jdk.1.3.present
classname=java.lang.reflect.Proxy /
  +!-- Compile Service API --
  +javac   srcdir=../service/java destdir=${catalina.build}/classes
  + deprecation=off debug=on optimize=off target=1.2
  + excludes=**/CVS/** /
   !-- Compile internal server components --
   javac   srcdir=src/share destdir=${catalina.build}/classes

classpath=${parser.jar}:${jaxp.jar}:${regexp.jar}:${servlet.jar}:${jcert.jar}:${jnet.jar}:${jsse.jar}:${jmxri.jar}
  @@ -159,7 +163,7 @@
   !-- Construct bootstrap JAR file --
   jar   jarfile=${catalina.build}/bin/bootstrap.jar
  basedir=${catalina.build}/classes
  -   
includes=org/apache/catalina/startup/Bootstrap.class,org/apache/catalina/startup/BootstrapService.class,org/apache/catalina/loader/StandardClassLoader*.class,org/apache/catalina/loader/Extension.class,org/apache/catalina/loader/Reloader.class,org/apache/catalina/startup/SecurityManagerDebug.class,org/apache/naming/JndiPermission.class
 
  +   
includes=org/apache/service/Service.class,org/apache/service/ServiceController.class,org/apache/catalina/startup/Bootstrap.class,org/apache/catalina/startup/BootstrapService.class,org/apache/catalina/loader/StandardClassLoader*.class,org/apache/catalina/loader/Extension.class,org/apache/catalina/loader/Reloader.class,org/apache/catalina/startup/SecurityManagerDebug.class,org/apache/naming/JndiPermission.class
 
  manifest=etc/bootstrap.MF
  /
   jar   jarfile=${catalina.build}/common/lib/naming.jar
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup CatalinaService.java

2001-07-22 Thread remm

remm01/07/22 20:12:45

  Modified:catalina/src/share/org/apache/catalina/startup
CatalinaService.java
  Log:
  - Separate start into load + start.
  
  Revision  ChangesPath
  1.3   +43 -6 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaService.java
  
  Index: CatalinaService.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CatalinaService.java  2001/07/22 20:25:13 1.2
  +++ CatalinaService.java  2001/07/23 03:12:45 1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaService.java,v
 1.2 2001/07/22 20:25:13 pier Exp $
  - * $Revision: 1.2 $
  - * $Date: 2001/07/22 20:25:13 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaService.java,v
 1.3 2001/07/23 03:12:45 remm Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/07/23 03:12:45 $
*
* 
*
  @@ -104,7 +104,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.2 $ $Date: 2001/07/22 20:25:13 $
  + * @version $Revision: 1.3 $ $Date: 2001/07/23 03:12:45 $
*/
   
   public class CatalinaService extends Catalina {
  @@ -163,9 +163,24 @@
   
   
   /**
  + * Execute the processing that has been configured from the command line.
  + */
  +protected void execute() throws Exception {
  +
  +if (starting) {
  +load();
  +start();
  +} else if (stopping) {
  +stop();
  +}
  +
  +}
  +
  +
  +/**
* Start a new server instance.
*/
  -protected void start() {
  +public void load() {
   
   // Create and execute our mapper
   XmlMapper mapper = createStartMapper();
  @@ -221,6 +236,28 @@
   // Start the new server
   if (server instanceof Lifecycle) {
   try {
  +server.initialize();
  +} catch (LifecycleException e) {
  +System.out.println(Catalina.start:  + e);
  +e.printStackTrace(System.out);
  +if (e.getThrowable() != null) {
  +System.out.println(- Root Cause -);
  +e.getThrowable().printStackTrace(System.out);
  +}
  +}
  +}
  +
  +}
  +
  +
  +/**
  + * Start a new server instance.
  + */
  +public void start() {
  +
  +// Start the new server
  +if (server instanceof Lifecycle) {
  +try {
   ((Lifecycle) server).start();
   } catch (LifecycleException e) {
   System.out.println(Catalina.start:  + e);
  @@ -238,7 +275,7 @@
   /**
* Stop an existing server instance.
*/
  -protected void stop() {
  +public void stop() {
   
   // Shut down the server
   if (server instanceof Lifecycle) {
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup BootstrapService.java

2001-07-22 Thread remm

remm01/07/22 20:14:46

  Modified:catalina/src/share/org/apache/catalina/startup
BootstrapService.java
  Log:
  - Implement Service interface.
  - The legacy static methods are still there until JavaService is modifieded to
use the Service interface instead, but it will be removed when it's done.
  
  Revision  ChangesPath
  1.3   +142 -5
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/BootstrapService.java
  
  Index: BootstrapService.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/BootstrapService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BootstrapService.java 2001/07/22 20:25:13 1.2
  +++ BootstrapService.java 2001/07/23 03:14:46 1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/BootstrapService.java,v
 1.2 2001/07/22 20:25:13 pier Exp $
  - * $Revision: 1.2 $
  - * $Date: 2001/07/22 20:25:13 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/BootstrapService.java,v
 1.3 2001/07/23 03:14:46 remm Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/07/23 03:14:46 $
*
* 
*
  @@ -71,6 +71,8 @@
   import java.net.MalformedURLException;
   import java.net.URL;
   import java.util.ArrayList;
  +import org.apache.service.Service;
  +import org.apache.service.ServiceController;
   import org.apache.catalina.loader.Extension;
   import org.apache.catalina.loader.StandardClassLoader;
   
  @@ -84,10 +86,11 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.2 $ $Date: 2001/07/22 20:25:13 $
  + * @version $Revision: 1.3 $ $Date: 2001/07/23 03:14:46 $
*/
   
  -public final class BootstrapService {
  +public final class BootstrapService 
  +implements Service {
   
   
   // --- Static Variables
  @@ -103,6 +106,140 @@
* Catalina instance.
*/
   private static Object catalina = null;
  +
  +
  +/**
  + * Catalina service.
  + */
  +private Object catalinaService = null;
  +
  +
  +//  Service Methods
  +
  +
  +/**
  + * Load the Catalina Service.
  + */
  +public void load(ServiceController controller, String arguments[])
  +throws Throwable {
  +
  +System.out.println(Create Catalina server);
  +
  +// Construct the class loaders we will need
  +ClassLoader commonLoader = createCommonLoader();
  +ClassLoader catalinaLoader =
  +createCatalinaLoader(commonLoader);
  +ClassLoader sharedLoader = createSharedLoader(commonLoader);
  +
  +Thread.currentThread().setContextClassLoader(catalinaLoader);
  +
  +// Load our startup class and call its process() method
  +
  +if( System.getSecurityManager() != null ) {
  +// Pre load some classes required for SecurityManager
  +// so that defineClassInPackage does not throw a
  +// security exception.
  +String basePackage = org.apache.catalina.;
  +catalinaLoader.loadClass
  +(basePackage +
  + core.ApplicationContext$PrivilegedGetRequestDispatcher);
  +catalinaLoader.loadClass
  +(basePackage +
  + core.ApplicationContext$PrivilegedGetResource);
  +catalinaLoader.loadClass
  +(basePackage +
  + core.ApplicationContext$PrivilegedGetResourcePaths);
  +catalinaLoader.loadClass
  +(basePackage +
  + core.ApplicationContext$PrivilegedLogMessage);
  +catalinaLoader.loadClass
  +(basePackage +
  + core.ApplicationContext$PrivilegedLogException);
  +catalinaLoader.loadClass
  +(basePackage +
  + core.ApplicationContext$PrivilegedLogThrowable);
  +catalinaLoader.loadClass
  +(basePackage +
  + core.ApplicationDispatcher$PrivilegedForward);
  +catalinaLoader.loadClass
  +(basePackage +
  + core.ApplicationDispatcher$PrivilegedInclude);
  +catalinaLoader.loadClass
  +(basePackage +
  + connector.HttpRequestBase$PrivilegedGetSession);
  +catalinaLoader.loadClass
  +(basePackage +
  + loader.WebappClassLoader$PrivilegedFindResource);
  +catalinaLoader.loadClass
  +(basePackage + session.StandardSession

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets WebdavServlet.java

2001-07-23 Thread remm

remm01/07/22 23:27:40

  Modified:catalina/src/share/org/apache/catalina/servlets
WebdavServlet.java
  Log:
  - Decode destination header (was previously handled by normalize).
  
  Revision  ChangesPath
  1.21  +7 -5  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java
  
  Index: WebdavServlet.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- WebdavServlet.java2001/07/22 20:25:11 1.20
  +++ WebdavServlet.java2001/07/23 06:27:40 1.21
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java,v
 1.20 2001/07/22 20:25:11 pier Exp $
  - * $Revision: 1.20 $
  - * $Date: 2001/07/22 20:25:11 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java,v
 1.21 2001/07/23 06:27:40 remm Exp $
  + * $Revision: 1.21 $
  + * $Date: 2001/07/23 06:27:40 $
*
* 
*
  @@ -118,6 +118,7 @@
   import org.apache.catalina.util.StringManager;
   import org.apache.catalina.util.XMLWriter;
   import org.apache.catalina.util.DOMWriter;
  +import org.apache.catalina.util.RequestUtil;
   
   
   /**
  @@ -125,7 +126,7 @@
* are handled by the DefaultServlet.
*
* @author Remy Maucherat
  - * @version $Revision: 1.20 $ $Date: 2001/07/22 20:25:11 $
  + * @version $Revision: 1.21 $ $Date: 2001/07/23 06:27:40 $
*/
   
   public class WebdavServlet
  @@ -1497,7 +1498,8 @@
   }
   }
   
  -destinationPath = normalize(destinationPath);
  +destinationPath = 
  +RequestUtil.URLDecode(normalize(destinationPath), UTF8);
   
   if (debug  0)
   System.out.println(Dest path : + destinationPath);
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources ProxyDirContext.java

2001-07-24 Thread remm

remm01/07/24 15:41:05

  Modified:catalina/src/share/org/apache/naming/resources
ProxyDirContext.java
  Log:
  - Add a cachingAllowed flag to enable / disable caching dynamically.
  
  Revision  ChangesPath
  1.5   +27 -5 
jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/ProxyDirContext.java
  
  Index: ProxyDirContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/ProxyDirContext.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ProxyDirContext.java  2001/05/16 05:57:44 1.4
  +++ ProxyDirContext.java  2001/07/24 22:41:05 1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/ProxyDirContext.java,v
 1.4 2001/05/16 05:57:44 remm Exp $
  - * $Revision: 1.4 $
  - * $Date: 2001/05/16 05:57:44 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/ProxyDirContext.java,v
 1.5 2001/07/24 22:41:05 remm Exp $
  + * $Revision: 1.5 $
  + * $Date: 2001/07/24 22:41:05 $
*
* 
*
  @@ -84,7 +84,7 @@
* Proxy Directory Context implementation.
*
* @author Remy Maucherat
  - * @version $Revision: 1.4 $ $Date: 2001/05/16 05:57:44 $
  + * @version $Revision: 1.5 $ $Date: 2001/07/24 22:41:05 $
*/
   
   public class ProxyDirContext implements DirContext {
  @@ -165,6 +165,12 @@
   protected int cacheTTL = 5000; // 5s
   
   
  +/**
  + * Caching allowed flag.
  + */
  +protected boolean cachingAllowed = true;
  +
  +
   // - Public Methods
   
   
  @@ -195,6 +201,22 @@
   }
   
   
  +/**
  + * Is caching allowed ?
  + */
  +public boolean isCachingAllowed() {
  +return cachingAllowed;
  +}
  +
  +
  +/**
  + * Set caching allowed flag.
  + */
  +public void setCachingAllowed(boolean cachingAllowed) {
  +this.cachingAllowed = cachingAllowed;
  +}
  +
  +
   //  Context Methods
   
   
  @@ -1321,7 +1343,7 @@
* Lookup in cache.
*/
   protected CacheEntry cacheLookup(String name) {
  -if (cache == null)
  +if (!cachingAllowed || (cache == null))
   return (null);
   CacheEntry cacheEntry = (CacheEntry) cache.get(name);
   if (cacheEntry == null) {
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core StandardContext.java

2001-07-24 Thread remm

remm01/07/24 15:51:43

  Modified:catalina/src/share/org/apache/catalina/core
StandardContext.java
  Log:
  - Fix for #2710 - getNamingContextName returns incorrect name.
Patch submitted by Vishy Kasar vishy at borland.com
  
  Revision  ChangesPath
  1.70  +30 -17
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- StandardContext.java  2001/07/22 20:25:08 1.69
  +++ StandardContext.java  2001/07/24 22:51:43 1.70
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.69 2001/07/22 20:25:08 pier Exp $
  - * $Revision: 1.69 $
  - * $Date: 2001/07/22 20:25:08 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.70 2001/07/24 22:51:43 remm Exp $
  + * $Revision: 1.70 $
  + * $Date: 2001/07/24 22:51:43 $
*
* 
*
  @@ -73,6 +73,7 @@
   import java.util.Iterator;
   import java.util.TreeMap;
   import java.util.Hashtable;
  +import java.util.Stack;
   import java.util.Enumeration;
   import java.util.StringTokenizer;
   import javax.servlet.FilterConfig;
  @@ -141,7 +142,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.69 $ $Date: 2001/07/22 20:25:08 $
  + * @version $Revision: 1.70 $ $Date: 2001/07/24 22:51:43 $
*/
   
   public class StandardContext
  @@ -473,6 +474,12 @@
   private boolean filesystemBased = false;
   
   
  +/**
  + * Name of the associated naming context.
  + */
  +private String namingContextName = null;
  +
  +
   // - Context Properties
   
   
  @@ -3672,19 +3679,25 @@
* Get naming context full name.
*/
   private String getNamingContextName() {
  -Container parent = getParent();
  -if (parent != null) {
  -StringBuffer buf = new StringBuffer();
  -buf.append(/).append(parent.getName()).append(getName());
  -parent = parent.getParent();
  -while (parent != null) {
  -buf.append(/).append(parent.getName());
  -parent = parent.getParent();
  -}
  -return buf.toString();
  -} else {
  -return getName();
  -}
  + if (namingContextName == null) {
  + Container parent = getParent();
  + if (parent == null) {
  + namingContextName = getName();
  + } else {
  + Stack stk = new Stack();
  + StringBuffer buff = new StringBuffer();
  + while (parent != null) {
  + stk.push(parent.getName());
  + parent = parent.getParent();
  + }
  + while (!stk.empty()) {
  + buff.append(/ + stk.pop());
  + }
  + buff.append(getName());
  + namingContextName = buff.toString();
  + }
  + }
  + return namingContextName;
   }
   
   
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets WebdavServlet.java

2001-07-24 Thread remm

remm01/07/24 18:07:26

  Modified:catalina/src/share/org/apache/catalina/servlets
WebdavServlet.java
  Log:
  - An instance of DocumentBuilderFactory is not thread safe, so we cannot
keep a reference to one in the servlet instance.
  
  Revision  ChangesPath
  1.23  +23 -26
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java
  
  Index: WebdavServlet.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- WebdavServlet.java2001/07/24 01:30:59 1.22
  +++ WebdavServlet.java2001/07/25 01:07:25 1.23
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java,v
 1.22 2001/07/24 01:30:59 remm Exp $
  - * $Revision: 1.22 $
  - * $Date: 2001/07/24 01:30:59 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java,v
 1.23 2001/07/25 01:07:25 remm Exp $
  + * $Revision: 1.23 $
  + * $Date: 2001/07/25 01:07:25 $
*
* 
*
  @@ -126,7 +126,7 @@
* are handled by the DefaultServlet.
*
* @author Remy Maucherat
  - * @version $Revision: 1.22 $ $Date: 2001/07/24 01:30:59 $
  + * @version $Revision: 1.23 $ $Date: 2001/07/25 01:07:25 $
*/
   
   public class WebdavServlet
  @@ -216,12 +216,6 @@
   
   
   /**
  - * JAXP Document builder factory.
  - */
  -private DocumentBuilderFactory documentBuilderFactory;
  -
  -
  -/**
* Repository of the locks put on single resources.
* p
* Key : path br
  @@ -276,8 +270,6 @@
   ;
   }
   
  -documentBuilderFactory = DocumentBuilderFactory.newInstance();
  -
   }
   
   
  @@ -285,6 +277,23 @@
   
   
   /**
  + * Return JAXP document builder instance.
  + */
  +protected DocumentBuilder getDocumentBuilder()
  +throws ServletException {
  +DocumentBuilder documentBuilder = null;
  +try {
  +documentBuilder = 
  +DocumentBuilderFactory.newInstance().newDocumentBuilder();
  +} catch(ParserConfigurationException e) {
  +throw new ServletException
  +(sm.getString(webdavservlet.jaxpfailed));
  +}
  +return documentBuilder;
  +}
  +
  +
  +/**
* Handles the special WebDAV methods.
*/
   protected void service(HttpServletRequest req, HttpServletResponse resp)
  @@ -434,13 +443,7 @@
   
   Node propNode = null;
   
  -DocumentBuilder documentBuilder = null;
  -try {
  -documentBuilder = documentBuilderFactory.newDocumentBuilder();
  -} catch(ParserConfigurationException e) {
  -throw new ServletException
  -(sm.getString(webdavservlet.jaxpfailed));
  -}
  +DocumentBuilder documentBuilder = getDocumentBuilder();
   
   try {
   Document document = documentBuilder.parse
  @@ -896,13 +899,7 @@
   
   Node lockInfoNode = null;
   
  -DocumentBuilder documentBuilder = null;
  -try {
  -documentBuilder = documentBuilderFactory.newDocumentBuilder();
  -} catch(ParserConfigurationException e) {
  -throw new ServletException
  -(sm.getString(webdavservlet.jaxpfailed));
  -}
  +DocumentBuilder documentBuilder = getDocumentBuilder();
   
   try {
   Document document = documentBuilder.parse(new InputSource
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core StandardContext.java StandardContextValve.java StandardWrapper.java

2001-07-25 Thread remm

remm01/07/24 21:05:50

  Modified:catalina/src/share/org/apache/catalina/core
StandardContext.java StandardContextValve.java
StandardWrapper.java
  Log:
  - Cleanup of the thread binding.
  - Should now set up the context class loader during the start and stop of
listeners and filters (bug 2755).
  
  Revision  ChangesPath
  1.71  +27 -33
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- StandardContext.java  2001/07/24 22:51:43 1.70
  +++ StandardContext.java  2001/07/25 04:05:50 1.71
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.70 2001/07/24 22:51:43 remm Exp $
  - * $Revision: 1.70 $
  - * $Date: 2001/07/24 22:51:43 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.71 2001/07/25 04:05:50 remm Exp $
  + * $Revision: 1.71 $
  + * $Date: 2001/07/25 04:05:50 $
*
* 
*
  @@ -142,7 +142,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.70 $ $Date: 2001/07/24 22:51:43 $
  + * @version $Revision: 1.71 $ $Date: 2001/07/25 04:05:50 $
*/
   
   public class StandardContext
  @@ -2284,7 +2284,7 @@
   setPaused(true);
   
   // Binding thread
  -bindThread();
  +ClassLoader oldCCL = bindThread();
   
   // Shut down the current version of all active servlets
   Container children[] = findChildren();
  @@ -2301,11 +2301,6 @@
   }
   }
   
  -// Unbinding thread
  -if (isUseNaming()) {
  -ContextBindings.unbindThread(this, this);
  -}
  -
   // Clear all application-originated servlet context attributes
   if (context != null)
   context.clearAttributes();
  @@ -2324,7 +2319,7 @@
   }
   
   // Binding thread
  -unbindThread();
  +unbindThread(oldCCL);
   
   // Dump the old Jasper loader
   jasperLoader = null;
  @@ -2361,16 +2356,7 @@
   }
   
   // Binding thread
  -bindThread();
  -
  -ClassLoader oldCtxClassLoader =
  -Thread.currentThread().getContextClassLoader();
  -ClassLoader classLoader = loader.getClassLoader();
  -
  -// Set the context class loader
  -if (classLoader != null) {
  -Thread.currentThread().setContextClassLoader(classLoader);
  -}
  +oldCCL = bindThread();
   
   // Restart our session manager (AFTER naming context recreated/bound)
   if ((manager != null)  (manager instanceof Lifecycle)) {
  @@ -2399,11 +2385,6 @@
   postResources();
   postWelcomeFiles();
   
  -// Set the context class loader to the old class loader
  -if (classLoader != null) {
  -Thread.currentThread().setContextClassLoader(oldCtxClassLoader);
  -}
  -
   // Restart our currently defined servlets
   for (int i = 0; i  children.length; i++) {
   if (!ok)
  @@ -2425,7 +2406,7 @@
   loadOnStartup(children);
   
   // Unbinding thread
  -unbindThread();
  +unbindThread(oldCCL);
   
   // Start accepting requests again
   if (ok) {
  @@ -3283,7 +3264,7 @@
   (Globals.RESOURCES_ATTR, getResources());
   
   // Binding thread
  -bindThread();
  +ClassLoader oldCCL = bindThread();
   
   // Configure and call application event listeners and filters
   if (ok) {
  @@ -3306,7 +3287,7 @@
   loadOnStartup(findChildren());
   
   // Unbinding thread
  -unbindThread();
  +unbindThread(oldCCL);
   
   if (ok) {
   if (debug = 1)
  @@ -3334,7 +3315,7 @@
   setAvailable(false);
   
   // Binding thread
  -bindThread();
  +ClassLoader oldCCL = bindThread();
   
   // Stop our filters and application listeners
   filterStop();
  @@ -3356,7 +3337,7 @@
   super.stop();
   
   // Unbinding thread
  -unbindThread();
  +unbindThread(oldCCL);
   
   // Dump the old Jasper loader
   jasperLoader = null;
  @@ -3457,8 +3438,15 @@
   /**
* Bind current thread, both for CL purposes and for JNDI ENC support
* during : startup, shutdown and realoading of the context.
  + * 
  + * @return the previous context

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core ApplicationContext.java LocalStrings.properties

2001-07-25 Thread remm

remm01/07/24 21:25:58

  Modified:catalina/src/share/org/apache/catalina/core
ApplicationContext.java LocalStrings.properties
  Log:
  - Throw IAE if name is nul in setAttribute call.
  
  Revision  ChangesPath
  1.30  +9 -4  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationContext.java
  
  Index: ApplicationContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationContext.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- ApplicationContext.java   2001/07/22 20:25:08 1.29
  +++ ApplicationContext.java   2001/07/25 04:25:58 1.30
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationContext.java,v
 1.29 2001/07/22 20:25:08 pier Exp $
  - * $Revision: 1.29 $
  - * $Date: 2001/07/22 20:25:08 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationContext.java,v
 1.30 2001/07/25 04:25:58 remm Exp $
  + * $Revision: 1.30 $
  + * $Date: 2001/07/25 04:25:58 $
*
* 
*
  @@ -113,7 +113,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.29 $ $Date: 2001/07/22 20:25:08 $
  + * @version $Revision: 1.30 $ $Date: 2001/07/25 04:25:58 $
*/
   
   public class ApplicationContext
  @@ -908,6 +908,11 @@
* @param value New attribute value to be bound
*/
   public void setAttribute(String name, Object value) {
  +
  +// Name cannot be null
  +if (name == null)
  +throw new IllegalArgumentException
  +(sm.getString(applicationContext.setAttribute.namenull));
   
   // Null value is the same as removeAttribute()
   if (value == null) {
  
  
  
  1.35  +1 -0  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/LocalStrings.properties,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- LocalStrings.properties   2001/07/22 18:38:05 1.34
  +++ LocalStrings.properties   2001/07/25 04:25:58 1.35
  @@ -1,5 +1,6 @@
   applicationContext.attributeEvent=Exception thrown by attributes event listener
   applicationContext.requestDispatcher.iae=Path {0} does not start with a / 
character
  +applicationContext.setAttribute.namenull=Name cannot be null
   applicationDispatcher.allocateException=Allocate exception for servlet {0}
   applicationDispatcher.deallocateException=Deallocate exception for servlet {0}
   applicationDispatcher.forward.ise=Cannot forward after response has been committed
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector LocalStrings.properties RequestBase.java

2001-07-25 Thread remm

remm01/07/24 21:27:29

  Modified:catalina/src/share/org/apache/catalina/connector
LocalStrings.properties RequestBase.java
  Log:
  - Throw IAE if name is null in setAttribute call.
  
  Revision  ChangesPath
  1.5   +1 -0  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/LocalStrings.properties,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LocalStrings.properties   2001/04/26 17:41:07 1.4
  +++ LocalStrings.properties   2001/07/25 04:27:29 1.5
  @@ -10,6 +10,7 @@
   responseBase.getWriter.ise=getOutputStream() has already been called for this 
response
   responseBase.reset.ise=Cannot reset after response has been committed
   responseBase.resetBuffer.ise=Cannot reset buffer after response has been committed
  +requestBase.setAttribute.namenull=Name cannot be null
   responseBase.setBufferSize.ise=Buffer size cannot be changed after data has been 
written
   responseStream.close.closed=This output stream has already been closed
   responseStream.flush.closed=Cannot flush a closed output stream
  
  
  
  1.16  +9 -4  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java
  
  Index: RequestBase.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- RequestBase.java  2001/07/22 20:25:06 1.15
  +++ RequestBase.java  2001/07/25 04:27:29 1.16
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java,v
 1.15 2001/07/22 20:25:06 pier Exp $
  - * $Revision: 1.15 $
  - * $Date: 2001/07/22 20:25:06 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java,v
 1.16 2001/07/25 04:27:29 remm Exp $
  + * $Revision: 1.16 $
  + * $Date: 2001/07/25 04:27:29 $
*
* 
*
  @@ -98,7 +98,7 @@
* the connector-specific methods need to be implemented.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.15 $ $Date: 2001/07/22 20:25:06 $
  + * @version $Revision: 1.16 $ $Date: 2001/07/25 04:27:29 $
*/
   
   public abstract class RequestBase
  @@ -971,6 +971,11 @@
* @param value The associated value
*/
   public void setAttribute(String name, Object value) {
  +
  +// Name cannot be null
  +if (name == null)
  +throw new IllegalArgumentException
  +(sm.getString(requestBase.setAttribute.namenull));
   
   // Null value is the same as removeAttribute()
   if (value == null) {
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http Constants.java HttpProcessor.java

2001-07-25 Thread remm

remm01/07/25 21:03:23

  Modified:catalina/src/share/org/apache/catalina/connector/http
Constants.java HttpProcessor.java
  Log:
  - Fix for prohibitive shutdown times when using the HTTP/1.1 connector.
  - Now, unless the connector has successfully parsed the request line of a new
request, it is not considered active. If the request line is parsed, the connector
will remain in active state until the end of the processing of the request.
  - The shutdown method will only wait for 5s before returning if the processor
is in active state.
  
  Revision  ChangesPath
  1.5   +6 -3  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/Constants.java
  
  Index: Constants.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/Constants.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Constants.java2001/07/22 20:25:07 1.4
  +++ Constants.java2001/07/26 04:03:23 1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/Constants.java,v
 1.4 2001/07/22 20:25:07 pier Exp $
  - * $Revision: 1.4 $
  - * $Date: 2001/07/22 20:25:07 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/Constants.java,v
 1.5 2001/07/26 04:03:23 remm Exp $
  + * $Revision: 1.5 $
  + * $Date: 2001/07/26 04:03:23 $
*
* 
*
  @@ -78,5 +78,8 @@
   public static final String ServerInfo =
   Globals.SERVER_INFO +  (HTTP/1.1 Connector);
   public static final int DEFAULT_CONNECTION_TIMEOUT = 6;
  +
  +public static final int PROCESSOR_IDLE = 0;
  +public static final int PROCESSOR_ACTIVE = 1;
   
   }
  
  
  
  1.33  +29 -9 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java
  
  Index: HttpProcessor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- HttpProcessor.java2001/07/22 20:25:07 1.32
  +++ HttpProcessor.java2001/07/26 04:03:23 1.33
  @@ -1,6 +1,6 @@
  -/* * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.32 2001/07/22 20:25:07 pier Exp $
  - * $Revision: 1.32 $
  - * $Date: 2001/07/22 20:25:07 $
  +/* * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.33 2001/07/26 04:03:23 remm Exp $
  + * $Revision: 1.33 $
  + * $Date: 2001/07/26 04:03:23 $
*
* 
*
  @@ -106,7 +106,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.32 $ $Date: 2001/07/22 20:25:07 $
  + * @version $Revision: 1.33 $ $Date: 2001/07/26 04:03:23 $
*/
   
   final class HttpProcessor
  @@ -311,6 +311,12 @@
   private HttpRequestLine requestLine = new HttpRequestLine();
   
   
  +/**
  + * Processor state
  + */
  +private int status = Constants.PROCESSOR_IDLE;
  +
  +
   // - Public Methods
   
   
  @@ -686,6 +692,11 @@
   
   // Parse the incoming request line
   input.readRequestLine(requestLine);
  +
  +// When the previous method returns, we're actually processing a 
  +// request
  +status = Constants.PROCESSOR_ACTIVE;
  +
   String method =
   new String(requestLine.method, 0, requestLine.methodEnd);
   String uri = null;
  @@ -1022,10 +1033,15 @@
   keepAlive = false;
   }
   
  +// End of request processing
  +status = Constants.PROCESSOR_IDLE;
  +
   // Recycling the request and the response objects
   request.recycle();
   response.recycle();
   
  +ok = !stopped;
  +
   }
   
   try {
  @@ -1112,11 +1128,15 @@
   
   stopped = true;
   assign(null);
  -synchronized (threadSync) {
  -try {
  -threadSync.wait(5000);
  -} catch (InterruptedException e) {
  -;
  +
  +if (status != Constants.PROCESSOR_IDLE) {
  +// Only wait if the processor is actually processing a command
  +synchronized (threadSync) {
  +try {
  +threadSync.wait(5000);
  +} catch (InterruptedException e

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpProcessor.java

2001-07-25 Thread remm

remm01/07/25 22:31:05

  Modified:catalina/src/share/org/apache/catalina/connector/http
HttpProcessor.java
  Log:
  - Fix an obvious problem with the latest patch, where the value of was overridden,
which caused a loop once the client disconnected.
  
  Revision  ChangesPath
  1.34  +5 -7  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java
  
  Index: HttpProcessor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- HttpProcessor.java2001/07/26 04:03:23 1.33
  +++ HttpProcessor.java2001/07/26 05:31:05 1.34
  @@ -1,6 +1,6 @@
  -/* * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.33 2001/07/26 04:03:23 remm Exp $
  - * $Revision: 1.33 $
  - * $Date: 2001/07/26 04:03:23 $
  +/* * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.34 2001/07/26 05:31:05 remm Exp $
  + * $Revision: 1.34 $
  + * $Date: 2001/07/26 05:31:05 $
*
* 
*
  @@ -106,7 +106,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.33 $ $Date: 2001/07/26 04:03:23 $
  + * @version $Revision: 1.34 $ $Date: 2001/07/26 05:31:05 $
*/
   
   final class HttpProcessor
  @@ -923,7 +923,7 @@
   
   keepAlive = true;
   
  -while (ok  keepAlive) {
  +while (!stopped  ok  keepAlive) {
   
   try {
   request.setStream(input);
  @@ -1039,8 +1039,6 @@
   // Recycling the request and the response objects
   request.recycle();
   response.recycle();
  -
  -ok = !stopped;
   
   }
   
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappClassLoader.java

2001-07-30 Thread remm

remm01/07/30 17:30:28

  Modified:catalina/src/share/org/apache/catalina/loader
WebappClassLoader.java
  Log:
  - The system policy file is now refreshed in the CL constructor, since it's more
likely to succeed here (in getPermissions, it could end up failing a check
on SecurityPermission getPolicy). An alternatie would be to wrap inside a
PA, but that change should allow it to work without a PA.
  - If Policy.getPolicy fails, the access control exception is caught and ignored, 
since
the policy reloading feature is optional, and shouldn't break things.
  
  Revision  ChangesPath
  1.12  +31 -16
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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- WebappClassLoader.java2001/07/22 21:23:17 1.11
  +++ WebappClassLoader.java2001/07/31 00:30:28 1.12
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
 1.11 2001/07/22 21:23:17 remm Exp $
  - * $Revision: 1.11 $
  - * $Date: 2001/07/22 21:23:17 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
 1.12 2001/07/31 00:30:28 remm Exp $
  + * $Revision: 1.12 $
  + * $Date: 2001/07/31 00:30:28 $
*
* 
*
  @@ -123,7 +123,7 @@
*
* @author Remy Maucherat
* @author Craig R. McClanahan
  - * @version $Revision: 1.11 $ $Date: 2001/07/22 21:23:17 $
  + * @version $Revision: 1.12 $ $Date: 2001/07/31 00:30:28 $
*/
   public class WebappClassLoader
   extends URLClassLoader
  @@ -162,6 +162,10 @@
   system = getSystemClassLoader();
   securityManager = System.getSecurityManager();
   
  +if (securityManager != null) {
  +refreshPolicy();
  +}
  +
   }
   
   
  @@ -177,6 +181,10 @@
   system = getSystemClassLoader();
   securityManager = System.getSecurityManager();
   
  +if (securityManager != null) {
  +refreshPolicy();
  +}
  +
   }
   
   
  @@ -315,12 +323,6 @@
   
   
   /**
  - * Flag that the security policy has been refreshed from file.
  - */
  -private boolean policy_refresh = false;
  -
  -
  -/**
* The parent class loader.
*/
   private ClassLoader parent = null;
  @@ -1276,12 +1278,6 @@
*/
   protected PermissionCollection getPermissions(CodeSource codeSource) {
   
  -if (!policy_refresh) {
  -// Refresh the security policies
  -Policy policy = Policy.getPolicy();
  -policy.refresh();
  -policy_refresh = true;
  -}
   String codeUrl = codeSource.getLocation().toString();
   PermissionCollection pc;
   if ((pc = (PermissionCollection)loaderPC.get(codeUrl)) == null) {
  @@ -1702,6 +1698,25 @@
   return entry.loadedClass;
   }
   return (null);  // FIXME - findLoadedResource()
  +
  +}
  +
  +
  +/**
  + * Refresh the system policy file, to pick up eventual changes.
  + */
  +protected void refreshPolicy() {
  +
  +try {
  +// The policy file may have been modified to adjust 
  +// permissions, so we're reloading it when loading or 
  +// reloading a Context
  +Policy policy = Policy.getPolicy();
  +policy.refresh();
  +} catch (AccessControlException e) {
  +// Some policy files may restrict this, even for the core,
  +// so this exception is ignored
  +}
   
   }
   
  
  
  



cvs commit: jakarta-tomcat-4.0 build.xml

2001-07-30 Thread remm

remm01/07/30 22:57:37

  Modified:.build.xml
  Log:
  - The installer allows to install the source, so the installer target
depends on dist-source.
  
  Revision  ChangesPath
  1.34  +1 -1  jakarta-tomcat-4.0/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/build.xml,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- build.xml 2001/07/28 22:47:10 1.33
  +++ build.xml 2001/07/31 05:57:37 1.34
  @@ -187,7 +187,7 @@
   
   
 !-- = DIST: Create Windows Installer === --
  -  target name=installer depends=dist
  +  target name=installer depends=dist, dist-source
   echo message=Builds a Windows installer based on Nullsoft Installer/
   echo message=NSIS must be installed in the default directory/
   copy todir=${tomcat.dist}
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves AccessLogValve.java Constants.java

2001-08-06 Thread remm

remm01/08/06 12:21:55

  Modified:catalina/src/share/org/apache/catalina/valves
AccessLogValve.java Constants.java
  Log:
  - Add a new combined mode for logging (logs the referer as well as the user-agent).
  - New alias name for the patterm (combined).
  - Patch submitted by Michael Smith msmith at speedlegal.com.
  
  Revision  ChangesPath
  1.9   +40 -2 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/AccessLogValve.java
  
  Index: AccessLogValve.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/AccessLogValve.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AccessLogValve.java   2001/07/24 23:21:09 1.8
  +++ AccessLogValve.java   2001/08/06 19:21:55 1.9
  @@ -119,6 +119,8 @@
* commonly utilized patterns:/p
* ul
* libcommon/b - code%h %l %u %t %r %s %b/code
  + * libcombined/b - 
  + *   code%h %l %u %t %r %s %b %{Referer}i %{User-Agent}i/code
* /ul
*
* pbFIXME/b - Improve the parsing so that things like
  @@ -126,7 +128,7 @@
*
* @author Craig R. McClanahan
* @author Jason Brittain
  - * @version $Revision: 1.8 $ $Date: 2001/07/24 23:21:09 $
  + * @version $Revision: 1.9 $ $Date: 2001/08/06 19:21:55 $
*/
   
   public final class AccessLogValve
  @@ -195,6 +197,13 @@
   
   
   /**
  + * For the combined format (common, plus useragent and referer), we do
  + * the same
  + */
  +private boolean combined = false;
  +
  +
  +/**
* The pattern used to format our access log lines.
*/
   private String pattern = null;
  @@ -347,6 +356,8 @@
   pattern = ;
   if (pattern.equals(Constants.AccessLog.COMMON_ALIAS))
   pattern = Constants.AccessLog.COMMON_PATTERN;
  +if (pattern.equals(Constants.AccessLog.COMBINED_ALIAS))
  +pattern = Constants.AccessLog.COMBINED_PATTERN;
   this.pattern = pattern;
   
   if (this.pattern.equals(Constants.AccessLog.COMMON_PATTERN))
  @@ -354,6 +365,11 @@
   else
   common = false;
   
  +if (this.pattern.equals(Constants.AccessLog.COMBINED_PATTERN))
  +combined = true;
  +else
  +combined = false;
  +
   }
   
   
  @@ -449,7 +465,7 @@
   StringBuffer result = new StringBuffer();
   
   // Check to see if we should log using the common access log pattern
  -if (common) {
  +if (common || combined) {
   String value = null;
   
   ServletRequest req = request.getRequest();
  @@ -501,11 +517,33 @@
   result.append(space);
   
   int length = response.getContentCount();
  +
   if (length = 0)
   value = -;
   else
   value =  + length;
   result.append(value);
  +
  +if (combined) {
  +result.append(space);
  +result.append(\);
  +String referer = hreq.getHeader(referer);
  +if(referer != null)
  +result.append(referer);
  +else
  +result.append(-);
  +result.append(\);
  +
  +result.append(space);
  +result.append(\);
  +String ua = hreq.getHeader(user-agent);
  +if(ua != null)
  +result.append(ua);
  +else
  +result.append(-);
  +result.append(\);
  +}
  +
   } else {
   // Generate a message based on the defined pattern
   boolean replace = false;
  
  
  
  1.3   +2 -0  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/Constants.java
  
  Index: Constants.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/Constants.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Constants.java2001/07/22 20:25:15 1.2
  +++ Constants.java2001/08/06 19:21:55 1.3
  @@ -76,6 +76,8 @@
   public static final class AccessLog {
   public static final String COMMON_ALIAS = common;
   public static final String COMMON_PATTERN = %h %l %u %t \%r\ %s %b;
  +public static final String COMBINED_ALIAS = combined;
  +public static final String COMBINED_PATTERN = %h %l %u %t \%r\ %s %b 
\%{Referer}i\ \%{User-Agent}i\;
   }
   
   }
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core ApplicationDispatcher.java

2001-08-07 Thread remm

remm01/08/07 17:32:02

  Modified:catalina/src/share/org/apache/catalina/core
ApplicationDispatcher.java
  Log:
  - Cross contexts include and forwards were broken because the context
class loader wasn't appropriately set. Now, check if the current context class
loader is the same as the one in the Catalina Context's loader. If it's not, the
old context class loader value is saved, the Catalina Context class loader is
set as the context class loader, and after the wrapper has been allocated
and invoked, the old context class loader value is restored.
Bug reported by Serge Huber shuber at xo3.com.
  
  Revision  ChangesPath
  1.25  +20 -5 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java
  
  Index: ApplicationDispatcher.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- ApplicationDispatcher.java2001/08/01 03:04:04 1.24
  +++ ApplicationDispatcher.java2001/08/08 00:31:54 1.25
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java,v
 1.24 2001/08/01 03:04:04 craigmcc Exp $
  - * $Revision: 1.24 $
  - * $Date: 2001/08/01 03:04:04 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java,v
 1.25 2001/08/08 00:31:54 remm Exp $
  + * $Revision: 1.25 $
  + * $Date: 2001/08/08 00:31:54 $
*
* 
*
  @@ -108,7 +108,7 @@
* codejavax.servlet.ServletResponseWrapper/code.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.24 $ $Date: 2001/08/01 03:04:04 $
  + * @version $Revision: 1.25 $ $Date: 2001/08/08 00:31:54 $
*/
   
   final class ApplicationDispatcher
  @@ -337,7 +337,6 @@
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet exception occurs
*/
  -
   public void forward(ServletRequest request, ServletResponse response)
   throws ServletException, IOException
   {
  @@ -591,6 +590,18 @@
   private void invoke(ServletRequest request, ServletResponse response)
   throws IOException, ServletException {
   
  +// Checking to see if the context classloader is the current context
  +// classloader. If it's not, we're saving it, and setting the context
  +// classloader to the Context classloader
  +ClassLoader oldCCL = Thread.currentThread().getContextClassLoader();
  +ClassLoader contextClassLoader = context.getLoader().getClassLoader();
  +
  +if (oldCCL != contextClassLoader) {
  +Thread.currentThread().setContextClassLoader(contextClassLoader);
  +} else {
  +oldCCL = null;
  +}
  +
   // Initialize local variables we may need
   HttpServletRequest hrequest = null;
   if (request instanceof HttpServletRequest)
  @@ -716,6 +727,10 @@
   (sm.getString(applicationDispatcher.deallocateException,
 wrapper.getName()), e);
   }
  +
  +// Reset the old context class loader
  +if (oldCCL != null)
  +Thread.currentThread().setContextClassLoader(oldCCL);
   
   // Rethrow an exception if one was thrown by the invoked servlet
   if (ioException != null)
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http SocketInputStream.java

2001-08-08 Thread remm

remm01/08/08 13:02:17

  Modified:catalina/src/share/org/apache/catalina/connector/http
SocketInputStream.java
  Log:
  - A HT (tab) is also considered a leading white space. It was a bit hidden in the
HTTP spec, so I had missed it.
  
  Revision  ChangesPath
  1.9   +15 -6 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/SocketInputStream.java
  
  Index: SocketInputStream.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/SocketInputStream.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SocketInputStream.java2001/07/22 20:25:07 1.8
  +++ SocketInputStream.java2001/08/08 20:02:17 1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/SocketInputStream.java,v
 1.8 2001/07/22 20:25:07 pier Exp $
  - * $Revision: 1.8 $
  - * $Date: 2001/07/22 20:25:07 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/SocketInputStream.java,v
 1.9 2001/08/08 20:02:17 remm Exp $
  + * $Revision: 1.9 $
  + * $Date: 2001/08/08 20:02:17 $
*
* 
*
  @@ -100,6 +100,12 @@
   
   
   /**
  + * HT.
  + */
  +private static final byte HT = (byte) '\t';
  +
  +
  +/**
* COLON.
*/
   private static final byte COLON = (byte) ':';
  @@ -440,7 +446,7 @@
   pos = 0;
   readStart = 0;
   }
  -if (buf[pos] == SP) {
  +if ((buf[pos] == SP) || (buf[pos] == HT)) {
   pos++;
   } else {
   space = false;
  @@ -483,8 +489,10 @@
   }
   pos++;
   }
  +
  +int nextChr = read();
   
  -if (read() != SP) {
  +if ((nextChr != SP)  (nextChr != HT)) {
   pos--;
   validLine = false;
   } else {
  @@ -583,8 +591,9 @@
   pos = 0;
   count = 0;
   int nRead = is.read(buf, 0, buf.length);
  -if (nRead  0)
  +if (nRead  0) {
   count = nRead;
  +}
   }
   
   
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets DefaultServlet.java

2001-08-27 Thread remm

remm01/08/27 04:50:41

  Modified:catalina/src/share/org/apache/catalina/servlets
DefaultServlet.java
  Log:
  - A 206 returned an incorrect content length, instead of the actual number of bytes
returned.
Fix for bug 3274.
  
  Revision  ChangesPath
  1.38  +5 -5  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java
  
  Index: DefaultServlet.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- DefaultServlet.java   2001/07/22 20:25:11 1.37
  +++ DefaultServlet.java   2001/08/27 11:50:41 1.38
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
 1.37 2001/07/22 20:25:11 pier Exp $
  - * $Revision: 1.37 $
  - * $Date: 2001/07/22 20:25:11 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
 1.38 2001/08/27 11:50:41 remm Exp $
  + * $Revision: 1.38 $
  + * $Date: 2001/08/27 11:50:41 $
*
* 
*
  @@ -122,7 +122,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.37 $ $Date: 2001/07/22 20:25:11 $
  + * @version $Revision: 1.38 $ $Date: 2001/08/27 11:50:41 $
*/
   
   public class DefaultServlet
  @@ -1206,7 +1206,7 @@
  + range.start
  + - + range.end + /
  + range.length);
  -response.setContentLength((int) range.length);
  +response.setContentLength((int) (range.end - range.start));
   
   if (contentType != null) {
   if (debug  0)
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappClassLoader.java

2001-08-28 Thread remm

remm01/08/28 11:12:37

  Modified:catalina/src/share/org/apache/catalina/loader
WebappClassLoader.java
  Log:
  - Sync before calling defineClass. Appears to fix bug 3107, and should also
help similar CL problems where two threads simultaneously try to load the same
class.
  
  Revision  ChangesPath
  1.13  +8 -6  
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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- WebappClassLoader.java2001/07/31 00:30:28 1.12
  +++ WebappClassLoader.java2001/08/28 18:12:37 1.13
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
 1.12 2001/07/31 00:30:28 remm Exp $
  - * $Revision: 1.12 $
  - * $Date: 2001/07/31 00:30:28 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
 1.13 2001/08/28 18:12:37 remm Exp $
  + * $Revision: 1.13 $
  + * $Date: 2001/08/28 18:12:37 $
*
* 
*
  @@ -123,7 +123,7 @@
*
* @author Remy Maucherat
* @author Craig R. McClanahan
  - * @version $Revision: 1.12 $ $Date: 2001/07/31 00:30:28 $
  + * @version $Revision: 1.13 $ $Date: 2001/08/28 18:12:37 $
*/
   public class WebappClassLoader
   extends URLClassLoader
  @@ -1481,8 +1481,10 @@
   
   }
   
  -clazz = defineClass(name, entry.binaryContent, 0,
  -entry.binaryContent.length, codeSource);
  +synchronized(this) {
  +clazz = defineClass(name, entry.binaryContent, 0,
  +entry.binaryContent.length, codeSource);
  +}
   
   entry.loadedClass = clazz;
   
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup Bootstrap.java

2001-08-28 Thread remm

remm01/08/28 18:27:37

  Modified:catalina/src/share/org/apache/catalina/startup
Bootstrap.java
  Log:
  - If it does not exist, the value of catalina.home should also be the value
of user.dir.
  
  Revision  ChangesPath
  1.24  +19 -14
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Bootstrap.java
  
  Index: Bootstrap.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Bootstrap.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Bootstrap.java2001/08/15 00:55:25 1.23
  +++ Bootstrap.java2001/08/29 01:27:36 1.24
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Bootstrap.java,v
 1.23 2001/08/15 00:55:25 craigmcc Exp $
  - * $Revision: 1.23 $
  - * $Date: 2001/08/15 00:55:25 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Bootstrap.java,v
 1.24 2001/08/29 01:27:36 remm Exp $
  + * $Revision: 1.24 $
  + * $Date: 2001/08/29 01:27:36 $
*
* 
*
  @@ -85,7 +85,7 @@
* class path and therefore not visible to application level classes.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.23 $ $Date: 2001/08/15 00:55:25 $
  + * @version $Revision: 1.24 $ $Date: 2001/08/29 01:27:36 $
*/
   
   public final class Bootstrap {
  @@ -237,7 +237,7 @@
   ArrayList list = new ArrayList();
   
   // Add the common/classes directory if it exists
  -File classes = new File(System.getProperty(catalina.home),
  +File classes = new File(getCatalinaHome(),
   common + File.separator + classes);
   if (classes.exists()  classes.canRead() 
   classes.isDirectory()) {
  @@ -256,8 +256,7 @@
   }
   
   // Add all JAR files in the common/lib directory if it exists
  -File directory = new File(System.getProperty(catalina.home),
  -  common/lib);
  +File directory = new File(getCatalinaHome(), common/lib);
   if (!directory.exists() || !directory.canRead() ||
   !directory.isDirectory()) {
   System.out.println(Directory  + directory.getAbsolutePath()
  @@ -313,7 +312,7 @@
   ArrayList list = new ArrayList();
   
   // Add the server/classes directory if it exists
  -File classes = new File(System.getProperty(catalina.home),
  +File classes = new File(getCatalinaHome(),
   server + File.separator + classes);
   if (classes.exists()  classes.canRead() 
   classes.isDirectory()) {
  @@ -332,8 +331,7 @@
   }
   
   // Add all JAR files in the server/lib directory if it exists
  -File directory = new File(System.getProperty(catalina.home),
  -  server/lib);
  +File directory = new File(getCatalinaHome(), server/lib);
   if (!directory.exists() || !directory.canRead() ||
   !directory.isDirectory()) {
   System.out.println(Directory  + directory.getAbsolutePath()
  @@ -387,8 +385,7 @@
   ArrayList list = new ArrayList();
   
   // Add the classes directory if it exists
  -File classes = new File(System.getProperty(catalina.home),
  -classes);
  +File classes = new File(getCatalinaHome(), classes);
   if (classes.exists()  classes.canRead() 
   classes.isDirectory()) {
   try {
  @@ -406,8 +403,7 @@
   }
   
   // Add all JAR files in the lib directory if it exists
  -File directory = new File(System.getProperty(catalina.home),
  -  lib);
  +File directory = new File(getCatalinaHome(), lib);
   if (!directory.exists() || !directory.canRead() ||
   !directory.isDirectory()) {
   System.out.println(Directory  + directory.getAbsolutePath()
  @@ -453,6 +449,15 @@
   
   return (loader);
   
  +}
  +
  +
  +/**
  + * Get the value of the catalina.home environment variable.
  + */
  +private static String getCatalinaHome() {
  +return System.getProperty(catalina.home,
  +  System.getProperty(user.dir));
   }
   
   
  
  
  



cvs commit: jakarta-tomcat-4.0 tomcat.nsi

2001-08-28 Thread remm

remm01/08/28 18:28:50

  Modified:.tomcat.nsi
  Log:
  - Use user.dir property to specify the Catalina path, instead of catalina.home.
  
  Revision  ChangesPath
  1.13  +4 -4  jakarta-tomcat-4.0/tomcat.nsi
  
  Index: tomcat.nsi
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/tomcat.nsi,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- tomcat.nsi2001/07/18 23:14:03 1.12
  +++ tomcat.nsi2001/08/29 01:28:50 1.13
  @@ -1,6 +1,6 @@
   
   ; Tomcat 4 script for Nullsoft Installer
  -; $Id: tomcat.nsi,v 1.12 2001/07/18 23:14:03 remm Exp $
  +; $Id: tomcat.nsi,v 1.13 2001/08/29 01:28:50 remm Exp $
   
   Name jakarta-tomcat-4.0
   Caption Jakarta Tomcat 4.0
  @@ -69,7 +69,7 @@
 SetOutPath $INSTDIR\bin
 File /oname=tomcat.exe bin\tomcat.exe
 
  -  ExecWait '$INSTDIR\bin\tomcat.exe -install Jakarta Tomcat 
$2\jre\bin\hotspot\jvm.dll -Djava.class.path=$INSTDIR\bin\bootstrap.jar 
-Dcatalina.home=$INSTDIR -start org.apache.catalina.startup.BootstrapService -params 
start -stop org.apache.catalina.startup.BootstrapService -params stop -out 
$INSTDIR\logs\stdout.log -err $INSTDIR\logs\stderr.log'
  +  ExecWait '$INSTDIR\bin\tomcat.exe -install Jakarta Tomcat 
$2\jre\bin\hotspot\jvm.dll -Djava.class.path=$INSTDIR\bin\bootstrap.jar 
-Duser.dir=$INSTDIR -start org.apache.catalina.startup.BootstrapService -params 
start -stop org.apache.catalina.startup.BootstrapService -params stop -out 
$INSTDIR\logs\stdout.log -err $INSTDIR\logs\stderr.log'
 
 ClearErrors
   
  @@ -114,12 +114,12 @@
   
 CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Start Tomcat.lnk \
$2\bin\java.exe \
  - '-jar -Dcatalina.home=$INSTDIR $INSTDIR\bin\bootstrap.jar 
start' \
  + '-jar -Duser.dir=$INSTDIR $INSTDIR\bin\bootstrap.jar start' \
$INSTDIR\tomcat.ico 0 SW_SHOWNORMAL
   
 CreateShortCut $SMPROGRAMS\Jakarta Tomcat 4.0\Stop Tomcat.lnk \
$2\bin\java.exe \
  - '-jar -Dcatalina.home=$INSTDIR $INSTDIR\bin\bootstrap.jar 
stop' \
  + '-jar -Duser.dir=$INSTDIR $INSTDIR\bin\bootstrap.jar stop' \
$INSTDIR\tomcat.ico 0 SW_SHOWMINIMIZED
   
 SetOutPath $SMPROGRAMS\Jakarta Tomcat 4.0\Configuration
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpConnector.java

2001-08-28 Thread remm

remm01/08/28 18:44:07

  Modified:catalina/src/share/org/apache/catalina/connector/http
HttpConnector.java
  Log:
  - Fix race conditions during HTTP connector shutdown.
Patch submitted by Michael Newman newman at mindless.com
  
  Revision  ChangesPath
  1.23  +53 -52
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java
  
  Index: HttpConnector.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- HttpConnector.java2001/08/23 22:32:10 1.22
  +++ HttpConnector.java2001/08/29 01:44:07 1.23
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
 1.22 2001/08/23 22:32:10 craigmcc Exp $
  - * $Revision: 1.22 $
  - * $Date: 2001/08/23 22:32:10 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
 1.23 2001/08/29 01:44:07 remm Exp $
  + * $Revision: 1.23 $
  + * $Date: 2001/08/29 01:44:07 $
*
* 
*
  @@ -96,7 +96,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.22 $ $Date: 2001/08/23 22:32:10 $
  + * @version $Revision: 1.23 $ $Date: 2001/08/29 01:44:07 $
*/
   
   
  @@ -108,6 +108,12 @@
   
   
   /**
  + * The codeService/code we are associated with (if any).
  + */
  +private Service service = null;
  +
  +
  +/**
* The accept count for this Connector.
*/
   private int acceptCount = 10;
  @@ -252,12 +258,6 @@
   
   
   /**
  - * The codeService/code we are associated with (if any).
  - */
  -private Service service = null;
  -
  -
  -/**
* The string manager for this package.
*/
   private StringManager sm =
  @@ -316,6 +316,28 @@
   
   
   /**
  + * Return the codeService/code with which we are associated (if any).
  + */
  +public Service getService() {
  +
  +return (this.service);
  +
  +}
  +
  +
  +/**
  + * Set the codeService/code with which we are associated (if any).
  + *
  + * @param service The service that owns this Engine
  + */
  +public void setService(Service service) {
  +
  +this.service = service;
  +
  +}
  +
  +
  +/**
* Return the connection timeout for this Connector.
*/
   public int getConnectionTimeout() {
  @@ -733,28 +755,6 @@
   
   
   /**
  - * Return the codeService/code with which we are associated (if any).
  - */
  -public Service getService() {
  -
  -return (this.service);
  -
  -}
  -
  -
  -/**
  - * Set the codeService/code with which we are associated (if any).
  - *
  - * @param service The service that owns this Engine
  - */
  -public void setService(Service service) {
  -
  -this.service = service;
  -
  -}
  -
  -
  -/**
* Return the TCP no delay flag value.
*/
   public boolean getTcpNoDelay() {
  @@ -982,16 +982,18 @@
   } catch (IOException e) {
   //if (debug = 3)
   //log(run: Accept returned IOException, e);
  -if (started  !stopped)
  -log(accept: , e);
   try {
  -//if (debug = 3)
  -//log(run: Closing server socket);
  -serverSocket.close();
  -if (!stopped) {
  -//if (debug = 3)
  -//log(run: Reopening server 
socket);
  -serverSocket = open();
  +synchronized (threadSync) {
  +if (started  !stopped)
  +log(accept: , e);
  +if (!stopped) {
  +//if (debug = 3)
  +//log(run: Closing server 
socket);
  +serverSocket.close();
  +//if (debug = 3)
  +//log(run: Reopening 
server socket);
  +serverSocket = open();
  +}
   }
   //if (debug = 3)
   //log(run: IOException processing 
completed);
  @@ -1054,12 +1056,10

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory BeanFactory.java

2001-09-01 Thread remm

remm01/09/01 18:17:47

  Added:   catalina/src/share/org/apache/naming/factory
BeanFactory.java
  Log:
  - Add new resource factory for resource objects conforming to the JavaBean
component model. This resource factory is fully generic.
  - More specifically the class of the resource to be instanciated must :
- have a public default constructor
- have all its important properties be of simple types
  - See the (very straightforward) example in the Javadoc for more details.
  - Thanks to Aner Perez aner at ncstech.com for contributing this code.
  
  Revision  ChangesPath
  1.1  
jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/BeanFactory.java
  
  Index: BeanFactory.java
  ===
  /*
   * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/BeanFactory.java,v
 1.1 2001/09/02 01:17:47 remm Exp $
   * $Revision: 1.1 $
   * $Date: 2001/09/02 01:17:47 $
   *
   * 
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *notice, this list of conditions and the following disclaimer in
   *the documentation and/or other materials provided with the
   *distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *any, must include the following acknowlegement:
   *   This product includes software developed by the
   *Apache Software Foundation (http://www.apache.org/).
   *Alternately, this acknowlegement may appear in the software itself,
   *if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names The Jakarta Project, Tomcat, and Apache Software
   *Foundation must not be used to endorse or promote products derived
   *from this software without prior written permission. For written
   *permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called Apache
   *nor may Apache appear in their names without prior written
   *permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * 
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * http://www.apache.org/.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */
  
  package org.apache.naming.factory;
  
  import java.util.Hashtable;
  import java.util.Enumeration;
  import javax.naming.Name;
  import javax.naming.Context;
  import javax.naming.NamingException;
  import javax.naming.Reference;
  import javax.naming.RefAddr;
  import javax.naming.spi.ObjectFactory;
  import org.apache.naming.ResourceRef;
  
  import java.beans.Introspector;
  import java.beans.BeanInfo;
  import java.beans.PropertyDescriptor;
  
  import java.lang.reflect.Method;
  
  /**
   * Object factory for any Resource conforming to the JavaBean spec.
   * 
   * pThis factory can be configured in a codelt;DefaultContextgt;/code
   * or codelt;Contextgt;/code element in your codeconf/server.xml/code
   * configuration file.  An example of factory configuration is:/p
   * pre
   * lt;Resource name=jdbc/myDataSource auth=SERVLET
   *   type=oracle.jdbc.pool.OracleConnectionCacheImpl/gt;
   * lt;ResourceParams name=jdbc/myDataSourcegt;
   *   lt;parametergt;
   * lt;namegt;factorylt;/namegt;
   * lt;valuegt;org.apache.naming.factory.BeanFactorylt;/valuegt;
   *   lt;/parametergt;
   *   lt

cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler ParserController.java

2001-09-02 Thread remm

remm01/09/02 20:34:08

  Modified:jasper/src/share/org/apache/jasper/compiler
ParserController.java
  Log:
  - Fix (again) bug 821.
  
  Revision  ChangesPath
  1.17  +4 -4  
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/ParserController.java
  
  Index: ParserController.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/ParserController.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ParserController.java 2001/07/10 20:12:07 1.16
  +++ ParserController.java 2001/09/03 03:34:08 1.17
  @@ -413,10 +413,10 @@
* baseDirStack.
*/
   private String resolveFileName(String inFileName) {
  -boolean isAbsolute = inFileName.startsWith(/);
  - String fileName = 
  - isAbsolute ?
  - inFileName : (String) baseDirStack.peek() + inFileName;
  +String fileName = inFileName.replace('\\', '/');
  +boolean isAbsolute = fileName.startsWith(/);
  + fileName = isAbsolute ? fileName 
  +: (String) baseDirStack.peek() + fileName;
String baseDir = 
fileName.substring(0, fileName.lastIndexOf(/) + 1);
baseDirStack.push(baseDir);
  
  
  



<    1   2   3   4   5   6   7   8   9   10   >