cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util/compat SimpleClassLoader.java

2001-03-05 Thread larryi

larryi  01/03/05 21:39:24

  Modified:src/share/org/apache/tomcat/util/compat
SimpleClassLoader.java
  Log:
  Move previously added zf.close() in doFindResource() since this method
  needs to return the Resource with ZipFile still open.
  
  Add parent delagation to getResource() and getResourceAsStream().  This
  is now needed when using Jdk1.1 because web.dtd has changed location.
  It used to be with the classes now handled by the "container" classloader.
  It is now handled by the "common" classloader which is a parent of the
  "container" classloader.
  
  Revision  ChangesPath
  1.3   +16 -2 
jakarta-tomcat/src/share/org/apache/tomcat/util/compat/SimpleClassLoader.java
  
  Index: SimpleClassLoader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/compat/SimpleClassLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SimpleClassLoader.java2001/03/04 19:49:02 1.2
  +++ SimpleClassLoader.java2001/03/06 05:39:24 1.3
  @@ -328,8 +328,15 @@
*/
   public URL getResource(String name) {
   if( debug > 0 ) log( "getResource() " + name );
  + URL u = null;
   
  - URL u = getSystemResource(name);
  + if (parent != null) {
  + u = parent.getResource(name);
  + if (u != null)
  + return u;
  + }
  +
  + u = getSystemResource(name);
if (u != null) {
return u;
}
  @@ -391,6 +398,13 @@
//  InputStream s = getSystemResourceAsStream(name);
InputStream s = null;
   
  + if (parent != null) {
  + s = parent.getResourceAsStream(name);
  + if( debug>0 ) log( "Found resource in parent " + s );
  + if (s != null)
  + return s;
  + }
  +
// Get this resource from system class loader 
s = getSystemResourceAsStream(name);
   
  @@ -475,7 +489,6 @@
   try {
   ZipFile zf = new ZipFile(file.getAbsolutePath());
   ZipEntry ze = zf.getEntry(name);
  - zf.close();

   if (ze != null) {
r.zipEntry=ze;
  @@ -483,6 +496,7 @@
r.repository=file;
return r;
   }
  + zf.close();
   } catch (IOException ioe) {
   ioe.printStackTrace();
System.out.println("Name= " + name + " " + file );
  
  
  

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




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-03-05 Thread larryi

larryi  01/03/05 21:25:16

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  Vector.contains() for vectors of URLs makes use of URL.equals().  Under
  Jdk1.1, URL.equals() throws NPE's if host = null.  Host = "" seems to work
  better.
  
  Revision  ChangesPath
  1.30  +5 -5  jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- Main.java 2001/03/05 17:38:44 1.29
  +++ Main.java 2001/03/06 05:25:14 1.30
  @@ -1,4 +1,4 @@
  -/* $Id: Main.java,v 1.29 2001/03/05 17:38:44 larryi Exp $
  +/* $Id: Main.java,v 1.30 2001/03/06 05:25:14 larryi Exp $
* 
*
* The Apache Software License, Version 1.1
  @@ -107,7 +107,7 @@
@author Costin Manolache
@author Ignacio J. Ortega
@author Mel Martinez [EMAIL PROTECTED]
  - @version $Revision: 1.29 $ $Date: 2001/03/05 17:38:44 $
  + @version $Revision: 1.30 $ $Date: 2001/03/06 05:25:14 $
*/
   public class Main{
   
  @@ -220,7 +220,7 @@
   if( f.isDirectory() ){
   path +="/";
   }
  -return new URL( "file", null, path );
  +return new URL( "file", "", path );
   } catch (Exception ex) {
   ex.printStackTrace();
   return null;
  @@ -281,7 +281,7 @@
   for(int i=0; i < serverUrlV.size();i++){
   serverJars.addElement(serverUrlV.elementAt(i));
   }
  -serverJars.addElement( new URL( "file", null ,
  +serverJars.addElement( new URL( "file", "" ,
   System.getProperty( "java.home" ) + "/../lib/tools.jar"));
   
   Vector commonDirJars = getClassPathV(getCommonDir());
  @@ -392,7 +392,7 @@
   if(f.isDirectory()){
   path += "/";
   }
  -URL url = new URL("file",null,path);
  +URL url = new URL("file","",path);
   if(!jars.contains(url)){
   jars.addElement(url);
   }
  
  
  

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




cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator BasicAuthenticator.java DigestAuthenticator.java

2001-03-05 Thread remm

remm01/03/05 21:08:16

  Modified:catalina/src/share/org/apache/catalina/authenticator
BasicAuthenticator.java DigestAuthenticator.java
  Log:
  - Don't set content length to 0.
  
  Revision  ChangesPath
  1.7   +4 -5  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator/BasicAuthenticator.java
  
  Index: BasicAuthenticator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator/BasicAuthenticator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BasicAuthenticator.java   2000/12/16 04:03:29 1.6
  +++ BasicAuthenticator.java   2001/03/06 05:08:16 1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator/BasicAuthenticator.java,v
 1.6 2000/12/16 04:03:29 craigmcc Exp $
  - * $Revision: 1.6 $
  - * $Date: 2000/12/16 04:03:29 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator/BasicAuthenticator.java,v
 1.7 2001/03/06 05:08:16 remm Exp $
  + * $Revision: 1.7 $
  + * $Date: 2001/03/06 05:08:16 $
*
* 
*
  @@ -84,7 +84,7 @@
* and Digest Access Authentication."
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.6 $ $Date: 2000/12/16 04:03:29 $
  + * @version $Revision: 1.7 $ $Date: 2001/03/06 05:08:16 $
*/
   
   public final class BasicAuthenticator
  @@ -172,7 +172,6 @@
   //log("Challenging for realm '" + realmName + "'");
hres.setHeader("WWW-Authenticate", 
  "Basic realm=\"" + realmName + "\"");
  -hres.setContentLength(0);
hres.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
   //   hres.flushBuffer();
return (false);
  
  
  
  1.6   +4 -5  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator/DigestAuthenticator.java
  
  Index: DigestAuthenticator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator/DigestAuthenticator.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DigestAuthenticator.java  2000/12/16 04:03:29 1.5
  +++ DigestAuthenticator.java  2001/03/06 05:08:16 1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator/DigestAuthenticator.java,v
 1.5 2000/12/16 04:03:29 craigmcc Exp $
  - * $Revision: 1.5 $
  - * $Date: 2000/12/16 04:03:29 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator/DigestAuthenticator.java,v
 1.6 2001/03/06 05:08:16 remm Exp $
  + * $Revision: 1.6 $
  + * $Date: 2001/03/06 05:08:16 $
*
* 
*
  @@ -88,7 +88,7 @@
* 
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.5 $ $Date: 2000/12/16 04:03:29 $
  + * @version $Revision: 1.6 $ $Date: 2001/03/06 05:08:16 $
*/
   
   public final class DigestAuthenticator
  @@ -416,7 +416,6 @@
   // System.out.println("Authenticate header value : " 
   //   + authenticateHeader);
   response.setHeader("WWW-Authenticate", authenticateHeader);
  -response.setContentLength(0);
   
   }
   
  
  
  

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




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

2001-03-05 Thread remm

remm01/03/05 21:07:45

  Modified:catalina/src/share/org/apache/catalina/connector/http
HttpResponseImpl.java
  Log:
  - Only set content length to 0 if it's not an error (if it is, an error message will
be printed by the superclass).
  
  Revision  ChangesPath
  1.8   +12 -7 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpResponseImpl.java
  
  Index: HttpResponseImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpResponseImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- HttpResponseImpl.java 2001/02/03 07:48:32 1.7
  +++ HttpResponseImpl.java 2001/03/06 05:07:45 1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpResponseImpl.java,v
 1.7 2001/02/03 07:48:32 remm Exp $
  - * $Revision: 1.7 $
  - * $Date: 2001/02/03 07:48:32 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpResponseImpl.java,v
 1.8 2001/03/06 05:07:45 remm Exp $
  + * $Revision: 1.8 $
  + * $Date: 2001/03/06 05:07:45 $
*
* 
*
  @@ -70,6 +70,7 @@
   import java.io.OutputStream;
   import java.util.ArrayList;
   import javax.servlet.ServletOutputStream;
  +import javax.servlet.http.HttpServletResponse;
   import org.apache.catalina.connector.HttpResponseBase;
   
   
  @@ -78,7 +79,7 @@
*
* @author Craig R. McClanahan
* @author mailto:[EMAIL PROTECTED]">Remy Maucherat
  - * @version $Revision: 1.7 $ $Date: 2001/02/03 07:48:32 $
  + * @version $Revision: 1.8 $ $Date: 2001/03/06 05:07:45 $
*/
   
   final class HttpResponseImpl
  @@ -263,9 +264,13 @@
*/
   public void finishResponse() throws IOException {
   
  -if ((!isStreamInitialized()) && (getContentLength() == -1)
  -&& (getStatus() != SC_NOT_MODIFIED))
  -setContentLength(0);
  +if (getStatus() < HttpServletResponse.SC_BAD_REQUEST) {
  +if ((!isStreamInitialized()) && (getContentLength() == -1)
  +&& (getStatus() != SC_NOT_MODIFIED))
  +setContentLength(0);
  +} else {
  +setHeader("Connection", "close");
  +}
   super.finishResponse();
   
   }
  
  
  

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




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

2001-03-05 Thread remm

remm01/03/05 21:06:40

  Modified:catalina/src/share/org/apache/catalina/connector/http
HttpProcessor.java
  Log:
  - Don't necessarily close the connection if status >= 400.
  
  Revision  ChangesPath
  1.21  +4 -8  
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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- HttpProcessor.java2001/01/23 03:53:00 1.20
  +++ HttpProcessor.java2001/03/06 05:06:40 1.21
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.20 2001/01/23 03:53:00 remm Exp $
  - * $Revision: 1.20 $
  - * $Date: 2001/01/23 03:53:00 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.21 2001/03/06 05:06:40 remm Exp $
  + * $Revision: 1.21 $
  + * $Date: 2001/03/06 05:06:40 $
*
* 
*
  @@ -107,7 +107,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.20 $ $Date: 2001/01/23 03:53:00 $
  + * @version $Revision: 1.21 $ $Date: 2001/03/06 05:06:40 $
*/
   
   final class HttpProcessor
  @@ -853,10 +853,6 @@
   // by the application or the response stream (in case of HTTP/1.0
   // and keep-alive).
   if ( "close".equals(response.getHeader("Connection")) ) {
  -keepAlive = false;
  -}
  -// If the status is an error, the connection is closed
  -if (response.getStatus() >= 400) {
   keepAlive = false;
   }
   
  
  
  

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




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

2001-03-05 Thread remm

remm01/03/05 18:27:44

  Modified:catalina/src/share/org/apache/catalina/servlets
WebdavServlet.java
  Log:
  - Use GMT date for creation date.
  - status isn't a property.
  - Removed some old code.
  
  Revision  ChangesPath
  1.13  +57 -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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- WebdavServlet.java2001/02/01 00:27:10 1.12
  +++ WebdavServlet.java2001/03/06 02:27:44 1.13
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java,v
 1.12 2001/02/01 00:27:10 remm Exp $
  - * $Revision: 1.12 $
  - * $Date: 2001/02/01 00:27:10 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java,v
 1.13 2001/03/06 02:27:44 remm Exp $
  + * $Revision: 1.13 $
  + * $Date: 2001/03/06 02:27:44 $
*
* 
*
  @@ -84,6 +84,7 @@
   import java.util.Locale;
   import java.util.Hashtable;
   import java.util.Calendar;
  +import java.util.TimeZone;
   import java.text.ParseException;
   import java.text.SimpleDateFormat;
   import java.security.MessageDigest;
  @@ -124,7 +125,7 @@
* are handled by the DefaultServlet.
*
* @author Remy Maucherat
  - * @version $Revision: 1.12 $ $Date: 2001/02/01 00:27:10 $
  + * @version $Revision: 1.13 $ $Date: 2001/03/06 02:27:44 $
*/
   
   public class WebdavServlet
  @@ -202,9 +203,14 @@
* Simple date format for the creation date ISO representation (partial).
*/
   protected static final SimpleDateFormat creationDateFormat = 
  -new SimpleDateFormat("-MM-dd'T'HH:mm:ss", Locale.US);
  +new SimpleDateFormat("-MM-dd'T'HH:mm:ss'Z'");
   
   
  +static {
  +creationDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
  +}
  +
  +
   // - Instance Variables
   
   
  @@ -591,12 +597,6 @@
   
   generatedXML.sendData();
   
  -/*
  -Writer writer = resp.getWriter();
  -writer.write(generatedXML.toString());
  -writer.flush();
  -*/
  -
   }
   
   
  @@ -1948,12 +1948,18 @@
   + ""
   + ""
   + "";
  -generatedXML.writeProperty(null, "supportedlock", supportedLocks);
  +generatedXML.writeElement(null, "supportedlock", 
  +  XMLWriter.OPENING);
  +generatedXML.writeText(supportedLocks);
  +generatedXML.writeElement(null, "supportedlock", 
  +  XMLWriter.CLOSING);
   
   generateLockDiscovery(path, generatedXML);
   
   generatedXML.writeElement(null, "prop", XMLWriter.CLOSING);
  -generatedXML.writeProperty(null, "status", status);
  +generatedXML.writeElement(null, "status", XMLWriter.OPENING);
  +generatedXML.writeText(status);
  +generatedXML.writeElement(null, "status", XMLWriter.CLOSING);
   generatedXML.writeElement(null, "propstat", XMLWriter.CLOSING);
   
   break;
  @@ -1986,7 +1992,9 @@
 XMLWriter.NO_CONTENT);
   
   generatedXML.writeElement(null, "prop", XMLWriter.CLOSING);
  -generatedXML.writeProperty(null, "status", status);
  +generatedXML.writeElement(null, "status", XMLWriter.OPENING);
  +generatedXML.writeText(status);
  +generatedXML.writeElement(null, "status", XMLWriter.CLOSING);
   generatedXML.writeElement(null, "propstat", XMLWriter.CLOSING);
   
   break;
  @@ -2076,8 +2084,11 @@
   + ""
   + ""
   + "";
  -generatedXML.writeProperty(null, "supportedlock",
  -   supportedLocks);
  +generatedXML.writeElement(null, "supportedlock", 
  +  XMLWriter.OPENING);
  +generatedXML.writeText(supportedLocks);
  +generatedXML.writeElement(null, "supportedlock", 
  +  XMLWriter.CLOSING);
   } else if (property.equals("lockdiscovery")) {
   if (!generateLockDiscovery(path, generatedXML))
   properti

Re: Assigning Servlets to different ports.

2001-03-05 Thread Mel Martinez


There might be a more 'elegant' way but a simple brute
force solution is to create a simple dispatcher
servlet (or JSP) that does the following:

String host = request.getHeader("HOST");
String port = "80";
if(host.indexOf(":")>-1){
 port = host.substring(host.indexOf(":")+1);
}
//assume getDispatchMap() returns a map of
//ports to servlets, probably loaded from
//a configuration file or whatever
String target = (String)getDispatchMap().get(port);
RequestDispatcher rd =
context.getRequestDispatcher(target);
rd.forward(request,response);

That is a simple dispatcher pattern that should work. 
The only thing you have to do is configure "/" to map
to the above servlet/jsp.  You can do that in a
variety of ways.

The usual caveates and disclaimers apply to the above
code...  :-)
Cheers,

