cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2004-03-09 Thread billbarker
billbarker2004/03/09 07:22:11

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Updating version to 3.3.3-dev.
  
  Revision  ChangesPath
  1.209 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.208
  retrieving revision 1.209
  diff -u -r1.208 -r1.209
  --- ContextManager.java   6 Mar 2004 15:44:37 -   1.208
  +++ ContextManager.java   9 Mar 2004 15:22:11 -   1.209
  @@ -105,7 +105,7 @@
   public class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = 3.3.2 Final;
  +public static final String TOMCAT_VERSION = 3.3.3 - Dev;
   public static final String TOMCAT_NAME = Tomcat Web Server;
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2004-03-06 Thread larryi
larryi  2004/03/06 07:44:37

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Update release name
  
  Revision  ChangesPath
  1.208 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.207
  retrieving revision 1.208
  diff -u -r1.207 -r1.208
  --- ContextManager.java   25 Feb 2004 06:45:07 -  1.207
  +++ ContextManager.java   6 Mar 2004 15:44:37 -   1.208
  @@ -105,7 +105,7 @@
   public class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = 3.3.2 Release Candidate 1;
  +public static final String TOMCAT_VERSION = 3.3.2 Final;
   public static final String TOMCAT_NAME = Tomcat Web Server;
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2004-02-21 Thread larryi
larryi  2004/02/21 07:13:05

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Update version
  
  Revision  ChangesPath
  1.206 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.205
  retrieving revision 1.206
  diff -u -r1.205 -r1.206
  --- ContextManager.java   28 Mar 2002 02:27:01 -  1.205
  +++ ContextManager.java   21 Feb 2004 15:13:05 -  1.206
  @@ -148,7 +148,7 @@
   public class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = 3.3.2 Dev;
  +public static final String TOMCAT_VERSION = 3.3.2 Release Candidate 1;
   public static final String TOMCAT_NAME = Tomcat Web Server;
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2003-07-01 Thread marcsaeg
marcsaeg2003/07/01 13:59:58

  Modified:src/share/org/apache/tomcat/core Tag: tomcat_32
ContextManager.java
  Log:
  Check for debug  0 before printing debug messages.
  Catch SocketException to avoid sending data down a closed connection.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.100.2.28 +17 -9 
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.100.2.27
  retrieving revision 1.100.2.28
  diff -u -r1.100.2.27 -r1.100.2.28
  --- ContextManager.java   5 Oct 2001 18:12:33 -   1.100.2.27
  +++ ContextManager.java   1 Jul 2003 20:59:57 -   1.100.2.28
  @@ -567,7 +567,8 @@
}
   
String vhost=ctx.getHost();
  - logInt(Adding context  +  ctx.toString());
  + if(debug0)
  +logInt(Adding context  +  ctx.toString());
   