Mel

--- William Wishon <[EMAIL PROTECTED]> wrote:
> Hi,
>   My goal is to be able to have different servlets
> mapped to "/" on different
> ports.  I have not found any way to do this in
> server.xml, so I started
> grep'ing and groveling through the code to find out
> more.  Now as far as I
> can tell right now what I want to do is not possible
> using Tomcat 3.2.1.  My
> question to this list is if anyone here can either
> show me what I've missed
> and tell me how to configure Tomcat to do what I
> want.  Or if someone can
> help me out by pointing me in the right direction in
> terms of patching the
> 3.2.1 sources to do what I want.  Perhaps this is
> now possible in the newer
> versions of tomcat and I could back port a change. 
> Or ???  Any help is
> greatly appreciated.
> 
> An example of what I'm trying to do is to have a GET
> on "/" of port 8080
> return webapps/app1/index.html and a GET of "/" on
> port 8081 return
> webapps/app2/index.html.
> 
> Thanks,
> Bill
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, email:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

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




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

2001-03-05 Thread glenn

glenn   01/03/05 17:43:47

  Modified:catalina/src/share/org/apache/catalina/loader
StandardClassLoader.java
  Log:
  Catch SecurityManager FilePermission AccessControlException
  
  Revision  ChangesPath
  1.12  +22 -13
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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- StandardClassLoader.java  2001/02/18 02:18:13 1.11
  +++ StandardClassLoader.java  2001/03/06 01:43:46 1.12
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardClassLoader.java,v
 1.11 2001/02/18 02:18:13 craigmcc Exp $
  - * $Revision: 1.11 $
  - * $Date: 2001/02/18 02:18:13 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardClassLoader.java,v
 1.12 2001/03/06 01:43:46 glenn Exp $
  + * $Revision: 1.12 $
  + * $Date: 2001/03/06 01:43:46 $
*
* 
*
  @@ -75,6 +75,7 @@
   import java.net.URLConnection;
   import java.net.URLStreamHandlerFactory;
   import java.net.URLStreamHandler;
  +import java.security.AccessControlException;
   import java.security.CodeSource;
   import java.security.PermissionCollection;
   import java.security.Policy;
  @@ -109,7 +110,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.11 $ $Date: 2001/02/18 02:18:13 $
  + * @version $Revision: 1.12 $ $Date: 2001/03/06 01:43:46 $
*/
   
   public class StandardClassLoader
  @@ -643,6 +644,8 @@
log("  super.findClass(" + name + ")");
try {
clazz = super.findClass(name);
  +} catch(AccessControlException ace) {
  + throw new ClassNotFoundException(name);
} catch (RuntimeException e) {
if (debug >= 4)
log("  -->RuntimeException Rethrown", e);
  @@ -673,15 +676,21 @@
   pathname = pathname.substring(5);
   pathname += File.separatorChar +
   name.replace('.', File.separatorChar) + ".class";
  -File file = new File(pathname);
  -if (file.exists() && file.canRead()) {
  -if (debug >= 3)
  -log("Caching from '" + file.getAbsolutePath() +
  -"' modified '" +
  -(new java.sql.Timestamp(file.lastModified())) + "'");
  -classCache.put(name, new ClassCacheEntry(clazz, file,
  - file.lastModified()));
  -}
  + try {
  +File file = new File(pathname);
  +if (file.exists() && file.canRead()) {
  +if (debug >= 3)
  +log("Caching from '" + file.getAbsolutePath() +
  +"' modified '" +
  +(new java.sql.Timestamp(file.lastModified())) +
  + "'");
  +classCache.put(name, new ClassCacheEntry(clazz, file,
  +   file.lastModified()));
  + }
  +} catch(AccessControlException ace) {
  + // Don't worry about caching the class last modified
  + // if ClassLoader doesn't have permission to read file
  + }
   }
   
   // Return the class we have located
  
  
  

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




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

2001-03-05 Thread glenn

glenn   01/03/05 17:42:55

  Modified:catalina/src/share/org/apache/catalina/startup
Bootstrap.java
  Log:
  Add classes directory URL as last URL for ClassLoaders
  
  Revision  ChangesPath
  1.13  +58 -58
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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Bootstrap.java2001/02/21 03:38:47 1.12
  +++ Bootstrap.java2001/03/06 01:42:55 1.13
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Bootstrap.java,v
 1.12 2001/02/21 03:38:47 glenn Exp $
  - * $Revision: 1.12 $
  - * $Date: 2001/02/21 03:38:47 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Bootstrap.java,v
 1.13 2001/03/06 01:42:55 glenn Exp $
  + * $Revision: 1.13 $
  + * $Date: 2001/03/06 01:42:55 $
*
* 
*
  @@ -85,7 +85,7 @@
* class path and therefore not visible to application level classes.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.12 $ $Date: 2001/02/21 03:38:47 $
  + * @version $Revision: 1.13 $ $Date: 2001/03/06 01:42:55 $