// XXX temporary workaround for the old SimpleMapper -
// This code will be removed as soon as the new mapper is stable.
  @@ -581,7 +582,8 @@
   public void removeContext( Context context ) throws TomcatException {
if( context==null ) return;
   
  - logInt( Removing context  + context.toString());
  + if(debug0)
  +logInt( Removing context  + context.toString());
   
ContextInterceptor cI[]=getContextInterceptors();
for( int i=0; i cI.length; i++ ) {
  @@ -1038,8 +1040,8 @@
// XXX this log was intended to debug the status code generation.
// it can be removed for all cases.
if( code != 302  code != 401 )
  - ctx.log( code ++ req +   +
  -  req.getAttribute(javax.servlet.error.message));
  + if(debug0)
  +ctx.log( code ++ req +   + 
req.getAttribute(javax.servlet.error.message));
   
errorPath = ctx.getErrorPage( code );
if( errorPath != null ) {
  @@ -1098,7 +1100,14 @@
Note that it is _WRONG_ to send the trace back to
the client. AFAIK the trace is the _best_ debugger.
*/
  - if (t instanceof UnavailableException) {
  +if( t instanceof SocketException ) {
  +/*
  + * There's nothing we can do in this case because the connection 
  + * with the client is already gone.   MAS 1/14/03
  + */
  +ctx.log(SocketException in:  + req ++ t.getMessage());
  +return;
  +}else if (t instanceof UnavailableException) {
int unavailableTime = -1;
if ( !((UnavailableException)t).isPermanent() ) {
unavailableTime = ((UnavailableException)t).getUnavailableSeconds();
  @@ -1115,16 +1124,15 @@
res.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE); // 503
handleStatus( req, res, HttpServletResponse.SC_SERVICE_UNAVAILABLE );
return;
  - }
  - else if( t instanceof IllegalStateException ) {
  + } else if( t instanceof IllegalStateException ) {
ctx.log(IllegalStateException in:  + req  +   +
t.getMessage() );
} else if( t instanceof org.apache.jasper.JasperException ) {
ctx.log(JasperException:  + req ++ t.getMessage());
} else if( t instanceof IOException ) {
if ( Broken pipe.equals(t.getMessage()))
  - return;
  - ctx.log(IOException in:  + req ++ t.getMessage());
  +return;
  +ctx.log(IOException in:  + req ++ t.getMessage());
} else {
ctx.log(Exception in:  + req , t );
}
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2002-03-27 Thread larryi

larryi  02/03/27 18:27:02

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Update version
  
  Revision  ChangesPath
  1.205 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.204
  retrieving revision 1.205
  diff -u -r1.204 -r1.205
  --- ContextManager.java   23 Mar 2002 03:08:24 -  1.204
  +++ ContextManager.java   28 Mar 2002 02:27:01 -  1.205
  @@ -148,7 +148,7 @@
   public class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = 3.3.1 Final;
  +public static final String TOMCAT_VERSION = 3.3.2 Dev;
   public static final String TOMCAT_NAME = Tomcat Web Server;
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2002-03-22 Thread larryi

larryi  02/03/22 19:08:24

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Update for 3.3.1 Final
  
  Revision  ChangesPath
  1.204 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.203
  retrieving revision 1.204
  diff -u -r1.203 -r1.204
  --- ContextManager.java   5 Mar 2002 16:42:26 -   1.203
  +++ ContextManager.java   23 Mar 2002 03:08:24 -  1.204
  @@ -148,7 +148,7 @@
   public class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = 3.3.1 Dev;
  +public static final String TOMCAT_VERSION = 3.3.1 Final;
   public static final String TOMCAT_NAME = Tomcat Web Server;
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2002-02-28 Thread larryi

larryi  02/02/28 17:34:22

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Update for 3.3.1-rc1
  
  Revision  ChangesPath
  1.202 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.201
  retrieving revision 1.202
  diff -u -r1.201 -r1.202
  --- ContextManager.java   14 Feb 2002 14:23:43 -  1.201
  +++ ContextManager.java   1 Mar 2002 01:34:21 -   1.202
  @@ -148,7 +148,7 @@
   public class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = 3.3.1 Dev;
  +public static final String TOMCAT_VERSION = 3.3.1 Release Candidate 1;
   public static final String TOMCAT_NAME = Tomcat Web Server;
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2002-02-14 Thread larryi

larryi  02/02/14 06:23:44

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Revert to dev status
  
  Revision  ChangesPath
  1.201 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.200
  retrieving revision 1.201
  diff -u -r1.200 -r1.201
  --- ContextManager.java   8 Feb 2002 13:13:32 -   1.200
  +++ ContextManager.java   14 Feb 2002 14:23:43 -  1.201
  @@ -148,7 +148,7 @@
   public class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = 3.3.1 Beta 1;
  +public static final String TOMCAT_VERSION = 3.3.1 Dev;
   public static final String TOMCAT_NAME = Tomcat Web Server;
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2002-02-08 Thread larryi

larryi  02/02/08 05:13:32

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Update the version string for 3.3.1 Beta 1
  
  Revision  ChangesPath
  1.200 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.199
  retrieving revision 1.200
  diff -u -r1.199 -r1.200
  --- ContextManager.java   23 Oct 2001 22:01:23 -  1.199
  +++ ContextManager.java   8 Feb 2002 13:13:32 -   1.200
  @@ -148,7 +148,7 @@
   public class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = 3.3.1 Dev;
  +public static final String TOMCAT_VERSION = 3.3.1 Beta 1;
   public static final String TOMCAT_NAME = Tomcat Web Server;
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-10-23 Thread larryi

larryi  01/10/23 15:01:23

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Update for 3.3.1 development
  
  Revision  ChangesPath
  1.199 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.198
  retrieving revision 1.199
  diff -u -r1.198 -r1.199
  --- ContextManager.java   2001/10/21 17:42:21 1.198
  +++ ContextManager.java   2001/10/23 22:01:23 1.199
  @@ -148,7 +148,7 @@
   public class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = 3.3 Final;
  +public static final String TOMCAT_VERSION = 3.3.1 Dev;
   public static final String TOMCAT_NAME = Tomcat Web Server;
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-10-21 Thread larryi

larryi  01/10/21 10:42:21

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Update for Tomcat 3.3 Final.
  
  Revision  ChangesPath
  1.198 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.197
  retrieving revision 1.198
  diff -u -r1.197 -r1.198
  --- ContextManager.java   2001/10/13 04:24:00 1.197
  +++ ContextManager.java   2001/10/21 17:42:21 1.198
  @@ -148,7 +148,7 @@
   public class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = 3.3 Release Candidate 2;
  +public static final String TOMCAT_VERSION = 3.3 Final;
   public static final String TOMCAT_NAME = Tomcat Web Server;
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-09-02 Thread larryi

larryi  01/09/02 19:20:08

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Update for beta 2.
  
  Revision  ChangesPath
  1.192 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.191
  retrieving revision 1.192
  diff -u -r1.191 -r1.192
  --- ContextManager.java   2001/09/01 00:49:22 1.191
  +++ ContextManager.java   2001/09/03 02:20:08 1.192
  @@ -148,7 +148,7 @@
   public class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = 3.3 Beta 1;
  +public static final String TOMCAT_VERSION = 3.3 Beta 2;
   public static final String TOMCAT_NAME = Tomcat Web Server;
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-08-31 Thread costin

costin  01/08/31 17:49:22

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Make sure contextM is set on newly create session objects.
  
  Revision  ChangesPath
  1.191 +3 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.190
  retrieving revision 1.191
  diff -u -r1.190 -r1.191
  --- ContextManager.java   2001/08/29 05:01:24 1.190
  +++ ContextManager.java   2001/09/01 00:49:22 1.191
  @@ -1255,6 +1255,8 @@
   }
   
   public ServerSession createServerSession() {
  - return new ServerSession();
  + ServerSession ss=new ServerSession();
  + ss.setContextManager( this );
  + return ss;
   }
   }
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java Request.java

2001-08-28 Thread costin

costin  01/08/28 22:01:24

  Modified:src/share/org/apache/tomcat/core ContextManager.java
Request.java
  Log:
  Extra messages and checks.
  
  Revision  ChangesPath
  1.190 +4 -0  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.189
  retrieving revision 1.190
  diff -u -r1.189 -r1.190
  --- ContextManager.java   2001/08/21 04:55:39 1.189
  +++ ContextManager.java   2001/08/29 05:01:24 1.190
  @@ -1090,6 +1090,10 @@
else
ri=req.getContext().getContainer().
getInterceptors( Container.H_handleError );
  + if( ri==null ) {
  + log( handleError with no error handlers  + req +   + req.getContext());
  + return;
  + }
for( int i=0; i ri.length; i++ ) {
status=ri[i].handleError( req, res, t );
if( status!=0 ) return;
  
  
  
  1.110 +5 -0  jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java
  
  Index: Request.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java,v
  retrieving revision 1.109
  retrieving revision 1.110
  diff -u -r1.109 -r1.110
  --- Request.java  2001/08/17 04:02:54 1.109
  +++ Request.java  2001/08/29 05:01:24 1.110
  @@ -72,6 +72,7 @@
   
   import java.security.Principal;
   import java.io.IOException;
  +import java.io.CharConversionException;
   import java.util.Enumeration;
   import java.util.Hashtable;
   
  @@ -430,6 +431,10 @@
handleQueryParameters();
   
params.processParameters( formData, 0, available );
  + } catch(java.io.CharConversionException cex ) {
  + contextM.log(CharConversionException processing parameters: 
  +  + this ++ cex.toString());
  + 
} catch(IOException ex ) {
ex.printStackTrace();
// XXX should we throw exception or log ?
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-08-02 Thread costin

costin  01/08/02 19:45:01

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Add the MODULE_NOTE ( missing - all core entities support notes )
  
  Revision  ChangesPath
  1.187 +1 -0  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.186
  retrieving revision 1.187
  diff -u -r1.186 -r1.187
  --- ContextManager.java   2001/07/27 01:06:23 1.186
  +++ ContextManager.java   2001/08/03 02:45:01 1.187
  @@ -1109,6 +1109,7 @@
   public static final int REQUEST_NOTE=2;
   public static final int HANDLER_NOTE=3;
   public static final int SESSION_NOTE=4;
  +public static final int MODULE_NOTE=5;
   
   public static final int REQ_RE_NOTE=0;
   
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-07-26 Thread costin

costin  01/07/26 18:06:23

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Reset the interceptors, it may have changed.
  
  Display a message when tomcat is in stable state.
  
  Revision  ChangesPath
  1.186 +3 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.185
  retrieving revision 1.186
  diff -u -r1.185 -r1.186
  --- ContextManager.java   2001/07/21 04:04:46 1.185
  +++ ContextManager.java   2001/07/27 01:06:23 1.186
  @@ -541,7 +541,9 @@
   
// The server is configured, all modules are ready
setState(STATE_CONFIG);
  -
  + log(Tomcat configured and in stable state );
  + 
  + existingI=defaultContainer.getInterceptors();
// deal with contexts that were added before init()
// ( by user or modules during engineInit )
   
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-07-20 Thread larryi

larryi  01/07/20 21:04:46

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Set version to Beta 1
  
  Revision  ChangesPath
  1.185 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.184
  retrieving revision 1.185
  diff -u -r1.184 -r1.185
  --- ContextManager.java   2001/07/19 05:55:30 1.184
  +++ ContextManager.java   2001/07/21 04:04:46 1.185
  @@ -148,7 +148,7 @@
   public final class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = 3.3 Milestone 4;
  +public static final String TOMCAT_VERSION = 3.3 Beta 1;
   public static final String TOMCAT_NAME = Tomcat Web Server;
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-07-10 Thread larryi

larryi  01/07/10 22:24:15

  Modified:src/share/org/apache/tomcat/core Tag: tomcat_32
ContextManager.java
  Log:
  Prior patch to fix recursive status handling went too far and broke
  authorization which makes a recursive call to the status handling.
  Modify to report a recursive loop only if recursion occurs with the same
  status code.
  
  Suggested by: Ignacio J. Ortega
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.100.2.25 +5 -3  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.100.2.24
  retrieving revision 1.100.2.25
  diff -u -r1.100.2.24 -r1.100.2.25
  --- ContextManager.java   2001/07/06 18:40:05 1.100.2.24
  +++ ContextManager.java   2001/07/11 05:24:14 1.100.2.25
  @@ -1047,7 +1047,7 @@
if( debug0 )
ctx.log( Handler  + errorServlet +   + errorPath);
   
  -if ( statusLoop( ctx, req ) ){
  +if ( statusLoop( ctx, req, code ) ){
   log( Error loop for  + req +  error code  + code);
   return;
   }
  @@ -1206,8 +1206,10 @@
   
   /** Handle the case of status handler generating an error
*/
  -private boolean statusLoop( Context ctx, Request req ) {
  -if ( req.getAttribute(javax.servlet.error.status_code) != null ) {
  +private boolean statusLoop( Context ctx, Request req, int newCode ) {
  +Integer lastCode = 
(Integer)req.getAttribute(javax.servlet.error.status_code);
  +// If status code repeated, assume recursive loop
  +if ( lastCode != null  lastCode.intValue() == newCode) {
   if( ctx.getDebug()  0 )
   ctx.log( Error: nested error inside status servlet  +
   req.getAttribute(javax.servlet.error.status_code));
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-07-06 Thread larryi

larryi  01/07/06 11:40:08

  Modified:src/share/org/apache/tomcat/core Tag: tomcat_32
ContextManager.java
  Log:
  Fix recursive error handling if web.xml maps error code 404 to a non-existent
  JSP page. With this fix, no response will be sent if status handler is called
  recursively. You will need to examine the log output to see the error.
  
  If web.xml maps error code 404 to a non-existent html, use default not found
  handler instead of default status handler.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.100.2.24 +22 -2 
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.100.2.23
  retrieving revision 1.100.2.24
  diff -u -r1.100.2.23 -r1.100.2.24
  --- ContextManager.java   2001/04/25 16:50:12 1.100.2.23
  +++ ContextManager.java   2001/07/06 18:40:05 1.100.2.24
  @@ -1047,8 +1047,16 @@
if( debug0 )
ctx.log( Handler  + errorServlet +   + errorPath);
   
  - if( errorServlet==null )
  - errorServlet=ctx.getServletByName( tomcat.statusHandler);
  +if ( statusLoop( ctx, req ) ){
  +log( Error loop for  + req +  error code  + code);
  +return;
  +}
  +if( errorServlet==null ) {
  +if( code == 404 )
  +errorServlet=ctx.getServletByName( tomcat.notFoundHandler);
  +else
  +errorServlet=ctx.getServletByName( tomcat.statusHandler);
  +}
   
req.setAttribute(javax.servlet.error.status_code,new Integer( code));
   
  @@ -1194,6 +1202,18 @@
return true;
}
return false;
  +}
  +
  +/** Handle the case of status handler generating an error
  + */
  +private boolean statusLoop( Context ctx, Request req ) {
  +if ( req.getAttribute(javax.servlet.error.status_code) != null ) {
  +if( ctx.getDebug()  0 )
  +ctx.log( Error: nested error inside status servlet  +
  +req.getAttribute(javax.servlet.error.status_code));
  +return true;
  +}
  +return false;
   }
   
 /**
  
  
  



Re: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-07-06 Thread Renato Weiner
 Hi Larry,
Please, ignore my last message.With this change, it fixed the problem. 
Thanks a lot !!
Renato.

 [EMAIL PROTECTED] wrote: 
larryi 01/07/06 11:40:08Modified: src/share/org/apache/tomcat/core Tag: tomcat_32ContextManager.javaLog:Fix recursive error handling if web.xml maps error code 404 to a non-existentJSP page. With this fix, no response will be sent if status handler is calledrecursively. You will need to examine the log output to see the error.If web.xml maps error code 404 to a non-existent html, use default "not found"handler instead of default "status" handler.Revision Changes PathNo revisionNo revision1.100.2.24 +22 -2 jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.javaIndex: ContextManager.java===RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,vretrieving revision 1.100.2.23retrieving revision 1.100.2.24diff -u -r1.100.2.23 -r1.100.2.24--- ContextManager.java 2001/04/25 16:50:12 1.100.2.23+++ ContextManager.java 2001/07/06 18:40:05 1.100.2.24@@ -1047,8 +1047,16 @@if( debug0 )ctx.log( "Handler " + errorServlet + " " + errorPath);- if( errorServlet==null )- errorServlet=ctx.getServletByName( "tomcat.statusHandler");+ if ( statusLoop( ctx, req ) ){+ log( "Error loop for " + req + " error code " + code);+ return;+ }+ if( errorServlet==null ) {+ if( code == 404 )+ errorServlet=ctx.getServletByName( "tomcat.notFoundHandler");+ else+ errorServlet=ctx.getServletByName( "tomcat.statusHandler");+ }req.setAttribute("javax.servlet.error.status_code",new Integer( code));@@ -1194,6 +1202,18 @@return true;}return false;+ }++ /** Handle the case of status handler generating an error+ */+ private boolean statusLoop( Context ctx, Request req ) {+ if ( req.getAttribute("javax.servlet.error.status_code") != null ) {+ if( ctx.getDebug()  0 )+ ctx.log( "Error: nested error inside status servlet " ++ req.getAttribute("javax.servlet.error.status_code"));+ return true;+ }+ return false;}/**Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!http://personal.mail.yahoo.com/

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-06-21 Thread larryi

larryi  01/06/21 06:04:43

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Update for Milestone 4
  
  Revision  ChangesPath
  1.181 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.180
  retrieving revision 1.181
  diff -u -r1.180 -r1.181
  --- ContextManager.java   2001/06/09 03:20:52 1.180
  +++ ContextManager.java   2001/06/21 13:04:43 1.181
  @@ -148,7 +148,7 @@
   public final class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = 3.3 Milestone 3;
  +public static final String TOMCAT_VERSION = 3.3 Milestone 4;
   public static final String TOMCAT_NAME = Tomcat Web Server;
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-05-15 Thread larryi

larryi  01/05/15 06:07:04

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Update for Milestone 3
  
  Revision  ChangesPath
  1.178 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.177
  retrieving revision 1.178
  diff -u -r1.177 -r1.178
  --- ContextManager.java   2001/04/21 18:36:07 1.177
  +++ ContextManager.java   2001/05/15 13:06:59 1.178
  @@ -148,7 +148,7 @@
   public final class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = 3.3 Milestone 2;
  +public static final String TOMCAT_VERSION = 3.3 Milestone 3;
   public static final String TOMCAT_NAME = Tomcat Web Server;
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-04-25 Thread costin

costin  01/04/25 09:50:15

  Modified:src/share/org/apache/tomcat/core Tag: tomcat_32
ContextManager.java
  Log:
  Small fix from Peer Heijnen, aproved by Marc.
  
  On internal requests we create we also need to set the host, so error
  pages work in virtual hosts.
  
  3.3 was already fixed ( part of error handling refactoring ).
  
  Submitted by: Peer Heijnen [EMAIL PROTECTED]
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.100.2.23 +1 -0  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.100.2.22
  retrieving revision 1.100.2.23
  diff -u -r1.100.2.22 -r1.100.2.23
  --- ContextManager.java   2001/03/20 19:01:43 1.100.2.22
  +++ ContextManager.java   2001/04/25 16:50:12 1.100.2.23
  @@ -1172,6 +1172,7 @@
RequestImpl req1=new RequestImpl();
ResponseImpl res1=new ResponseImpl();
initRequest( req1, res1 );
  + req1.setServerName( ctx.getHost() );
   
req1.setRequestURI( ctx.getPath() + path );
processRequest( req1 );
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java Request.java

2001-04-21 Thread costin

costin  01/04/21 11:36:08

  Modified:src/share/org/apache/tomcat/core ContextManager.java
Request.java
  Log:
  Core changes !!!
  
  engineShutdown() hook is supposed to be called when tomcat is shut down ( and modules
  must clean up resources ). The interceptor can be added/removed at any time -
  it must clean after itself on removeInterceptor - but it shouldn't get a shutdown
  notification when it's removed ( since the server will still work ).
  
  Also, shutdown will no longer remove contexts - since init() didn't add them. Whoever
  adds the contexts ( i.e. config modules ) should also remove them - if they want -
  on server stop/restart. ( the context should be cleaned up on contextShutdown, but
  it may remain added - the server will report "application unavailable" instead of
  not found ).
  
  Also, shutdown will not remove interceptors - since it didn't add them.
  
  A init-start-stop-shutdown whould return to the same state as before init
  ( i.e. the configuration hardcoded in context manager like modules and settings
  must remain ).
  
  A shutdown-init should bring the server in ready state, and after start it should
  work as before.
  
  Revision  ChangesPath
  1.177 +33 -7 
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.176
  retrieving revision 1.177
  diff -u -r1.176 -r1.177
  --- ContextManager.java   2001/04/07 06:50:55 1.176
  +++ ContextManager.java   2001/04/21 18:36:07 1.177
  @@ -482,7 +482,6 @@
}
}
   
  - ri.engineShutdown( this );
   }
   
   //  Server functions 
  @@ -577,22 +576,49 @@
*/
   public final void shutdown() throws TomcatException {
   if( state==STATE_START ) stop();
  - while (!contextsV.isEmpty()) {
  +
  + Enumeration enum = getContexts();
  + while (enum.hasMoreElements()) {
  + Context ctx = (Context)enum.nextElement();
try {
  - removeContext((Context)contextsV.firstElement());
  - } catch(Exception ex ) {
  - log( "shutdown.removeContext" , ex );
  + ctx.shutdown();
  + } catch( TomcatException ex ) {
  + log( "Error shuting down context " +ctx );
}
}
  + // No need to remove - since init() doesn't add the contexts.
  + // Modules could remove contexts ( and add them in init() ), but who
  + // adds should also remove
  + //  while (!contextsV.isEmpty()) {
  + //  try {
  + //  Context ctx=(Context)contextsV.firstElement();
  + //  removeContext(ctx);
  + //  } catch(Exception ex ) {
  + //  log( "shutdown.removeContext" , ex );
  + //  }
  + //  }
  +
  + // Notify all modules that the server will shutdown,
  + // let them clean up all resources
   
BaseInterceptor cI[]=defaultContainer.getInterceptors();
for( int i=0; i cI.length; i++ ) {
try {
  - removeInterceptor( cI[i] );
  + cI[i].engineShutdown( this );
} catch( Exception ex ) {
  - log( "shutdown.removeInterceptor" , ex );
  + log( "shutdown.engineShutdown" , ex );
}
}
  +
  + setState( STATE_NEW );
  + // remove the modules ( XXX do we need that ? )
  + //  for( int i=0; i cI.length; i++ ) {
  + //  try {
  + //  removeInterceptor( cI[i] );
  + //  } catch( Exception ex ) {
  + //  log( "shutdown.removeInterceptor" , ex );
  + //  }
  + //  }
   }
   
   //  Contexts 
  
  
  
  1.100 +4 -0  jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java
  
  Index: Request.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java,v
  retrieving revision 1.99
  retrieving revision 1.100
  diff -u -r1.99 -r1.100
  --- Request.java  2001/04/10 06:26:14 1.99
  +++ Request.java  2001/04/21 18:36:07 1.100
  @@ -298,6 +298,10 @@
return uriMB;
   }
   
  +public MessageBytes query() {
  + return queryMB;
  +}
  +
   public MessageBytes queryString() {
return queryMB;
   }
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-04-07 Thread costin

costin  01/04/06 23:50:55

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Errors in shutdown will not stop the process, the rest of contexts
  and interceptors will be shut down.
  
  Revision  ChangesPath
  1.176 +10 -2 
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.175
  retrieving revision 1.176
  diff -u -r1.175 -r1.176
  --- ContextManager.java   2001/03/25 21:53:13 1.175
  +++ ContextManager.java   2001/04/07 06:50:55 1.176
  @@ -578,12 +578,20 @@
   public final void shutdown() throws TomcatException {
   if( state==STATE_START ) stop();
while (!contextsV.isEmpty()) {
  - removeContext((Context)contextsV.firstElement());
  + try {
  + removeContext((Context)contextsV.firstElement());
  + } catch(Exception ex ) {
  + log( "shutdown.removeContext" , ex );
  + }
}
   
BaseInterceptor cI[]=defaultContainer.getInterceptors();
for( int i=0; i cI.length; i++ ) {
  - removeInterceptor( cI[i] );
  + try {
  + removeInterceptor( cI[i] );
  + } catch( Exception ex ) {
  + log( "shutdown.removeInterceptor" , ex );
  + }
}
   }
   
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-03-20 Thread larryi

larryi  01/03/20 11:01:51

  Modified:src/share/org/apache/tomcat/core Tag: tomcat_32
ContextManager.java
  Log:
  Fix an additional location for the security vulnerability reported by Hiromitsu
  Takagi.  See changes for DefaultCMSetter.java version 1.45.2.10.
  
  Submitted by: Kazuhiro Kazama
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.100.2.22 +2 -2  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.100.2.21
  retrieving revision 1.100.2.22
  diff -u -r1.100.2.21 -r1.100.2.22
  --- ContextManager.java   2001/01/12 04:39:03 1.100.2.21
  +++ ContextManager.java   2001/03/20 19:01:43 1.100.2.22
  @@ -1221,7 +1221,7 @@
  .append("/h1\r\nb");
 buf.append(sm.getString("defaulterrorpage.originalrequest"))
  .append("/b ")
  -   .append( requestURI );
  +   .append(RequestUtil.filter(requestURI));
   
 if (getShowDebugInfo()) {
  if (res.isIncluded()) {
  @@ -1232,7 +1232,7 @@
 buf.append("brbr\r\nb")
  
.append(sm.getString("defaulterrorpage.notfoundrequest"))
  .append("/b ")
  -   .append( requestURI );
  +   .append(RequestUtil.filter(requestURI));
  }
 }
   
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-03-13 Thread larryi

larryi  01/03/13 19:45:17

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Update for Tomcat 3.3 Milestone 2 build
  
  Revision  ChangesPath
  1.174 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.173
  retrieving revision 1.174
  diff -u -r1.173 -r1.174
  --- ContextManager.java   2001/03/07 07:56:20 1.173
  +++ ContextManager.java   2001/03/14 03:45:17 1.174
  @@ -148,7 +148,7 @@
   public final class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = "3.3 Milestone 1";
  +public static final String TOMCAT_VERSION = "3.3 Milestone 2";
   public static final String TOMCAT_NAME = "Tomcat Web Server";
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-03-06 Thread costin

costin  01/03/06 23:13:27

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Small bug - for bad requests, the context is not set.
  
  Revision  ChangesPath
  1.172 +9 -2  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.171
  retrieving revision 1.172
  diff -u -r1.171 -r1.172
  --- ContextManager.java   2001/03/04 03:31:52 1.171
  +++ ContextManager.java   2001/03/07 07:13:26 1.172
  @@ -298,6 +298,10 @@
   public void setProperty( String name, String value ) {
properties.put( name, value );
   }
  +
  +public Hashtable getProperties() {
  + return properties;
  +}
   
   //  Other properties 
   
  @@ -929,8 +933,11 @@
   public final void handleError( Request req, Response res , Throwable t  ) {
BaseInterceptor ri[];
int status;
  - ri=req.getContext().getContainer().
  - getInterceptors( Container.H_handleError );
  + if( req.getContext() == null )
  + ri=getContainer().getInterceptors( Container.H_handleError );
  + else
  + ri=req.getContext().getContainer().
  + getInterceptors( Container.H_handleError );
for( int i=0; i ri.length; i++ ) {
status=ri[i].handleError( req, res, t );
if( status!=0 ) return;
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-03-06 Thread costin

costin  01/03/06 23:56:21

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Other places where getContext() needs to be checked.
  
  Revision  ChangesPath
  1.173 +22 -7 
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.172
  retrieving revision 1.173
  diff -u -r1.172 -r1.173
  --- ContextManager.java   2001/03/07 07:13:26 1.172
  +++ ContextManager.java   2001/03/07 07:56:20 1.173
  @@ -708,8 +708,12 @@
handleError( req, res, ex );
}
finally {
  - BaseInterceptor reqI[]= req.getContext().getContainer().
  - getInterceptors(Container.H_postRequest);
  + BaseInterceptor reqI[];
  + if( req.getContext()==null )
  + reqI=getContainer().getInterceptors( Container.H_handleError );
  + else
  + reqI= req.getContext().getContainer().
  + getInterceptors(Container.H_postRequest);
   
for( int i=0; i reqI.length; i++ ) {
reqI[i].postRequest( req, res );
  @@ -756,8 +760,13 @@
String roles[]=req.getRequiredRoles();
if(roles != null ) {
status=0;
  - BaseInterceptor reqI[]= req.getContext().getContainer().
  -getInterceptors(Container.H_authorize);
  + BaseInterceptor reqI[];
  + if( req.getContext()==null )
  + reqI=getContainer().
  + getInterceptors( Container.H_handleError );
  + else
  + reqI = req.getContext().getContainer().
  + getInterceptors(Container.H_authorize);
   
// Call all authorization callbacks. 
for( int i=0; i reqI.length; i++ ) {
  @@ -808,7 +817,10 @@
// the context is not fully initialized.
req.setAttribute("javax.servlet.error.message",
 "Application not available");
  - handleStatus( req, req.getResponse(), 503 ); // service unavailable
  + // return error code - the caller will handle it
  + // handleStatus( req, req.getResponse(), 503 );
  + // service unavailable
  + return 503;
}

ri=req.getContext().getContainer().
  @@ -918,8 +930,11 @@

BaseInterceptor ri[];
int status;
  - ri=req.getContext().getContainer().
  - getInterceptors( Container.H_handleError );
  + if( req.getContext()==null )
  + ri=getContainer().getInterceptors( Container.H_handleError );
  + else
  + ri=req.getContext().getContainer().
  + getInterceptors( Container.H_handleError );

for( int i=0; i ri.length; i++ ) {
status=ri[i].handleError( req, res, null );
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-02-25 Thread nacho

nacho   01/02/25 09:47:17

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Decoupling stop from shutdown..
  Now a embedded tomcat can be stopped and the restarted .
  
  Shutdown implicitly  stops first
  
  Revision  ChangesPath
  1.170 +2 -4  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.169
  retrieving revision 1.170
  diff -u -r1.169 -r1.170
  --- ContextManager.java   2001/02/20 03:17:56 1.169
  +++ ContextManager.java   2001/02/25 17:47:16 1.170
  @@ -542,7 +542,7 @@
if( state==STATE_NEW ) {
init();
}
  -
  +if( state==STATE_START ) return;
BaseInterceptor cI[]=defaultContainer.getInterceptors();
for( int i=0; i cI.length; i++ ) {
cI[i].engineStart( this );
  @@ -561,9 +561,6 @@
for( int i=0; i cI.length; i++ ) {
cI[i].engineStop( this );
}
  -
  - // XXX we shouldn't call shutdown in stop !
  - shutdown();
   }
   
   /** Remove all contexts.
  @@ -571,6 +568,7 @@
*  - call Interceptor.engineShutdown() hooks.
*/
   public final void shutdown() throws TomcatException {
  +if( state==STATE_START ) stop();
while (!contextsV.isEmpty()) {
removeContext((Context)contextsV.firstElement());
}
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-02-13 Thread costin

costin  01/02/13 08:05:32

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Updated version to Milestone 1
  
  Revision  ChangesPath
  1.168 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.167
  retrieving revision 1.168
  diff -u -r1.167 -r1.168
  --- ContextManager.java   2001/02/07 07:01:23 1.167
  +++ ContextManager.java   2001/02/13 16:05:31 1.168
  @@ -148,7 +148,7 @@
   public final class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = "3.3 dev";
  +public static final String TOMCAT_VERSION = "3.3 Milestone 1";
   public static final String TOMCAT_NAME = "Tomcat Web Server";
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java Handler.java Response.java ResponseImpl.java ServletWrapper.java

2001-01-11 Thread larryi

larryi  01/01/11 20:39:06

  Modified:src/share/org/apache/tomcat/core Tag: tomcat_32
ContextManager.java Handler.java Response.java
ResponseImpl.java ServletWrapper.java
  Log:
  Update handling so that when an included servlet throws an
  UnavailableException that isn't handled, it doesn't mark the callers
  as unavailable too.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.100.2.21 +6 -2  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.100.2.20
  retrieving revision 1.100.2.21
  diff -u -r1.100.2.20 -r1.100.2.21
  --- ContextManager.java   2001/01/04 21:23:59 1.100.2.20
  +++ ContextManager.java   2001/01/12 04:39:03 1.100.2.21
  @@ -1082,8 +1082,12 @@
the client. AFAIK the trace is the _best_ debugger.
*/
if (t instanceof UnavailableException) {
  - int unavailableTime = ((UnavailableException)t).getUnavailableSeconds();
  - if( unavailableTime  0 ) {
  + int unavailableTime = -1;
  + if ( !((UnavailableException)t).isPermanent() ) {
  + unavailableTime = ((UnavailableException)t).getUnavailableSeconds();
  + // if unavailable time not known, use 1 second
  + if ( unavailableTime = 0 )
  + unavailableTime = 1;
res.setHeader("Retry-After", Integer.toString(unavailableTime));
}
String msg=t.getMessage();
  
  
  
  1.7.2.8   +4 -3  jakarta-tomcat/src/share/org/apache/tomcat/core/Handler.java
  
  Index: Handler.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Handler.java,v
  retrieving revision 1.7.2.7
  retrieving revision 1.7.2.8
  diff -u -r1.7.2.7 -r1.7.2.8
  --- Handler.java  2000/11/11 02:56:58 1.7.2.7
  +++ Handler.java  2001/01/12 04:39:03 1.7.2.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Handler.java,v 1.7.2.7 
2000/11/11 02:56:58 larryi Exp $
  - * $Revision: 1.7.2.7 $
  - * $Date: 2000/11/11 02:56:58 $
  + * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Handler.java,v 1.7.2.8 
2001/01/12 04:39:03 larryi Exp $
  + * $Revision: 1.7.2.8 $
  + * $Date: 2001/01/12 04:39:03 $
*
* 
*
  @@ -260,6 +260,7 @@
}
context.log("Exception in init  " + ex.getMessage(), ex );
   if (res.isIncluded()) { // Only propogate on includes
  + res.setErrorException(ex);
// save error URI if necessary
contextM.saveErrorURI( req, res );
   if (ex instanceof IOException)
  
  
  
  1.22.2.3  +10 -0 jakarta-tomcat/src/share/org/apache/tomcat/core/Response.java
  
  Index: Response.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Response.java,v
  retrieving revision 1.22.2.2
  retrieving revision 1.22.2.3
  diff -u -r1.22.2.2 -r1.22.2.3
  --- Response.java 2000/11/11 02:56:58 1.22.2.2
  +++ Response.java 2001/01/12 04:39:03 1.22.2.3
  @@ -143,6 +143,16 @@
*/
   public void setIncluded(boolean b);
   
  +/** Set the error Exception that occurred during
  + request processing.
  + */
  +public void setErrorException(Exception ex) ;
  +
  +/** Get the Exception that occurred during request
  + processing.
  + */
  +public Exception getErrorException() ;
  +
   /** Saves the request that originates an error.
*/
   public void setErrorURI(String uri) ;
  
  
  
  1.33.2.5  +12 -3 
jakarta-tomcat/src/share/org/apache/tomcat/core/Attic/ResponseImpl.java
  
  Index: ResponseImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Attic/ResponseImpl.java,v
  retrieving revision 1.33.2.4
  retrieving revision 1.33.2.5
  diff -u -r1.33.2.4 -r1.33.2.5
  --- ResponseImpl.java 2000/11/11 02:56:58 1.33.2.4
  +++ ResponseImpl.java 2001/01/12 04:39:04 1.33.2.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Attic/ResponseImpl.java,v 
1.33.2.4 2000/11/11 02:56:58 larryi Exp $
  - * $Revision: 1.33.2.4 $
  - * $Date: 2000/11/11 02:56:58 $
  + * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Attic/ResponseImpl.java,v 
1.33.2.5 2001/01/12 04:39:04 larryi Exp $
  + * $Revision: 

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-01-04 Thread marcsaeg

marcsaeg01/01/04 13:24:00

  Modified:src/share/org/apache/tomcat/core Tag: tomcat_32
ContextManager.java
  Log:
  If no context can be found for the request URI then display
  a 404 error.  Previously this caused a tight loop in
  PrefixMapper.getLongestPrefixMatch().
  
  A portion of this fix was submitted by Shawn McMurdo [[EMAIL PROTECTED]].
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.100.2.20 +66 -0 
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.100.2.19
  retrieving revision 1.100.2.20
  diff -u -r1.100.2.19 -r1.100.2.20
  --- ContextManager.java   2000/11/16 18:25:21 1.100.2.19
  +++ ContextManager.java   2001/01/04 21:23:59 1.100.2.20
  @@ -1015,6 +1015,15 @@
Context ctx = req.getContext();
if(ctx==null) ctx=getContext("");
   
  + if(ctx == null){
  + // The request didn't map into any context so send a 404 error.
  + try{
  + handleContextNotFound(req, res);
  + }catch(IOException e){
  + }
  + return;
  + }
  +
// don't log normal cases ( redirect and need_auth ), they are not
// error
// XXX this log was intended to debug the status code generation.
  @@ -1182,6 +1191,63 @@
return false;
   }
   
  +  /**
  +   *  Called if the request does not map into any context.  This code
  +   * was lifted from DefaultCMSetter.NotFoundHandler becuase without
  +   * a valid context we really can't execute that servlet.
  +   */
  +  private void  handleContextNotFound(Request req, Response res) throws 
IOException
  +  {
  +  StringManager 
sm=StringManager.getManager("org.apache.tomcat.resources");
  +  res.setContentType("text/html");   // ISO-8859-1 default
  +
  +  String requestURI = (String)req.
  +   getAttribute("javax.servlet.include.request_uri");
  +
  +  if (requestURI == null || res.isIncluded()) {
  +   requestURI = req.getRequestURI();
  +  }
  +
  +  StringBuffer buf = new StringBuffer();
  +  buf.append("headtitle")
  +   .append(sm.getString("defaulterrorpage.notfound404"))
  +   .append("/title/head\r\n");
  +  buf.append("bodyh1")
  +   .append(sm.getString("defaulterrorpage.notfound404"))
  +   .append("/h1\r\nb");
  +  buf.append(sm.getString("defaulterrorpage.originalrequest"))
  +   .append("/b ")
  +   .append( requestURI );
  +
  +  if (getShowDebugInfo()) {
  +   if (res.isIncluded()) {
  +  requestURI = (String)req.
  +   getAttribute("javax.servlet.include.request_uri");
  +   }
  +   if (requestURI != null) {
  +  buf.append("brbr\r\nb")
  +   
.append(sm.getString("defaulterrorpage.notfoundrequest"))
  +   .append("/b ")
  +   .append( requestURI );
  +   }
  +  }
  +
  +  buf.append("/body\r\n");
  +
  +  String body = buf.toString();
  +
  +  res.setContentLength(body.length());
  +
  +  if( res.isUsingStream() ) {
  +   ServletOutputStream out = res.getOutputStream();
  +   out.print(body);
  +   out.flush();
  +  } else {
  +   PrintWriter out = res.getWriter();
  +   out.print(body);
  +   out.flush();
  +  }
  +   }
   
   //  Support for notes 
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2000-12-26 Thread costin

costin  00/12/26 15:23:30

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Reverted back to the 3.2 way of dealing with contextAdd - the hook
  will be called just after the method.
  
  Improved the documentation, states - now it's simpler and easier for user.
  
  More "permisive" status handling - correct instead of throwing exceptions.
  
  Added setProperty, removed showDebugInfo ( getProperty should be used instead),
  same for randomClass ( commit that fixes that will follow )
  
  Implemented removeInterceptor, make sure hooks are called regardless of
  add order.
  
  Added attribute-like get/setNote - that should simplify the use of notes.
  ( the id based method should be used at runtime )
  
  This is not the final version, I'm still lookig for the "right" way to
  setup/start/stop/configure the server.
  
  Revision  ChangesPath
  1.158 +195 -285  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.157
  retrieving revision 1.158
  diff -u -r1.157 -r1.158
  --- ContextManager.java   2000/12/08 23:18:43 1.157
  +++ ContextManager.java   2000/12/26 23:23:29 1.158
  @@ -57,7 +57,6 @@
*
*/
   
  -
   package org.apache.tomcat.core;
   
   import org.apache.tomcat.util.*;
  @@ -68,117 +67,68 @@
   
   /**
 ContextManager is the entry point and "controler" of the servlet execution.
  -  It maintains a list of WebApplications and a list of global event
  -  interceptors that are set up to handle the actual execution.
  - 
  -  The ContextManager will direct the request processing flow
  -  from its arrival from the server/protocl adapter ( in service() ).
  -  It will do that by calling a number of hooks implemented by Interceptors.
  - 
  -  Hooks are provided for request parsing and mapping, auth, autorization,
  -  pre/post service, actual invocation and logging.
  - 
  -  ContextManager will also store properties that are global to the servlet
  -  container - like root directory, install dir, work dir.
  - 
  -  The extension mechanism for tomcat is the Interceptor.
  -  This class is final - if you need to change certain functionality
  -  you should add a new hook.
  - 
  -  ContextManager is not a singleton - it represent a servlet container
  -  instance ( with all associated ports and configurations ).
  -  One application may try to embed multiple ( distinct ) servlet containers -
  -  this feature hasn't been tested or used
  - 
  -   h2Startup/h2
  -
  -  1. Create ContextManager.
  -
  -  2. Set properties for ContextManager ( home, debug, etc).
  -
  -  3. Add global Interceptors.
  -
  -  4. You may create, set and add Contexts. NO HOOKS ARE CALLED.
  -  This adds a lot of complexity to the code - but allow
  -  the server to have an initial set of contexts when it starts.
  -  More contexts can be added after startup.
  -  
  -  5. init() At this stage engineInit() callback will be
  - called for all global interceptors. 
  -
  - During engineInit() a number of Contexts can be created and
  - added to the server. No addContext() callback is called until
  - the last engineInit() returns. Interceptors can also change the
  - state of the server ( change properites, add other interceptors,
  - etc)
  -
  - After this call the server will be in INITIALIZED state.
  - No callback other than engineInit  can be called before the server
  - enters this state.
  -
  -  6. init() will also call the addContext() hook for all contexts
  - that were added during engineInit or before init() was called.
  - More contexts can be added after init() and before start().
  -
  - InitContext will have no effect before the server is started -
  - all initContexts for added contexts will be called automatically
  - at start.
  -
  -  7. start(). All contexts will be initialized ( contextInit()
  - callback ). ContextInit will move the context to READY state,
  - allowing it to serve requests.
  -
  - Server will move to START state after all configured contexts
  - are READY. No servlet should be served before the container is
  - in START state ( tomcat should return "Server not ready") .
  -
  - h2Normal operation/h2
  +  It maintains a list of Contexts ( web applications )  and a list of
  +  interceptors (hooks) that are set up to handle the actual execution.
   
  -  1. Requests for a context in READY state will be served by that context.
  - Requests for a context that is not READY will return an error (
  - "application temp. unavailable" - no 404 on the parent context !)
  +  The execution is modeled after Apache2.0 and other web servers, with
  +  interceptors serving the same role as modules.
   

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2000-12-05 Thread larryi

larryi  00/12/05 05:20:47

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Port showDebugInfo property from Tomcat 3.2.
  
  Make handlerError() public.
  
  Revision  ChangesPath
  1.156 +21 -2 
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.155
  retrieving revision 1.156
  diff -u -r1.155 -r1.156
  --- ContextManager.java   2000/12/05 06:24:45 1.155
  +++ ContextManager.java   2000/12/05 13:20:46 1.156
  @@ -248,6 +248,11 @@
*/
   private String installDir;
   
  +/** The flag which controls the display of
  + *  debugging information in default responses
  + */
  +boolean showDebugInfo = true;
  +
   // Server properties ( interceptors, etc ) - it's one level above "/"
   private Container defaultContainer;
   
  @@ -336,7 +341,21 @@
   public final int getState() {
return state;
   }
  +
  +/** The showDebugInfo property state.  To be used for controlling the
  + *  display of debugging information in default responses.
  + **/
  +public final boolean isShowDebugInfo() {
  + return showDebugInfo;
  +}
   
  +/** Sets the showDebugInfo property used for controlling the display of
  + *  debugging information in default responses.
  + */
  +public void setShowDebugInfo(boolean showDebugInfo) {
  + this.showDebugInfo = showDebugInfo;
  +}
  + 
   /**
*  Parent loader is the "base" class loader of the
*   application that starts tomcat, and includes no
  @@ -875,7 +894,7 @@
   
   
   //  Error handling 
  -
  +
   /** Called for error-codes. Will call the error hook.
*/
   public final void handleStatus( Request req, Response res, int code ) {
  @@ -895,7 +914,7 @@
   /**
*  Call error hook
*/
  -void handleError( Request req, Response res , Throwable t  ) {
  +public final void handleError( Request req, Response res , Throwable t  ) {
BaseInterceptor ri[];
int status;
ri=req.getContainer().getInterceptors( Container.H_handleError );
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2000-12-04 Thread costin

costin  00/12/04 22:24:46

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Again, more documentation and reviewing of ContextManager specification.
  
  Removed the "STOP" state, documented the transitions from
  new - init - start - stop ( with possible restart ) - shutdown.
  
  Revision  ChangesPath
  1.155 +39 -19
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.154
  retrieving revision 1.155
  diff -u -r1.154 -r1.155
  --- ContextManager.java   2000/12/03 08:19:03 1.154
  +++ ContextManager.java   2000/12/05 06:24:45 1.155
  @@ -160,9 +160,8 @@
   
h2Stopping the server/h2
   
  -  1. stop(). The server will exit the START state and enter STOP,any request
  - will get a "Server unavailable" error. All contextShutdown() and
  - will be called. ( STOP==INIT ? )
  +  1. stop(). The server will exit the START state and enter INIT.
  + All contextShutdown() and will be called. 
   
 2. shutdown(). All  removeContext() callbacks will be called and the server
 will enter PRE_INIT state. The contexts will not be removed from
  @@ -188,30 +187,43 @@
   public static final String TOMCAT_VERSION = "3.3 dev";
   public static final String TOMCAT_NAME = "Tomcat Web Server";
   
  -/** System property used to set the base directory ( tomcat home )
  +/** System property used to set the base directory ( tomcat home ).
  + *  use -DTOMCAT_HOME= in java command line or System.setProperty.
  + *
  + *  XXX This is a particular implementation detail of the interceptor
  + *  that sets the "default" home - it shouldn't be required or
  + *  specified in the core
*/
  -public static final String TOMCAT_HOME=
  - "tomcat.home";
  +public static final String TOMCAT_HOME="tomcat.home";
   
   // State
   
  -/** Server is not initialized
  +/** Server is not initialized. You can add interceptors and contexts,
  + *  but no hook will be called, tomcat will just store the information.
  + *  The connectors are not activated.
  + *
  + *  Tomcat will be in this state when started and after shutdown()
  + *  is called. Shutdown will also call the engineShutdown() hooks.
*/
   public static final int STATE_PRE_INIT=0;
  -/** Server was initialized, engineInit() was called.
  - addContext() can be called.
  +
  +/** Server is initialized, engineInit() was called.
  + *
  + *  On this state, the addContext hook can be called on all contexts added.
  + *  ( but the context will be initialized only when tomcat starts )
  + *
  + *  The context will be in this state after init() is called or
  + *  after stop() is called ( after it was in START state )
  + *
*/
   public static final int STATE_INIT=1;
   
  -/** Engine is running. All configured contexts are
  - initialized ( contextInit()), and requests can be served.
  +/** Engine is running. 
  + *  The contextInit() hook can be called for all  added contexts,
  + *  and requests will be processed normally.
*/
   public static final int STATE_START=2;
   
  -/** Engine has stoped
  - */
  -public static final int STATE_STOP=3;
  -
   //  local variables 
   
   private int state=STATE_PRE_INIT;
  @@ -222,8 +234,6 @@
   
   private int debug=0;
   
  -// Global properties for this tomcat instance:
  -
   /** Private workspace for this server
*/
   private String workDir;
  @@ -244,7 +254,7 @@
   // the embedding application loader. @see getParentLoader
   private ClassLoader parentLoader;
   
  -// Store Loggers before initializing them
  +// Store Loggers that are used in this server
   private Hashtable loggers;
   
   /**
  @@ -321,6 +331,8 @@
   
   //  Other properties 
   
  +/** Return the current state of the tomcat server.
  + */
   public final int getState() {
return state;
   }
  @@ -370,6 +382,9 @@
   defaultContainer = newDefaultContainer;
   }
   
  +/** Add a global interceptor. It's hooks will be called for
  + *  all requests.
  + */
   public final void addInterceptor( BaseInterceptor ri ) {
// The interceptors are handled per/container ( thanks to Nacho
// for this contribution ).
  @@ -498,7 +513,12 @@
   
   //  Contexts 
   
  -/** Return the list of contexts managed by this server
  +/** Return the list of contexts managed by this server.
  + *  Tomcat can handle 

RE: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2000-12-01 Thread Larry Isaacs

Hi Costin,

I was getting ready to ask about ContextManager getting stuck
during shutdown.  This patch keeps it from getting stuck, but
if the context was in "STATE_READY", then "shutdownContext( context )"
is called which sets the state to "STATE_DISABLED" causing
removeContext() to exit early.  The interceptor's removeContext()
methods won't be called.  

While pondering a fix for this, I was also pondering what should
happen if an interceptor throws an exceptions during context
removal.  Currently, an exception would get handled outside
of ContextManger and potentially leave a context in an inconsistent
state.  Should interceptor exceptions be caught, logged, then
ignored by ContextManager so shutdown can proceed without being
aborted?

Also, it seems to me that a Tomcat shutdown will remove the contexts
out from under any requests that are currently using it.  Am I
missing something?  If not, should we try to add, or at least
provide for, an "orderly" shutdown in addition to the "forced"
shutdown we seem to currently have?

Cheers,
Larry





 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, December 01, 2000 12:43 PM
 To: [EMAIL PROTECTED]
 Subject: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core
 ContextManager.java
 
 
 costin  00/12/01 09:42:52
 
   Modified:src/share/org/apache/tomcat/core ContextManager.java
   Log:
   Fixed small bug that prevented normal shutdown.
   
   Revision  ChangesPath
   1.152 +2 -1  
 jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
   
   Index: ContextManager.java
   ===
   RCS file: 
 /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Cont
 extManager.java,v
   retrieving revision 1.151
   retrieving revision 1.152
   diff -u -r1.151 -r1.152
   --- ContextManager.java 2000/11/30 06:17:12 1.151
   +++ ContextManager.java 2000/12/01 17:42:51 1.152
   @@ -494,6 +494,8 @@
   if( context.getState() == Context.STATE_READY )
   shutdownContext( context );

   +   contextsV.removeElement(context);
   +
   if( context.getState() == Context.STATE_DISABLED )
   return;
   
   @@ -505,7 +507,6 @@
   cI[i].removeContext( this, context );
   }

   -   contextsV.removeElement(context);
}


   
   
   
 



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2000-11-19 Thread nacho

nacho   00/11/19 18:12:24

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Porting patches from tomcat_32
  
  Revision  ChangesPath
  1.148 +2 -3  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.147
  retrieving revision 1.148
  diff -u -r1.147 -r1.148
  --- ContextManager.java   2000/11/06 15:16:30 1.147
  +++ ContextManager.java   2000/11/20 02:12:23 1.148
  @@ -414,9 +414,8 @@
*  - call Interceptor.engineShutdown() hooks.
*/
   public final void shutdown() throws TomcatException {
  - Enumeration enum = getContexts();
  - while (enum.hasMoreElements()) {
  - removeContext((Context)enum.nextElement());
  + while (!contextsV.isEmpty()) {
  + removeContext((Context)contextsV.firstElement());
}
   
BaseInterceptor cI[]=defaultContainer.getInterceptors();
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2000-11-16 Thread craigmcc

craigmcc00/11/16 10:25:22

  Modified:src/share/org/apache/tomcat/core Tag: tomcat_32
ContextManager.java
  Log:
  Correctly shut down *all* contexts (which will trigger the destroy()
  method of all initialized servlets being called).  Previously, the code
  was relying on being able to enumerate over a collection that is being
  modified, which is undefined behavior -- and does not work as intended in
  many JVMs.
  
  Submitted by: Marc Saegesser [EMAIL PROTECTED]
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.100.2.19 +3 -5  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.100.2.18
  retrieving revision 1.100.2.19
  diff -u -r1.100.2.18 -r1.100.2.19
  --- ContextManager.java   2000/11/11 02:56:58 1.100.2.18
  +++ ContextManager.java   2000/11/16 18:25:21 1.100.2.19
  @@ -466,11 +466,9 @@
   /** Will shutdown all contexts
*/
   public void shutdown() throws TomcatException {
  - Enumeration enum = getContexts();
  - while (enum.hasMoreElements()) {
  - removeContext((Context)enum.nextElement());
  - }
  -
  +while (!contextsV.isEmpty()) {
  +removeContext((Context) contextsV.firstElement());
  +}
ContextInterceptor cI[]=getContextInterceptors();
for( int i=0; i cI.length; i++ ) {
cI[i].engineShutdown( this );
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2000-11-04 Thread craigmcc

craigmcc00/11/04 12:28:48

  Modified:src/share/org/apache/tomcat/core Tag: tomcat_32
ContextManager.java
  Log:
  When configuring a ContextManager, allow the "work" and "home" attributes
  to be specified (or defaulted) in any order.
  
  Reported by: Mark Lewis [EMAIL PROTECTED], TOMCAT-DEV, 01 Nov 2000
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.100.2.13 +26 -14
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.100.2.12
  retrieving revision 1.100.2.13
  diff -u -r1.100.2.12 -r1.100.2.13
  --- ContextManager.java   2000/10/23 16:55:48 1.100.2.12
  +++ ContextManager.java   2000/11/04 20:28:47 1.100.2.13
  @@ -153,8 +153,13 @@
   
   /** Private workspace for this server
*/
  -String workDir;
  +String workDir = null;  // Initialized the first time we get it
   
  +/** Configured workspace directory name (not absolutized yet)
  + */
  +String workDirProperty = null;
  +
  +
   /** The base directory where this instance runs.
*  It can be different from the install directory to
*  allow one install per system and multiple users
  @@ -196,7 +201,7 @@
*/
   public void setHome(String home) {
this.home=FileUtil.getCanonicalPath( home );
  - logInt( "Setting home to " + this.home );
  + if (debug0) logInt( "Setting home to " + this.home );
   }
   
   /**
  @@ -286,24 +291,31 @@
* WorkDir property - where all working files will be created
*/
   public void setWorkDir( String wd ) {
  - if(debug0) logInt("set work dir " + wd);
  - // make it absolute
  - File f=new File( wd );
  - if( ! f.isAbsolute() ) {
  - File wdF=getAbsolute( f );
  - wd= wdF.getAbsolutePath();
  - }
  -
  - this.workDir=wd;
  + if (debug0) logInt("set work dir " + wd);
  +this.workDirProperty = wd;  // Store only the string for now
   }
   
   /**
* WorkDir property - where all working files will be created
*/
   public String getWorkDir() {
  - if( workDir==null)
  - workDir=getHome() + File.separator + DEFAULT_WORK_DIR;
  - return workDir;
  +
  +// The first time this is called, calculate the right value
  +if (this.workDir == null) {
  +File f = null;
  +if (this.workDirProperty == null)
  +f = new File(DEFAULT_WORK_DIR);
  +else
  +f = new File(this.workDirProperty);
  +if (!f.isAbsolute())
  +f = getAbsolute(f);
  +this.workDir = f.getAbsolutePath();
  +if (debug0) logInt("calc work dir " + this.workDir);
  +}
  +
  +// Return the calculated work directory value
  +return (this.workDir);
  +
   }
   
   /**
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java Container.java

2000-11-02 Thread costin

costin  00/11/02 13:35:34

  Modified:src/share/org/apache/tomcat/core ContextManager.java
Container.java
  Log:
  Big changes:
  
  - Fixed the code to match the comments :-) ( i.e. respect the server state,
  make sure the callbacks are called in the right order - more work is needed)
  
  - Removed ContextManger.getIntereptor(): the interceptors are handled by
  Container ( since they are associated with a group of URLs, thanks to Nacho),
  the old code that assumed only one set of intereptors per server is no
  longer needed.
  
  Other changes:
  
  - removed unused constants ( WORK_DIR - it's set up by an interceptor, it's
  dependent on the deployment option, not a global constant )
  
  - Removed "accounting" - we only had counter for startup time, a global solution
  is needed ( and startup time is decent now - except random )
  
  - removed rootContext ( added before virtual host support, not used )
  
  - removed "serverClassPath" - not used ( I added it sometime ago
  for class loaders, there are better ways to do that )
  
  - more comments
  
  Revision  ChangesPath
  1.146 +218 -253  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.145
  retrieving revision 1.146
  diff -u -r1.145 -r1.146
  --- ContextManager.java   2000/10/12 22:41:50 1.145
  +++ ContextManager.java   2000/11/02 21:35:30 1.146
  @@ -176,30 +176,13 @@
   public static final String TOMCAT_VERSION = "3.3 dev";
   public static final String TOMCAT_NAME = "Tomcat Web Server";
   
  -/** Property used to set the random number generator
  +/** System property used to set the base directory ( tomcat home )
*/
  -public static final String RANDOM_CLASS_PROPERTY=
  - "tomcat.sessionid.randomclass";
  -
  -/** Property used to set the base directory ( tomcat home )
  - */
   public static final String TOMCAT_HOME=
"tomcat.home";
   
  -/** Default work dir, relative to home
  - */
  -public static final String DEFAULT_WORK_DIR="work";
  -
  -// Accounting
  -/** time when init() started
  - */
  -public static final int ACC_INIT_START=0;
  -/** Time when init() finished()
  - */
  -public static final int ACC_INIT_END=1;
  -public static final int ACCOUNTS=2;
  -
   // State
  +
   /** Server is not initialized
*/
   public static final int STATE_PRE_INIT=0;
  @@ -207,10 +190,12 @@
addContext() can be called.
*/
   public static final int STATE_INIT=1;
  +
   /** Engine is running. All configured contexts are
initialized ( contextInit()), and requests can be served.
*/
   public static final int STATE_START=2;
  +
   /** Engine has stoped
*/
   public static final int STATE_STOP=3;
  @@ -219,8 +204,8 @@
   
   private int state=STATE_PRE_INIT;
   
  -/** Contexts managed by this server
  - */
  +// All contexts managed by the server ( can belong to different
  +// virtual hosts )
   private Vector contextsV=new Vector();
   
   private int debug=0;
  @@ -240,24 +225,15 @@
   /** The directory where tomcat is installed
*/
   private String installDir;
  -
  -// "/" on the default host 
  -private Context rootContext;
   
   // Server properties ( interceptors, etc ) - it's one level above "/"
   private Container defaultContainer;
   
  -// the application loader. ContextManager is loaded with
  -// a class loader containing tomcat-specific classes,
  -// use parent loader to avoid polution
  +// the embedding application loader. @see getParentLoader
   private ClassLoader parentLoader;
  -// tomcat classes ( used to load tomcat)
  -private URL serverClassPath[];
   
   // Store Loggers before initializing them
  -private Hashtable Loggers;
  -
  -private Counters cntr=new Counters(ACCOUNTS);
  +private Hashtable loggers;
   
   /**
* Construct a new ContextManager instance with default values.
  @@ -269,119 +245,6 @@
   defaultContainer.setPath( null ); // default container
   }
   
  -//  Server functions 
  -
  -/**
  - *  Init() is called after the context manager is set up
  - *  and configured ( all setFoo methods are called, all initial
  - *  interceptors are added and their setters are called ).
  - *
  - *  CM will call the following hooks:
  - *   - Interceptor.engineInit()
  - *
  - *  It will tehn call initContext() for all the contexts (
  - *  including those added by interceptors )
  - */
  -public final void init()  throws 

RE: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2000-10-23 Thread Nacho

Sorry, forget to name the original Submitter was :

Andrew Sudell [[EMAIL PROTECTED]] 


Saludos ,
Ignacio J. Ortega


 -Mensaje original-
 De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Enviado el: lunes 23 de octubre de 2000 18:56
 Para: [EMAIL PROTECTED]
 Asunto: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core
 ContextManager.java
 
 
 nacho   00/10/23 09:55:51
 
   Modified:src/share/org/apache/tomcat/core Tag: tomcat_32
 ContextManager.java
   Log:
   Allowing to compile under jdk 1.1
   
   Revision  ChangesPath
   No   revision
   
   
   No   revision
   
   
   1.100.2.12 +2 -1  
 jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
   
   Index: ContextManager.java
   ===
   RCS file: 
 /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Cont
extManager.java,v
   retrieving revision 1.100.2.11
   retrieving revision 1.100.2.12
   diff -u -r1.100.2.11 -r1.100.2.12
   --- ContextManager.java 2000/10/04 20:49:16 1.100.2.11
   +++ ContextManager.java 2000/10/23 16:55:48 1.100.2.12
   @@ -332,7 +332,8 @@
 *  session id generator. 
 */
public void setRandomClass(String randomClass) {
   -System.setProperty("tomcat.sessionid.randomclass", 
 randomClass);
   +Properties sysProp = System.getProperties();
   +   sysProp.put("tomcat.sessionid.randomclass", randomClass);
}

/** Get the showDebugInfo property to be used for 
 controlling the display of
   
   
   
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]