*/
   
   public final class Bootstrap {
  @@ -207,24 +207,6 @@
   // Construct the "class path" for this class loader
   ArrayList list = new ArrayList();
   
  -File classes = new File(System.getProperty("catalina.home"),
  -"common/classes");
  -if (classes.exists() && classes.canRead() &&
  -classes.isDirectory()) {
  -try {
  -URL url = new URL("file", null,
  -  classes.getCanonicalPath() + "/");
  -if (debug >= 1) 
  -log("  Adding " + url.toString());
  -list.add(url.toString());
  -} catch (IOException e) {   
  -System.out.println("Cannot create URL for " +
  -   classes.getAbsolutePath());
  -e.printStackTrace(System.out);
  -System.exit(1); 
  -}
  -}
  -
   File directory = new File(System.getProperty("catalina.home"),
 "common/lib");
   if (!directory.exists() || !directory.canRead() ||
  @@ -254,6 +236,24 @@
   }
   }
   
  +File classes = new File(System.getProperty("catalina.home"),
  +"common/classes");
  +if (classes.exists() && classes.canRead() &&
  +classes.isDirectory()) {
  +try {
  +URL url = new URL("file", null,
  +  classes.getCanonicalPath() + "/");
  +if (debug >= 1)
  +log("  Adding " + url.toString());
  +list.add(url.toString());
  +} catch (IOException e) {
  +System.out.println("Cannot create URL for " +
  +   classes.getAbsolutePath());
  +e.printStackTrace(System.out);
  +System.exit(1);
  +}
  +}
  +
   // Construct the class loader itself
   String array[] = (String[]) list.toArray(new String[list.size()]);
   StandardClassLoader loader = new StandardClassLoader(array);
  @@ -275,24 +275,6 @@
   // Construct the "class path" for this class loader
   ArrayList list = new ArrayList();
   
  -File classes = new File(System.getProperty("catalina.home"),
  -"server/classes");
  -if (classes.exists() && classes.canRead() &&
  -classes.isDirectory()) {
  -try {
  -URL url = new URL("file", null,
  -  classes.getCanonicalPath() + "/");
  -if (debug >= 1)
  -log("  Adding " + url.toString());
  -list.add(url.toString());
  -} catch (IOException e) {
  -System.out.println("Cannot create URL for " +
  -   classes.getAbsolutePath());
  -e.printStackTrace(System.out);
  -System.exit(1);
  -}
  -}
  -
   File directory = new File(System.getProperty("catalina.home"),
 "server/lib");
   if (!directory.exists() || !directory.canRead() ||
  @@ -319,6 +301,24 @@
   }
}
   
  +File classes = new File(System.getProperty("catalina.home"),
  +  

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/facade HttpServletRequestFacade.java

2001-03-05 Thread marcsaeg

marcsaeg01/03/05 17:13:05

  Modified:src/share/org/apache/tomcat/facade Tag: tomcat_32
HttpServletRequestFacade.java
  Log:
  The isRequestedSessionIdValid() should be based on the value of
  getRequestedSessionId().  Instead of just checking that getSession(false)
  returns a non-null value (i.e. there is an active session) we must
  also test that the active session's ID matches the requested session id.
  
  PR: 160
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.6.2.1   +6 -4  
jakarta-tomcat/src/share/org/apache/tomcat/facade/Attic/HttpServletRequestFacade.java
  
  Index: HttpServletRequestFacade.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/facade/Attic/HttpServletRequestFacade.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- HttpServletRequestFacade.java 2000/06/19 21:53:13 1.6
  +++ HttpServletRequestFacade.java 2001/03/06 01:13:05 1.6.2.1
  @@ -401,10 +401,12 @@
   }
   
   public boolean isRequestedSessionIdValid() {
  - // so here we just assume that if we have a session it's,
  - // all good, else not.
  - HttpSession session = (HttpSession)request.getSession(false);
  - return (session != null);
  +boolean isvalid = false;
  +HttpSession session = (HttpSession)request.getSession(false);
  +if(session != null && session.getId().equals(getRequestedSessionId()))
  +isvalid = true;
  +
  +return isvalid;
   }
   
   /** Adapter - Request uses getSessionIdSource
  
  
  

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




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

2001-03-05 Thread marcsaeg

marcsaeg01/03/05 17:09:52

  Modified:src/share/org/apache/tomcat/core Tag: tomcat_32
RequestImpl.java
  Log:
  HttpServletRequest.getSession() should not alter the value of
  the originaly requested session id (if there was one).
  
  PR: 160
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.52.2.6  +1 -2  
jakarta-tomcat/src/share/org/apache/tomcat/core/Attic/RequestImpl.java
  
  Index: RequestImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Attic/RequestImpl.java,v
  retrieving revision 1.52.2.5
  retrieving revision 1.52.2.6
  diff -u -r1.52.2.5 -r1.52.2.6
  --- RequestImpl.java  2001/01/13 01:08:27 1.52.2.5
  +++ RequestImpl.java  2001/03/06 01:09:51 1.52.2.6
  @@ -481,8 +481,7 @@
return null;
}
   
  - reqSessionId = serverSession.getId();
  - response.setSessionId( reqSessionId );
  + response.setSessionId( serverSession.getId() );
   
return serverSession;
   }
  
  
  

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




Re: [GUMP] Build Failure - Tomcat 3.x

2001-03-05 Thread Sam Ruby

Costin Manolache wrote:
>
> Well, tomcat depends on having ant binaries ( in the normal
> format ) in ant.home.

Turns out I had made a change in the jakarta-ant definition (in order to
work around another problem), so the ant.home I was passing in the
jakarta-tomcat build was not valid.

My bug.  Should be fixed tonight.

> BTW, Sam - you are right about the need to test the latest ( i.e.
> CVS top dir ) - it's an excelent way to find any interface or
> layout change that may affect other projects, and maintain
> backward compatibility.

Not everybody gets this right away.  I'm still receiving pushback in a few
corners.

> ( I still believe we need a separate build using the "latest
> stable" - for a different purpose )

The more variations tested, the better.

- Sam Ruby


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




Re: [TOMCAT 4.x SSI] Update

2001-03-05 Thread Hans Bergsten

Bip Thelin wrote:
> 
> Hans Bergsten wrote:
> >
> > Sorry, I should have commented on this earlier. It seems like you could save
> > a lot of time on this by porting the JSSI package (from java,apache.org)
> > instead of implementing SSI from scratch. I did that not too long ago for
> > Tomcat 3.2. For Tomcat 4, it would be a little bit different but the majority of
> > the code would be the same.
> > [...]
> 
> I haven't seen the JSSI package before but it seem's more focused on supporting
> ".jhtml" than the "normal" SSI (.shtml). I don't know if it's easier to port it
> and write up those SSI commands that are missing, like 'exec' for instance. Anyway
> it will serve as a good ground for ".jhtml" support.

JSSI supports most of the NCSA SSI commands as well as the  tag for
invoking servlets. In addition, it implements a number of configurable settings,
such as expiration time, buffering, (and server-side caching, I believe) etc.

Most importantly, people who come to Tomcat from JServ are primarily interested
in getting the same SSI support as they had in JServ. So in addition to saving
on the initial implementation time by porting JSSI instead of starting from
scratch,
you will also end up with the SSI functionality the majority of the users
expect.

So I strongly suggest that you port JSSI. Most of it can be used as is. The only
things that need to be tweaked are probably using resources instead of File,
and using a different interface to ask Tomcat to load servlets. You may even
drop support for the class and init parameters in the  tag, and then
get away with just using the standard features in Servlet 2.3:
getNamedDispatcher()
plus a request wrapper that merges the original parameters with the ones
specified
in the  tag.

Hans
-- 
Hans Bergsten   [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com

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




RE: Spec Compliance: getRequestedSessionId(), ...

2001-03-05 Thread Marc Saegesser

The Servlet 3.2 API spec (PFD) attempts to clarify this some, but I think
muddles it even further with some truly odd wording.

I'm going to fix this in 3.2.2 unless I hear something contrary from the
serlvet-api folks.  Its kind of late in the game for code changes to 3.2.2
but I really hate known spec failures.

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Hans
> Bergsten
> Sent: Monday, March 05, 2001 6:32 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Spec Compliance: getRequestedSessionId(), ...
>
>
> Marc Saegesser wrote:
> >
> > I'm reviewing Bugzilla bugs in preparation of the Tomcat 3.2.2 release.
> > Bugzilla 160 has been open since Tomcat 3.1 and it looks like
> its real and
> > that it violates the Servlet 2.2 spec.
> >
> > I want to make sure I am correctly interpretting the spec
> before I dig too
> > deep.  I'll send a similar message to the servlet api mailing list.
> >
> > 1)  HttpServletRequest.getRequestedSessionId() should return the session
> > that arrived with the request.  This might not match the
> session id returned
> > by HttpServletRequest.getSession()because the session might have been
> > invalidated or timed out, etc.  So far so good.  What isn't
> clear (at least
> > from reading the code) is should calling HttpServletRequest.getSession()
> > modify the requested session id.  I think that it shouldn't but
> the code in
> > RequestImpl.java updates the requested session id.  A quick look at the
> > Tomcat 3.3 version appears to work as I expected it to.
>
> Your interpretation of the spec is the same as mine: Calling getSession()
> should not modify the *requested* session ID. In other words, you need to
> keep track of both the requested and the actual session ID to implement
> these methods.
>
> > 2)  A related question,
> HttpServletRequest.isRequestedSessionIdValid() is
> > implemented as follows:
> >
> > HttpSession session = (HttpSession)request.getSession(false);
> > return (session != null);
> >
> > If this method is called *before* the invoking servlet calls
> > getSession(true) then it will correctly determine if the
> *requested* session
> > id was valid.  After that it will always return true.  This seems wrong
> > because specification clearly states this method determines if
> the requested
> > session id was valid.  Tomcat 3.3 appears to suffer from this problem.
>
> Again, my interpretation is the same as yours. You should test if the
> requested session is the same as the actual session instead.
>
> Hans
> --
> Hans Bergsten [EMAIL PROTECTED]
> Gefion Software   http://www.gefionsoftware.com
> Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]


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




Re: Spec Compliance: getRequestedSessionId(), ...

2001-03-05 Thread Hans Bergsten

Marc Saegesser wrote:
> 
> I'm reviewing Bugzilla bugs in preparation of the Tomcat 3.2.2 release.
> Bugzilla 160 has been open since Tomcat 3.1 and it looks like its real and
> that it violates the Servlet 2.2 spec.
> 
> I want to make sure I am correctly interpretting the spec before I dig too
> deep.  I'll send a similar message to the servlet api mailing list.
> 
> 1)  HttpServletRequest.getRequestedSessionId() should return the session
> that arrived with the request.  This might not match the session id returned
> by HttpServletRequest.getSession()because the session might have been
> invalidated or timed out, etc.  So far so good.  What isn't clear (at least
> from reading the code) is should calling HttpServletRequest.getSession()
> modify the requested session id.  I think that it shouldn't but the code in
> RequestImpl.java updates the requested session id.  A quick look at the
> Tomcat 3.3 version appears to work as I expected it to.

Your interpretation of the spec is the same as mine: Calling getSession()
should not modify the *requested* session ID. In other words, you need to
keep track of both the requested and the actual session ID to implement
these methods.

> 2)  A related question, HttpServletRequest.isRequestedSessionIdValid() is
> implemented as follows:
> 
> HttpSession session = (HttpSession)request.getSession(false);
> return (session != null);
> 
> If this method is called *before* the invoking servlet calls
> getSession(true) then it will correctly determine if the *requested* session
> id was valid.  After that it will always return true.  This seems wrong
> because specification clearly states this method determines if the requested
> session id was valid.  Tomcat 3.3 appears to suffer from this problem.

Again, my interpretation is the same as yours. You should test if the
requested session is the same as the actual session instead.

Hans
-- 
Hans Bergsten   [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com

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




Re: [GUMP] Build Failure - Tomcat 3.x

2001-03-05 Thread cmanolache

> I can fix by specifying ant.home.  What tomcat depends on is the
> distribution layout, i.e., "../jakarta-ant/dist".

Well, tomcat depends on having ant binaries ( in the normal format ) 
in ant.home.

The convention used is that "foo.home" is the place where a foo
distribution is installed, it has nothing to do with the source or 
build structure.

BTW, Sam - you are right about the need to test the latest ( i.e. CVS top 
dir ) - it's an excelent way to find any interface or layout change that
may affect other projects, and maintain backward compatibility. 
Whenever I find some time I'll start using gump with the full
dependencies.

( I still believe we need a separate build using the "latest stable" - 
for a different purpose )

Costin


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




Assigning Servlets to different ports.

2001-03-05 Thread William Wishon

Hi,
My goal is to be able to have different servlets mapped to "/" on different
ports.  I have not found any way to do this in server.xml, so I started
grep'ing and groveling through the code to find out more.  Now as far as I
can tell right now what I want to do is not possible using Tomcat 3.2.1.  My
question to this list is if anyone here can either show me what I've missed
and tell me how to configure Tomcat to do what I want.  Or if someone can
help me out by pointing me in the right direction in terms of patching the
3.2.1 sources to do what I want.  Perhaps this is now possible in the newer
versions of tomcat and I could back port a change.  Or ???  Any help is
greatly appreciated.

An example of what I'm trying to do is to have a GET on "/" of port 8080
return webapps/app1/index.html and a GET of "/" on port 8081 return
webapps/app2/index.html.

Thanks,
Bill


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




Re: [GUMP] Build Failure - Tomcat 3.x

2001-03-05 Thread Sam Ruby

Costin Manolache wrote:
>
> Is there any reasonable explanation for changing the ant
> structure ( i.e. removing ant/bin ) ? Besides breaking
> backward compatibility and forcing people to change their
> scripts

I can fix by specifying ant.home.  What tomcat depends on is the
distribution layout, i.e., "../jakarta-ant/dist".

The bootstrap used to build such  a distribution layout "in place", but
this got unweildy - the JVM barfed when if found its jars being updated in
place...

- Sam Ruby


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




RE: cvs commit: jakarta-tomcat/src/share/org/apache/jasper/runtime BodyContentImpl.java

2001-03-05 Thread Andrew Gilbert

Thanks.

I missed the obvious in the double array copy. Still, by doubling the buffer
size each time instead of incrementally increasing we are getting double the
speed with our degenerate test case.

1. Original - 22 seconds
2. As patched here - 13 seconds
3. With doubling of buffer as well - 6 seconds

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 03, 2001 10:26 PM
To: [EMAIL PROTECTED]
Subject: cvs commit: jakarta-tomcat/src/share/org/apache/jasper/runtime
BodyContentImpl.java


marcsaeg01/03/03 19:26:22

  Modified:src/share/org/apache/jasper/runtime Tag: tomcat_32
BodyContentImpl.java
  Log:
  BodyContentImpl.java

  Revision  ChangesPath
  No   revision


  No   revision


  1.6.6.1   +6 -8
jakarta-tomcat/src/share/org/apache/jasper/runtime/BodyContentImpl.java

  Index: BodyContentImpl.java
  ===
  RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/BodyContentImpl
.java,v
  retrieving revision 1.6
  retrieving revision 1.6.6.1
  diff -u -r1.6 -r1.6.6.1
  --- BodyContentImpl.java  1999/11/13 00:32:51 1.6
  +++ BodyContentImpl.java  2001/03/04 03:26:21 1.6.6.1
  @@ -88,7 +88,7 @@
   super(writer);
cb = new char[bufferSize];
nextChar = 0;
  -}
  +  }

   /**
* Write a single character.
  @@ -107,19 +107,19 @@
   //Need to re-allocate the buffer since it is to be
//unbounded according to the updated spec..

  -char[] tmp = new char [bufferSize];
  - System.arraycopy(cb, 0, tmp, 0, cb.length);
  +char[] tmp = null;

//XXX Should it be multiple of DEFAULT_BUFFER_SIZE??

if (len <= Constants.DEFAULT_BUFFER_SIZE) {
  - cb = new char [bufferSize + Constants.DEFAULT_BUFFER_SIZE];
  + tmp = new char [bufferSize + Constants.DEFAULT_BUFFER_SIZE];
bufferSize += Constants.DEFAULT_BUFFER_SIZE;
} else {
  - cb = new char [bufferSize + len];
  + tmp = new char [bufferSize + len];
bufferSize += len;
}
  - System.arraycopy(tmp, 0, cb, 0, tmp.length);
  + System.arraycopy(cb, 0, tmp, 0, cb.length);
  + cb = tmp;
tmp = null;
   }

  @@ -499,8 +499,6 @@

   public void clear() throws IOException {
   synchronized (lock) {
  -cb = new char [Constants.DEFAULT_BUFFER_SIZE];
  - bufferSize = Constants.DEFAULT_BUFFER_SIZE;
nextChar = 0;
}
   }




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


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




Spec Compliance: getRequestedSessionId(), ...

2001-03-05 Thread Marc Saegesser

I'm reviewing Bugzilla bugs in preparation of the Tomcat 3.2.2 release.
Bugzilla 160 has been open since Tomcat 3.1 and it looks like its real and
that it violates the Servlet 2.2 spec.

I want to make sure I am correctly interpretting the spec before I dig too
deep.  I'll send a similar message to the servlet api mailing list.

1)  HttpServletRequest.getRequestedSessionId() should return the session
that arrived with the request.  This might not match the session id returned
by HttpServletRequest.getSession()because the session might have been
invalidated or timed out, etc.  So far so good.  What isn't clear (at least
from reading the code) is should calling HttpServletRequest.getSession()
modify the requested session id.  I think that it shouldn't but the code in
RequestImpl.java updates the requested session id.  A quick look at the
Tomcat 3.3 version appears to work as I expected it to.

2)  A related question, HttpServletRequest.isRequestedSessionIdValid() is
implemented as follows:

HttpSession session = (HttpSession)request.getSession(false);
return (session != null);

If this method is called *before* the invoking servlet calls
getSession(true) then it will correctly determine if the *requested* session
id was valid.  After that it will always return true.  This seems wrong
because specification clearly states this method determines if the requested
session id was valid.  Tomcat 3.3 appears to suffer from this problem.


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




Re: [GUMP] Build Failure - Tomcat 3.x

2001-03-05 Thread cmanolache

> BUILD FAILED
> 
> /home/rubys/jakarta/jakarta-tomcat/build.xml:75: 
>/home/rubys/jakarta/jakarta-ant/build/bin not found.

Well, I can fix this - but as the comment says, ant is needed for testing
and various other tasks.

Is there any reasonable explanation for changing the ant structure ( i.e. 
removing ant/bin ) ? Besides breaking backward compatibility and forcing
people to change their scripts ?  

Costin


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




[GUMP] Build Failure - Tomcat 3.x

2001-03-05 Thread Sam Ruby


This email is autogenerated from the output from:



Buildfile: build.xml

init:

prepare:
[mkdir] Created dir: /home/rubys/jakarta/build/tomcat
[mkdir] Created dir: /home/rubys/jakarta/build/tomcat/classes
[mkdir] Created dir: /home/rubys/jakarta/build/tomcat/conf
[mkdir] Created dir: /home/rubys/jakarta/build/tomcat/src
[mkdir] Created dir: /home/rubys/jakarta/build/tomcat/lib
[mkdir] Created dir: /home/rubys/jakarta/build/tomcat/lib/apps
[mkdir] Created dir: /home/rubys/jakarta/build/tomcat/lib/container
[mkdir] Created dir: /home/rubys/jakarta/build/tomcat/lib/common
[mkdir] Created dir: /home/rubys/jakarta/build/tomcat/logs
[mkdir] Created dir: /home/rubys/jakarta/build/tomcat/bin
[mkdir] Created dir: /home/rubys/jakarta/build/tomcat/doc
[mkdir] Created dir: /home/rubys/jakarta/build/tomcat/webapps
[mkdir] Created dir: /home/rubys/jakarta/build/tomcat/native
 [copy] Copying 10 files to /home/rubys/jakarta/build/tomcat/bin
 [copy] Copying 19 files to /home/rubys/jakarta/build/tomcat/conf
 [copy] Copying 42 files to /home/rubys/jakarta/build/tomcat/doc
 [copy] Copying 85 files to /home/rubys/jakarta/build/tomcat/native
 [copy] Copying 1 file to /home/rubys/jakarta/build/tomcat

BUILD FAILED

/home/rubys/jakarta/jakarta-tomcat/build.xml:75: 
/home/rubys/jakarta/jakarta-ant/build/bin not found.

Total time: 11 seconds

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




cvs commit: jakarta-tomcat/src/build/nightly README functions_build.sh

2001-03-05 Thread larryi

larryi  01/03/05 13:25:44

  Modified:src/build/nightly README functions_build.sh
  Log:
  build.xml copies jaxp.jar and parser.jar to the "lib/container" directory.
  I don't think we need these copies in the "lib" directory anymore.  The
  watchdog-servlet.xml script was updated to look in "lib/container".
  
  Revision  ChangesPath
  1.3   +1 -1  jakarta-tomcat/src/build/nightly/README
  
  Index: README
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/build/nightly/README,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- README2001/02/03 16:08:25 1.2
  +++ README2001/03/05 21:25:41 1.3
  @@ -59,7 +59,7 @@
   Build Functions
   ===
   
  -build_tomcat SUFIX TARGET -> build, add jaxp1.0 and zip the result
  +build_tomcat SUFIX TARGET -> build and zip the result
   ant_build REPOSITORY DISTNAME LOGFILE TARGET -> use ant to build 
 repository ( jakarta-tomcat ) into DISTNAME ( tomcat ), 
  with log ( build-full.log ) and using TARGET ( main )
  
  
  
  1.3   +1 -2  jakarta-tomcat/src/build/nightly/functions_build.sh
  
  Index: functions_build.sh
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/build/nightly/functions_build.sh,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- functions_build.sh2001/02/03 16:08:25 1.2
  +++ functions_build.sh2001/03/05 21:25:42 1.3
  @@ -179,13 +179,12 @@
 cp $ANT_HOME/lib/jaxp.jar $WS/dist/tomcat/lib
   }
   
  -## Will build tomcat, copy the jaxp files, and zip the result
  +## Will build tomcat and zip the result
   build_tomcat() {
 SUFIX=$1
 TARGET=$2
 
 ant_build jakarta-tomcat tomcat tomcat-build-$SUFIX.log $TARGET
  -  fix_tomcat
 zip_dist tomcat tomcat-$SUFIX 
   }
   
  
  
  

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




RE: Patch for HTTP protocol bug in jakarta-apache

2001-03-05 Thread Marc Saegesser

What version are you using?  I've verified that the reason phrase is being
sent back on all the tests that I've run.  Do you have a specific example of
a request that doesn't work?  Include a packet capture if possible.

> -Original Message-
> From: David Campbell [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 05, 2001 1:47 PM
> To: [EMAIL PROTECTED]
> Subject: Patch for HTTP protocol bug in jakarta-apache
>
>
> Hi,
>
> I would like to contribute the diff below, that should correct a current
> HTTP protocol violation in virtually every request served by
> jakarta-apache,
> and prevents jakarta-apache URLs being opened by various strict HTTP
> clients such as PHP and Yospace SmartPhone WAP browser.
>
> The problem has been in the bug database for some time at
> http://znutar.cortexity.com/BugRatViewer/ShowReport/151
>
> Basically the problem is that jakarta-tomcat responses return:
> HTTP/1.1 200
> but does not have a space character after the Status-Code (ie the 200),
> which is required by the spec, even if the Reason-Phrase is the
> empty string:
>
> From the HTTP spec:
> 6.1 Status-Line
>
>The first line of a Response message is the Status-Line, consisting
>of the protocol version followed by a numeric status code and its
>associated textual phrase, with each element separated by SP
>characters. No CR or LF is allowed except in the final
> CRLF sequence.
>
>Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
>
> --
> ---
> The diff for
> jakarta-tomcat/src/share/org/apache/tomcat/service/http/Attic/Http
ResponseAdapter.java
>
> diff -r1.11.2.1 HttpResponseAdapter.java
> 134a135
> >   printHead(" ");
> 136d136
> <   printHead(" ");
>
> Note, I don't have a build environment, so this is untested by
> me, but it should work.
>
> Please CC me directly with any e-mails because I'm not on the list.
>
> --
> Regards,
> -- Dave Campbell
>PHONE AUS  07 3216 6015
>PHONE INTL +61 7 3216 6015
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]


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




Patch for HTTP protocol bug in jakarta-apache

2001-03-05 Thread David Campbell

Hi,

I would like to contribute the diff below, that should correct a current
HTTP protocol violation in virtually every request served by jakarta-apache,
and prevents jakarta-apache URLs being opened by various strict HTTP
clients such as PHP and Yospace SmartPhone WAP browser.

The problem has been in the bug database for some time at
http://znutar.cortexity.com/BugRatViewer/ShowReport/151

Basically the problem is that jakarta-tomcat responses return:
HTTP/1.1 200
but does not have a space character after the Status-Code (ie the 200),
which is required by the spec, even if the Reason-Phrase is the empty string:

From the HTTP spec:
6.1 Status-Line

   The first line of a Response message is the Status-Line, consisting
   of the protocol version followed by a numeric status code and its
   associated textual phrase, with each element separated by SP
   characters. No CR or LF is allowed except in the final CRLF sequence.

   Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF

-
The diff for 
jakarta-tomcat/src/share/org/apache/tomcat/service/http/Attic/HttpResponseAdapter.java

diff -r1.11.2.1 HttpResponseAdapter.java
134a135
>   printHead(" ");
136d136
<   printHead(" ");

Note, I don't have a build environment, so this is untested by me, but it should work.

Please CC me directly with any e-mails because I'm not on the list.

--
Regards,
-- Dave Campbell
   PHONE AUS  07 3216 6015
   PHONE INTL +61 7 3216 6015



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




Re: [TOMCAT 4.x SSI] Update

2001-03-05 Thread Bip Thelin

Hans Bergsten wrote:
> 
> Sorry, I should have commented on this earlier. It seems like you could save
> a lot of time on this by porting the JSSI package (from java,apache.org)
> instead of implementing SSI from scratch. I did that not too long ago for
> Tomcat 3.2. For Tomcat 4, it would be a little bit different but the majority of
> the code would be the same.
> [...]

I haven't seen the JSSI package before but it seem's more focused on supporting
".jhtml" than the "normal" SSI (.shtml). I don't know if it's easier to port it
and write up those SSI commands that are missing, like 'exec' for instance. Anyway
it will serve as a good ground for ".jhtml" support.

Thanks, Bip

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




cvs commit: jakarta-tomcat changes3.3

2001-03-05 Thread melaquias

melaquias01/03/05 11:52:15

  Modified:.changes3.3
  Log:
  no message
  
  Revision  ChangesPath
  1.7   +15 -0 jakarta-tomcat/changes3.3
  
  Index: changes3.3
  ===
  RCS file: /home/cvs/jakarta-tomcat/changes3.3,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- changes3.32001/01/28 20:49:54 1.6
  +++ changes3.32001/03/05 19:52:14 1.7
  @@ -98,6 +98,11 @@
   - refactoring of session - use Interceptors for full access to all request
   stages, keep tomcat-independent code separated and reusable.
   
  + MODULES 
  +
  +- ApacheConfig now has optional attibutes to configure various paths
  +used in auto-generated config files for jserv and mod_jk.
  +
    UTILS 
   
   - consolidation/refactoring of all tomcat-independent and general-purpose/
  @@ -108,6 +113,16 @@
   
    BUILD/STARTUP 
   
  +- org.apache.tomcat.startup.Main now builds 3 distinct class loaders: (1)
  +one to be used only by the servlet container.  (2) one to be shared by all
  +web applications and (3) one that is common to both the above.
  +
  +- TOMCAT_HOME/lib now sports three subdirectories: apps/, container/ and
  +common/ in which jar files can be placed that will be automatically loaded
  +into the correct classloaders.  In addition, classes can be made available
  +to the 'apps' and 'common' classloaders by including them in the classpath
  +properties "-Dorg.apache.tomcat.apps.classpath" and 
  +"-Dorg.apache.tomcat.common.classpath", respectively.
   - generate separate jar files for each component ( utils, core, facade, 
   modules ) That insures the layers are properly separated, utils can be reused.
   
  
  
  

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




Re: [TOMCAT 4.x SSI] Update

2001-03-05 Thread Hans Bergsten

Bip Thelin wrote:
> 
> Here's an update of the SSI package I submitted a week ago. The "only" SSI
> command that has been added is 'echo', example. .
> [...]

Sorry, I should have commented on this earlier. It seems like you could save
a lot of time on this by porting the JSSI package (from java,apache.org)
instead of implementing SSI from scratch. I did that not too long ago for
Tomcat 3.2. For Tomcat 4, it would be a little bit different but the majority of
the code would be the same. 

I sent my code and comments about how it could be done to Craig when he said 
he had someone lined up to start working on it a few weeks ago. Just let me 
know if you want a copy.

Hans
-- 
Hans Bergsten   [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com

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




Re: Using Tomcat4.0 (CVS) with xerces

2001-03-05 Thread jean-frederic clere

"Craig R. McClanahan" wrote:
> 
> jean-frederic clere wrote:
> 
> > Hi,
> >
> > There is (still) a problem using xerces with Tomcat4.0:
> 
> Could you expand on precisely what JAR files you have in what directories
> when it fails, and when it succeeds?


The result of build.sh gives the following jar files:
+++
./bin/bootstrap.jar
./lib/namingfactory.jar
./lib/jasper-runtime.jar
./common/lib/servlet.jar
./common/lib/naming.jar
./common/lib/jndi.jar
./server/lib/jaxp.jar
./server/lib/jakarta-regexp-1.2.jar
./server/lib/jakarta-regexp-1.3-dev.jar
./server/lib/xerces.jar
./server/lib/catalina.jar
./server/lib/warp.jar
./jasper/xerces.jar
./jasper/jaxp.jar
./jasper/jasper-compiler.jar
+++

And starting Tomcat fails, catalina.out contains:
+++
Exception during startup processing
java.lang.reflect.InvocationTargetException:
javax.xml.parsers.FactoryConfigurationError:
org.apache.crimson.jaxp.SAXParserFactoryImpl
at
javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:95)
at
org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:224)
at org.apache.catalina.startup.Catalina.start(Catalina.java:657)
at
org.apache.catalina.startup.Catalina.execute(Catalina.java:627)
at
org.apache.catalina.startup.Catalina.process(Catalina.java:177)
at java.lang.reflect.Method.invoke(Native Method)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:177)   
+++
To fix it, I have removed
./server/lib/jaxp.jar  


>  The test case that I know works
> correctly (at least for my tests) is to leave Jasper using JAXP/1.1 as it
> does by default, and stick xerces.jar in your WEB-INF/lib directory.
> 
> In general, you would use "jaxp.jar" *and* "crimson.jar" if you wanted to
> use JAXP/1.1, and *only* "xerces.jar" if you wanted to use xerces.  However,
> last time I checked Xerces did not have complete support for the JAXP 1.1
> APIs, so you would not be able to use it  for JSP pages in the XML syntax.

So that could be the reason why I have got the exception:
+++
A Servlet Exception Has Occurred
Exception Report:
javax.servlet.ServletException:
javax.xml.transform.TransformerException: SAX Exception
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:441)
at org.apache.jsp.book_jsp._jspService(book_jsp.java:103)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:200)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:357)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:431)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
+++
When I try to use xsl tags from jakarta-tablibs.

Cheers

Jean-frederic

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

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




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-03-05 Thread larryi

larryi  01/03/05 09:38:47

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  Remove use of "tomcat.cp" system property which has been replaced
  by "org.apache.tomcat.apps.classpath" and
  "org.apache.tomcat.common.classpath" system properties.
  
  Submitted by: William Barker
  
  Revision  ChangesPath
  1.29  +2 -15 jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- Main.java 2001/03/04 22:38:14 1.28
  +++ Main.java 2001/03/05 17:38:44 1.29
  @@ -1,4 +1,4 @@
  -/* $Id: Main.java,v 1.28 2001/03/04 22:38:14 melaquias Exp $
  +/* $Id: Main.java,v 1.29 2001/03/05 17:38:44 larryi Exp $
* 
*
* The Apache Software License, Version 1.1
  @@ -107,7 +107,7 @@
@author Costin Manolache
@author Ignacio J. Ortega
@author Mel Martinez [EMAIL PROTECTED]
  - @version $Revision: 1.28 $ $Date: 2001/03/04 22:38:14 $
  + @version $Revision: 1.29 $ $Date: 2001/03/05 17:38:44 $
*/
   public class Main{
   
  @@ -428,19 +428,6 @@
   urlV.addElement( getURL(  p0 , cpComp[i] ));
   }
   }
  - // add CLASSPATH
  - String cpath=System.getProperty( "tomcat.cp");
  - if( cpath!=null ) {
  - System.out.println("Extra CLASSPATH: " + cpath);
  - String pathSep=System.getProperty( "path.separator");
  - StringTokenizer st=new StringTokenizer( cpath, pathSep );
  - while( st.hasMoreTokens() ) {
  - String path=st.nextToken();
  - urlV.addElement( getURL( path, "" ));
  - }
  - }
  -
  -
   }catch(Exception ex){
   ex.printStackTrace();
   }
  
  
  

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




cvs commit: jakarta-tomcat/src/admin/WEB-INF/scripts watchdog-servlet.xml

2001-03-05 Thread larryi

larryi  01/03/05 09:32:21

  Modified:src/admin/WEB-INF/scripts watchdog-servlet.xml
  Log:
  Update for Jaxp's new location.
  
  Revision  ChangesPath
  1.3   +2 -2  jakarta-tomcat/src/admin/WEB-INF/scripts/watchdog-servlet.xml
  
  Index: watchdog-servlet.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/admin/WEB-INF/scripts/watchdog-servlet.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- watchdog-servlet.xml  2001/02/13 05:34:02 1.2
  +++ watchdog-servlet.xml  2001/03/05 17:32:20 1.3
  @@ -19,9 +19,9 @@


  + path="../../../../lib/container/jaxp.jar" />

  + path="../../../../lib/container/parser.jar" />
 
 
 
  
  
  

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




[TC4] Proposed change to Session interface

2001-03-05 Thread Richard Frazer

Hello,

I've been working lately on integrating Tomcat into our server.  In order to
do so, we need to generate our own session ids.  Therefore we need our own
Manager implementation.

Since we've got our own Manager, we'd like to assign that Manager to the
Engine or the Host instead of to each Context like Tomcat does by default.
This way we can construct the Manager ourselves and assign it and let all
the Contexts inherit it without changing any Tomcat code.  The problem,
however, is in the StandardSession code, where it fires off the
ContextListeners during session creation, session change, and session
termination.  The code in StandardSession assumes that the Container of its
Manager is a Context, when this is not an obvious restriction.  In fact, the
code supports any Container holding a Context.  Then, all of its children
inherit it.

I would like to propose a change to the Session interface to assign a
Context to it (setContext(), getContext()).  A session is logically mapped
to a Context, so this is not a drastic change.  Also, the listeners on the
Context can be fired without worrying about a ClassCastException.  Two
changes would have to happen.  The ContextListeners would be fired from
setContext() instead of setId(), and the Request object would have to call
setContext() after it calls createSession().

I can send some diffs out if anybody is interested.

Regards,
Richard


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




Re: Some benchmarks

2001-03-05 Thread Pier P. Fumagalli

Rick Knowles <[EMAIL PROTECTED]> wrote:
>
> They were in the process of switching to Catalina when I spoke to them.
> 
> Moral of the story is  well done guys :).

And... KUDOS to Craig :) :) :)

Pier

-- 

Pier Fumagalli    


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




cvs commit: jakarta-tomcat/src/doc readme

2001-03-05 Thread marcsaeg

marcsaeg01/03/05 06:26:36

  Modified:src/doc  Tag: tomcat_32 readme
  Log:
  Updates for 3.2.2.
  
  Why do we have two release notes files (doc/readme and RELEASE-NOTES)
  and why are they different?
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.8.2.13  +57 -14jakarta-tomcat/src/doc/readme
  
  Index: readme
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/doc/readme,v
  retrieving revision 1.8.2.12
  retrieving revision 1.8.2.13
  diff -u -r1.8.2.12 -r1.8.2.13
  --- readme2001/02/16 04:13:16 1.8.2.12
  +++ readme2001/03/05 14:26:29 1.8.2.13
  @@ -1,8 +1,8 @@
  -$Id: readme,v 1.8.2.12 2001/02/16 04:13:16 marcsaeg Exp $
  +$Id: readme,v 1.8.2.13 2001/03/05 14:26:29 marcsaeg Exp $
   
   Release Notes for:
  
  -   TOMCAT Version 3.2.1
  +   TOMCAT Version 3.2.2
  
   
   
  @@ -124,7 +124,7 @@
   Please note the following information about this implementation:
   
   - BASIC and FORM based authentication should work correctly.  Please
  -  report any bugs you encounter here at .
  +  report any bugs you encounter here at .
 The example application has a protected area defined at the following URL:
   
http://localhost:8080/examples/jsp/security/protected
  @@ -289,22 +289,65 @@
   
   where "r:" is mapped to this share.
   
  -6.11 Misconfiguration Can Cause CPU-Bound Loop
   
  -If you misconfigure Tomcat 3.2 in a way that there is no valid context to
  -handle a request (such as removing the root context and then attempting a
  -request that should be handled by that context), Tomcat will enter a CPU-bound
  -loop instead of responding with a 404 error.
  +===
  +7.  FIXES AND ENHANCEMENTS IN UPDATES
   
  -Workaround:  kill the offending Tomcat process and correct your server.xml
  -file such that there is a properly configured root context.
   
  +7.1 Fixes and Enhancements in Release 3.2.2
   
  -===
  -7.  SECURITY VULNERABILITIES FIXED IN TOMCAT 3.2.1
  +This section highlights the bugs fixed in this release.  In addition to
  +these, there have been many other minor bug fixes through the product.
  +
  +Documentation
  +  -  Several updates to how-to documents and users guide.
  +
  +Servlet
  +  -  Fix infinite loop if no prefix matches the request URI.  Now returns
  + a 404 error.
  +  -  Handle UnavailableException in included servlets.
  +  -  User principle was incorrectly maintained.  (#757)
  +  -  Use access control for forward() and include() when security manager
  + is being used.
  +  -  Properly interpret url-patterns inside security-contraints.  (#567)
  +  -  Fix authentication with Sybase ASE 11.9.2 and Interbase.
  +  -  reqeust.getPort() now returns the correct port when using SSL. (#743)
  +  -  Fix problem accessing via HTTP without protocol. (#513)
  +  -  Fix JSP source disclosure problem.  (#619)
  +  -  ServletRequest.getProtocol() could contain a CRLF.  (#620)
  +  -  Better initialization of psuedo-random number generator improves
  + response time for first request that generates a session.
  +  -  Fix session tracking through forward().  (#504)
  +
  +Jasper
  +  -  Fix for UnsupportedEncodingException due to UTF8 instead of UTF-8.  (#269)
  +  -  Support compiling with debug information.
  +  -  If JSP source file is removed, then generated files are removed
  + and subsequent requests return a 404 error. (#698)
  +  -  Fix compile error with more than one set of tags with the same 
  + name. (#540)
  +  -  Support for non 8859-1 character encodings for included pages.
  +  -  Better error reporting if compile fails due to missing tag library.
  +  -  Fix thread synchronization problem that can cause page compilation to 
  + fail (#44).
  +  
  +
  +Connectors
  +  -  Fix infinite loop on invalid content-length for ajp12.  (#264)
  +  -  Fix infinite llop if Tomcat connector closed connection.  (#510)
  +  -  For ajp13 protocol, add support for multipart form encoding
  + and file uploads now work.
  +  -  Reading session ids from cookies in the load balancer. (#603) 
  +
  +  IIS
  + -  Better error logging for startup failures.
  +  NetWare
  + -  Fix for netbuf_getbytes() not supported on NetWare 5.1.
  +
   
  +7.2 Security vulnerabilities fixed in Tomcat 3.2.1
   
  -7.1 Protection of Resources in /WEB-INF and /META-INF Directories
  +7.2.1 Protection of Resources in /WEB-INF and /META-INF Directories
   
   The servlet specification prohibits servlet containers from servi

cannot instantiate class exception in Realm

2001-03-05 Thread DUDGEON

I posted this to tomcat-user but got no replies.
Perhaps tomcat-dev is more appropriate, as it is a programming problem. Can
anyone help?

Although I've been using tomacat for sometime, I'm now needeing to start on
some work to match up the authentication and authorisation within catalina
to our enviroment. To do this I'm putting together a LDAPRealm. I have a
rudimentary LDAPRealm that works fine on its own (outside catalina), but
when I run it within catalina I'm getting a cannot instantiate class
exception from within my code. Could someone give me a guide into what I'm
doing worong. It's probably pretty basic, but I'm new to this.

What I did:

created a org.apache.catalina.realm.MyRealm class that contains an
authenticate() method that connects to the LDAP server as follows

public Principal  authenticate(String username, String credentials) {
   
MyRealmPrincipal principal = new MyRealmPrincipal(username);
Hashtable env = new Hashtable(11);
env.put(Context.PROVIDER_URL, 
"ldap://localhost:389/dc=britbio,dc=co,dc=uk");
env.put(Context.SECURITY_PRINCIPAL, principal.getDistinguishedName());
env.put(Context.SECURITY_CREDENTIALS, credentials);

try {
  // Create the initial directory context
  DirContext ctx = new InitialDirContext(env);
  // if we get here then we've bound OK

  System.out.println("Authenticated for " +
principal.getDistinguishedName());

  // get the groups from the JNDI context and define them as roles
  getRoles(ctx, principal);

  // unbind
  ctx.close();

  return(principal);


} catch (NamingException e) {
  // could not bind - wrong password?
  System.err.println("Failed to bind to directory for " + username);
  e.printStackTrace();
  return(null);
} 


this code works fine on its own (outside catalina). However when I try to
run it within catalina (jar'd up the clases, put them in
$CATLINA_ROOT/server), my code gets called, but the bind to the LDAP server
fails with the following exception 


Failed to bind to directory for tom
javax.naming.NoInitialContextException: Cannot instantiate class:
com.sun.jndi.ldap.LdapCtxFactory.  Root exception is
java.lang.ClassCastException: com.sun.jndi.ldap.LdapCtxFactory
at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:659)
at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:250)
at javax.naming.InitialContext.init(InitialContext.java:226)
at javax.naming.InitialContext.(InitialContext.java:202)
at
javax.naming.directory.InitialDirContext.(InitialDirContext.java:87)
at
org.apache.catalina.realm.TimsRealm.authenticate(TimsRealm.java:109)
at
org.apache.catalina.authenticator.BasicAuthenticator.findPrincipal(BasicAuth
enticator.java:214)
at
org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthe
nticator.java:160)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:481)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2041)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161
)
at
org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:414)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:159)
at
org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
at
org.apache.catalina.valves.RequestDumperValve.invoke(RequestDumperValve.java
:215)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
818)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:897)
at java.lang.Thread.run(Thread.java:484)


Any ideas as to why this runs outside catalina and not inside it. The JVM,
and everything else I can think of is the same. My setup:
  Tomcat-4.0-b1
  JDK1.3
  Linux

many thanks

Tim


-
Tim Dudgeon
[EMAIL PROTECTED]



--
DISCLAIMER: This message contains proprietary
information some or all of which may be
confidential and/or legally privileged. It is for
the intended recipient only who may use and apply
the information only for the intended purpose.
Internet communications are not secure and
therefore the British Biotech group does not
accept legal responsibility for the contents of
this message. Any views or opinions presented are
only those of the author and not those of the
British Biotech group. If you are not the intended
recipient please delete this e-mail and

RE: [PATCH] Bug 841 - JSPC stack fault on NT

2001-03-05 Thread Steve Downey

That's because in the JspEngineContext it gets to work purely URI name
space, not filesystem name space. It never gets file names, just URI's that
address jsp pages.

JSPC 'knows' that it's in filesystem space, and does things like parse the
file names for directories, looking for one that contains a WEB-INF. Now, NT
is actually agnostic about '/' and '\', but I'm not sure about 98 et al. It
seemed to me to be safer to convert it when it comes into the context rather
than outside it.

I should get to the  problems next. I'm using the heuristic
that JspC should be able to compile the example webapps. I'm not sure how to
structure that as a test, yet, though.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 03, 2001 4:56 AM
To: [EMAIL PROTECTED]
Subject: Re: [PATCH] Bug 841 - JSPC stack fault on NT


[EMAIL PROTECTED] (Steve Downey) writes:
> Under NT (and presumably any OS where File.sep != '/') JspC has a stack
> underflow at baseDirStack.peek() in ParserController.java. This patch
> converts from '\' to '/' for those cases. It also sets the package name
for
> the class based on the URI, so that the java file is distinguished from
> others with the same name.

The problem with '\' as the filename seperator instead of '/' also
causes problems with "", relative paths and JspC (see
Bugzilla #412).

I suggested there that it might be possible to just convert the '\'
into '/' before passing into CommandLineContext (in JspC).  This is
really what happens when running within Tomcat -- the path passed into
JspEngineContext has '/', not the local file seperator.

Unfortunately, I don't have a patch, as I'm not organised enough to get
a build environment running so I can test.

-- 
 `O O'  | [EMAIL PROTECTED]
// ^ \\ | http://www.pyrites.org.uk/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
<><><><><><><><><><><><><><><><><><><><><>This electronic mail transmission
may contain confidential information and is intended only for the person(s)
named.  Any use, copying or disclosure by any other person is strictly
prohibited.  If you have received this transmission in error, please notify
the sender via e-mail. <><><><><><><><><><><><><><><><><><><><><>

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




[TOMCAT 4.x SSI] Update

2001-03-05 Thread Bip Thelin

Here's an update of the SSI package I submitted a week ago. The "only" SSI
command that has been added is 'echo', example. .
The main part of the update is a major rewrite of code/[structure|pattern]. Please
let me know if you find bugs/flaws. I appologize for the paths in the Zipfile, for
some reason Winzip screwed up my path. Anyway this is how the file layout should look
like once deployed.

  \
- servlets / SsiInvokerServlet.java
  |
   \
 - util / ssi /
SsiMediator.java
SsiCommand.java
SsiConfig.java
SsiEcho.java
SsiExec.java
SsiFlastmod.java
SsiFsize.java
SsiInclude.java

..bip

 tomcat-4.x.SSI.zip

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


Re: Some benchmarks

2001-03-05 Thread Rick Knowles

I know some guys at probably the biggest dot com in Japan (fill in the
blanks), who tried out servlet engines looking for the elusive
"next-generation" engine.
They said they tried Weblogic, JRun and another one I can't remember as well
as tomcat. they found that with the same code, they were able to serve a
maximum of 55 million ad banners of up to 100KB per day with Tomcat (I think
v3.0 or 3.1), compared with weblogic and jrun neither of which cracked 45
million (can't remember exact figures, but a significant difference). They
also commented that tomcat had less memory leaks and crashed half as often.
They were in the process of switching to Catalina when I spoke to them.

Moral of the story is  well done guys :).

R

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




Re: Some benchmarks

2001-03-05 Thread Valery Brasseur



[EMAIL PROTECTED] wrote:
> 
> > I need to choose for my company the "next generation" servlet-engine.
> > For now we are using JRUN. I am doing benchmark to choose the next one.
> > choices for me are : JRUN, RESIN... not Tomcat as it is considered not
> > stable
> > and slow compare to the two others...
> 
> What version of tomcat did you test ?
today I test 3.3-M1, the version which was considered slow is the 
version 6 months ago and should be a 3.0 or 3.1
what is a good version for now ? 3.3 or 4.0 ?
> 
> Tomcat 3.3 should be close to Jrun and resin as speed - probably
> in 20..30% range.
what about tuning ? is there any docs or something like this I could try
?
> 
> Again - it can serve servlets and Jsps faster than Apache1.3
> is serving static files - if Apache is fast enough for you,
> tomcat will not be the problem.
> 
> ( assuming of course the right VM and configuration :-)
> 
> > In these tests JRUN and Resin perform equally. Tomcat is get out of
> > memory, is slow compared to the other and sometimes even crashed the
> > JVM.
> 
> Crashing the VM is a VM problem :-)
in a way YES ;-) but what I can't understand is why Tomcat is crashing
the JVM and not Resin for eg. !
where is the difference ?

> 
> Regarding memory usage - tomcat 3.3 creates about 10 objects per
> request ( compared with few hundreds in 3.1 ).
> 
> Costin
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 
Valery BRASSEUR| Phone # +33 320 60 7982 
Atos Branche Multimedia| Fax   # +33 320 60 7649
Ce que vous voyez est tout ce que vous obtenez
  -- Brian Kernigham

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




Re: Volunteer: Connectors?

2001-03-05 Thread Alex Fernández

Hi Carlos!

The full Tomcat 3.3m1 class diagram and javadoc is already up for everyone to
peruse:

 http://nagoya.apache.org/~costin/tomcat3

Un saludo,

Alex.

Carlos Gaston Alvarez wrote:

> Could you send it to me too, please.
> I am next to finishing the jsp compacter I promised but I will really need
> help to integrate it.
>
> Gracias,
>
> Carlos Gaston Alvarez
>
> - Original Message -
> From: Alex Fernández <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, February 21, 2001 9:12 AM
> Subject: Re: Volunteer: Connectors?
>
> > At the risk of getting everyone fed up with my messages today:
> >
> > I have generated the javadoc documentation for Tomcat 3.3m1, complete with
> > class diagrams. It was done with Together Control Center -- it includes an
> > Applet to view UML diagrams. You click on a diagram, it shows you the
> javadoc
> > for that class.
> >
> > The full package is about 12 MB, 3.3 MB zipped. Shall I send it somewhere?
> >
> > Un saludo,
> >
> > Alex.
> >
> > Remy Maucherat wrote:
> >
> > > > Hi-- I work w/ Rational Software. We have been working with Tomcat for
> > > some
> > > > time for our web product, RequisiteWeb. I'd like to volunteer to help
> out
> > > in
> > > > the Tomcat Connectors department.  I am a 1.5-year Java veteran w/ a
> CS
> > > > bachelor's degree, wanting to help produce free software.
> > > >
> > > > Let me know where/if I can be of help.
> > >
> > > Your UML products are cool :)
> > > The online browsing feature is great (as an example of it, you can
> browse
> > > online the UML representation of the Slide project core API here :
> > > http://jakarta.apache.org/slide/uml/index.html).
> > >
> > > I think it would be great to have something similar for Tomcat 4, but
> > > unfortunately I don't have Rose 2001 (the model was contributed to the
> > > project by a Slide user).
> > >
> > > Remy
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, email: [EMAIL PROTECTED]
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]


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




"classname is null, who added this ?" error message.

2001-03-05 Thread Hariharasubramanian Ranganathan



Hi All,
 
When I refresh the browser after updating the 
servlet, I get the following error.  What could be the 
problem?
 
Thanks,
 
Hari.
 

Error: 500
Location: /webconsole/html/index.htmlInternal Servlet Error:java.lang.IllegalStateException: Can't happen - classname is null, who added this ?
	at org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:261)
	at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:289)
	at org.apache.tomcat.core.Handler.service(Handler.java:254)
	at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
	at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
	at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
	at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:281)
	at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
	at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
	at java.lang.Thread.run(Thread.java:484)
  


Re: Proposed ApacheConfig.java change

2001-03-05 Thread Endre Stølsvik

On Sat, 3 Mar 2001 [EMAIL PROTECTED] wrote:

| > Costin,
| >
| > I would strongly vote for turning the auto-config back on by default for the
| > following reasons (other than the fact that I explicity turned it back on
| > when Keith fixed the ApacheConfig class):
|
| You don't need a "strong" vote - I'll do the change :-)

I just want to chime in here, and add a little "bug" report which I don't
know if still exists in 3.3. ;) It's that the auto-workers.properties
doesn't include the portnumber. I have lots of tomcats running, and need
to separate them. To use the uri-whatever-it's-called file, I have to add
one line: ($PORT is set to whatever port it's running on)
 worker.ajp12.port=$PORT

I use the file every time folks restart tomcat, so that I don't have to go
around changing everyones config every time something changes.

Endre.

-- 
Mvh,
Endre


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