Incorrect on display Traditional Chinese in JSP

2002-09-20 Thread Daniel

Hi,

 

I have problem with Tomcat 4.1.10, there is incorrect display
Traditional Chinese in my IE.

The output would be "???"   when I want to use internationalization

Although I have insert <@ page contentType="text/html; charset=big5">,
the problem still the same !

 

Thank you for your time,

 

Daniel.

 




Problem with JNI...

2001-04-24 Thread Daniel Diaz

Hello

I have now another strange problem. I have reinstalled my machine with a 
RedHat 7.0, here is the unmae -a output:

Linux lima.univ-paris1.fr 2.2.16-22 #1 Tue Aug 22 16:49:06 EDT 2000 i686 
unknown

but my previous JNI application no longer works (even afetr a total 
recompilation). Trying to localize the problem I found that I could not even 
launch the JVM. This simple program does not run:

#include 
#include 
#include 

JNIEnv *env;
JavaVM *vm;
jclass cls;

int
main()
{
  JavaVMOption options[2];
  JavaVMInitArgs vm_args;

  options[0].optionString = "-Djava.class.path=."; /* user classes */

  vm_args.version = JNI_VERSION_1_2;
  vm_args.options = options;
  vm_args.nOptions = 1;
  vm_args.ignoreUnrecognized = 1;

  printf("READY TO LOAD THE JVM\n");
  if (JNI_CreateJavaVM(&vm, (void **)&env, (void *)&vm_args) < 0)
{
  fprintf(stderr, "cannot load the JVM\n");
  exit(1);
}

  printf("JVM LOADED\n");
  exit(0);
}


When I execute it I get:
[diaz@lima jgprolog-1.0]$ y
READY TO LOAD THE JVM
#
# HotSpot Virtual Machine Error, Unexpected Signal 11
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Error ID: 4F533F4C494E55580E43505005BC
#
# Problematic Thread: prio=10 tid=0x80532b0 nid=0x3416 runnable
#
Abandon

here is the gdb session:
[diaz@lima jgprolog-1.0]$ gdb y
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(gdb) r
Starting program: /home/diaz/jgprolog-1.0/y
[New Thread 1024 (LWP 13340)]
READY TO LOAD THE JVM
[New Thread 2049 (LWP 13341)]
 
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 13340)]
0x401b575c in os::start_thread ()
   from /usr/java/jdk1.3/jre/lib/i386/client/libjvm.so
(gdb) where
#0  0x401b575c in os::start_thread ()
   from /usr/java/jdk1.3/jre/lib/i386/client/libjvm.so
#1  0x401e3767 in Threads::create_vm ()
   from /usr/java/jdk1.3/jre/lib/i386/client/libjvm.so
#2  0x4015c458 in JNI_CreateJavaVM ()
   from /usr/java/jdk1.3/jre/lib/i386/client/libjvm.so
#3  0x804a877 in main () at y.c:23
#4  0x40457b65 in __libc_start_main (main=0x804a82c , argc=1,
ubp_av=0xb8b4, init=0x804a3c8 <_init>, fini=0x804f914 <_fini>,
rtld_fini=0x4000df24 <_dl_fini>, stack_end=0xb8ac)
at ../sysdeps/generic/libc-start.c:111
(gdb)

Do you have any idea ?

-- 
===
 Daniel Diaz
University of Paris 1  INRIA Rocquencourt
75013 Paris FRANCE  78153 Le Chesnay FRANCE
web: http://pauillac.inria.fr/~diaz
email: [EMAIL PROTECTED]
===





Alternative to NSI

2001-07-14 Thread Daniel Ritchey

Microsoft has its own installation mechanism built in to Win2000 & WinXP and 
offers a download to add it Win9x.  Its the same thing that the binary 
release of Apache for windows is packaged in.

Just thought I would throw that out there, I don't know if it has any 
advantages over NSI.

_
Get your FREE download of MSN Explorer at http://explorer.msn.com




netdb.h

2001-01-25 Thread Daniel Williams

I'm trying to compile the Apache  Tomcat module on Windows. I'm having
problems finding netdb.h.
Would anyone know were I could get my hands on this file.



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




signals with JNI

2001-02-06 Thread Daniel Diaz

Hi,

I have a problem under Linux loading the JVM since before I set a Handler to 
catch SIGSEGV signals. It seems that this causes some troubles when the JVM 
is loaded. This seems due to threads in Java. I saw several post from 
yourself about this topic.

I include my C test file (called x.c) and the command-line 
to compile it is:

gcc -o x /usr/java/jdk1.3/jre/lib/i386/client/libjvm.so x.c 
-I/usr/java/jdk1.3/include -I/usr/java/jdk1.3/include/linux -g -Wall

(assuming the JDK is installed in /usr/java/jdk1.3)

Here is the C file

#include 
#include 
#include 
#include 

JNIEnv *env;
JavaVM *vm;
jclass cls;

void
Load_JVM(void)
{
  JavaVMOption options[2];
  JavaVMInitArgs vm_args;

  options[0].optionString = "-Djava.class.path=."; /* user classes */

  vm_args.version = JNI_VERSION_1_2;
  vm_args.options = options;
  vm_args.nOptions = 1;
  vm_args.ignoreUnrecognized = 1;

  printf("READY TO LOAD THE JVM\n");
  if (JNI_CreateJavaVM(&vm, (void **)&env, (void *)&vm_args) < 0)
{
  fprintf(stderr, "cannot load the JVM\n");
  exit(1);
}

  printf("JVM LOADED\n");
}


void
SIGSEGV_Handler(void)

{
 fprintf(stderr, "Received SIGSEGV\n");
 exit(2);
}


int
main(int argc, char *argv[])
{
  signal(SIGSEGV, (void (*)()) SIGSEGV_Handler);
  Load_JVM();
  return 0;
}

It simply installs a handler for SIGSEGV and then loads the JVM. If you 
comment the line signal(SIGSEGV, (void (*)()) SIGSEGV_Handler) in the main(), 
this works properly but with the handler this crashes with:

READY TO LOAD THE JVM
#
# HotSpot Virtual Machine Error, Internal Error
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Error ID: 4F533F4C494E55580E4350500570
#
# Problematic Thread: Received SIGSEGV

Another strange problem occurs if you replace this line by
  system("uname -a");

after executing system() the JVM loading is blocked (in a sigsuspend I think).

Could you help me on this please ?

-- 
===
 Daniel Diaz
University of Paris 1  INRIA Rocquencourt
75013 Paris FRANCE  78153 Le Chesnay FRANCE
web: http://pauillac.inria.fr/~diaz
email: [EMAIL PROTECTED]
===



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




Re: [Fwd: Tomcat may reveal script source code by URL trickery]

2001-04-04 Thread Daniel Lopez

You're right!
That's another reason to use a model 2 based approach but, of course, JSP still
allows you to shoot you on your foot if you are fool enough to do so. That's one
of the reasons we chose a model 2 based approach with XML-XSLT for the interface
creation, no JSP involved: no feet in danger ;).
just my 2c,
Dan

Jon Stevens wrote:

> I know that these are just minor bugs in Tomcat (and other servlet
> containers as well), but man, this is getting ridiculous. This is clearly
> yet another reason to not use JSP. Especially when you have sites like this:
>
> 
>
> Actually *encouraging* people to put their usernames and passwords into
> their JSP files. The term "Gross negligence" comes to mind.
>
> -jon
>

...




Re: Use of Apache proxy module to connect to Tomcat

2001-04-10 Thread Daniel Lopez

Hi,

In our case, we use the Apache as proxy to be able to distribute our
applications among several instances of servlet containers and/or hosts.
This way, upgrading an application doesn't affect the rest and if we
have to stop/start a container, just one or two applications are
affected. On the other hand, using mod_proxy allows us to concentrate
all applications in ports 80 and 443, thus avoiding some nasty firewall
problems with some of our users. In our case, as our applications are
not too heavy loaded but we have more than a dozen, flexibility and easy
maintenance are more important than speed. As a goody, we configured
Apache so it detects automatically a 500 error and redirects the result
to an SSI script, which loads the appropriate "Application X is being
manteined" instead of letting the user get a "server not responding",
whenever we stop one of the container instances. And we can use the
proxy as a cache proxy for static content as well.
Just my 2c,
Dan

Paulo Gaspar wrote:
> 
> In my case I want to use the help of mod_rewrite to produce a
> static HTML "cache" for "dynamic" pages that are not changed
> very often.
> 
> BTW, Jon was the one making the remark on AJP being lighter.
> (And I believe he is right.)
> 
> Have fun,
> Paulo Gaspar
> 
> -Original Message-
> From: Dunlop, Aaron [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 10, 2001 23:24
> 
> Yes - it seems to work just fine with Tomcat. I've been experimenting with
> it as a possible authentication and firewall solution, and we may consider
> it as a method for load-balancing as well.
> We're thinking of having Apache segment our webspace by sending requests to
> different apps to different servers (e.g. a production server and a
> demonstration/sales server, both accessible from the same domain) Also,
> apache can authenticate access to certain pages using an LDAP database.
> I'm not sure this is the best solution, and Paulo's probably right that AJP
> would be more efficient, but it seems to be working so far.
> Just my $.02
> Aaron Dunlop
> -Original Message-
> From: Jon Stevens [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 10, 2001 1:59 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Use of Apache proxy module to connect to Tomcat
> 
> on 4/10/01 1:59 PM, "Paulo Gaspar" <[EMAIL PROTECTED]> wrote:
> > Is this possible for Tomcat too? Pros and cons?
> >
> > Thanks and have fun,
> > Paulo Gaspar
> 
> Of course it is.
> Proxy HTTP is probably not as efficient as a lightweight protocol (ie: AJP),
> especially if the two systems are running on the same box (ie: local
> sockets).
> It also doesn't solve the configuration issues.
> All you are doing in this case is putting another layer in front of the
> Tomcat HTTPd. I don't see a reason to do that when the Tomcat HTTPd works
> just fine. All you are gaining is the Apache module features (like
> mod_rewrite).
> -jon



Netscape 3.6.1 on HP-UX (how do I use the nsapi-redirector?

2001-04-11 Thread Wick, Daniel

I've been searching through the documentation but can't find anything about
using Tomcat with Netscape 3.6.1 on any Unix platforms.  I'm stuck with
Netscape, but would like to use Tomcat!

Any help on where to find the correct redirector and how to install would be
IMMENSELY appreciated.

Thank you,

Dan Wick
Webmaster
Donaldson Company, Inc.
Phone:  952.887.3224  Fax:  952.703.4723
[EMAIL PROTECTED]

The software said to install IIS version 4 or better, so I installed Apache.




[PATCH] [Catalina] StandardContext::addParameter() JavaDoc

2001-11-16 Thread Daniel Rall

addParameter() instance method actually throws an
IllegalArgumentException if a duplicate name is used.

I came across this while attempting to setup Catalina behind Apache +
mod_webapp -- AFAICT, my setup is currently giving me the joy of
multiple initializations of Catalina.

Index: StandardContext.java
===
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
retrieving revision 1.87
diff -u -u -r1.87 StandardContext.java
--- StandardContext.java2001/11/10 00:01:54 1.87
+++ StandardContext.java2001/11/17 02:18:47
@@ -1506,8 +1506,7 @@
 
 
 /**
- * Add a new context initialization parameter, replacing any existing
- * value for the specified name.
+ * Add a new context initialization parameter.
  *
  * @param name Name of the new parameter
  * @param value Value of the new  parameter

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Triple initialization of Catalina/mod_webapp

2001-11-21 Thread Daniel Rall

This is a followup to a message I posted to the user list which
describes some undesirable behavior of Tomcat 4.0.1 (unrelated to use
of mod_webapp).

My application's build process currently generates the deployment
descriptor for my web app from many files which contain snippets of
the final web.xml.  After generation of the deployment descriptor (as
$SRC_DIR/conf/web.xml), it is then copied into the appropriate sub
directory of my webapps tree.  At this point, I should be able to
launch Catalina (using a $CATALINA_BASE of $SRC_DIR/site and
$CATALINA_HOME of /usr/share/tomcat4).  However, the file
$SRC_DIR/conf/web.xml is read in before
$CATALINA_BASE/webapps/myapp/WEB-INF/web.xml.  Since both these files
contain the same content, my web app is initialized multiple times.

That the conf/web.xml relative to my current working directory is used
at all at seems like undesirable behavior to me.  If a conf/web.xml
file is going to be looked for at all, at the very least it could be
looked for relative to $CATALINA_BASE.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Triple initialization of Catalina/mod_webapp

2001-11-26 Thread Daniel Rall

Recently found a symlink which would explain this unexpected
behavior.  :-\

Daniel Rall <[EMAIL PROTECTED]> writes:

> This is a followup to a message I posted to the user list which
> describes some undesirable behavior of Tomcat 4.0.1 (unrelated to use
> of mod_webapp).
>
> My application's build process currently generates the deployment
> descriptor for my web app from many files which contain snippets of
> the final web.xml.  After generation of the deployment descriptor (as
> $SRC_DIR/conf/web.xml), it is then copied into the appropriate sub
> directory of my webapps tree.  At this point, I should be able to
> launch Catalina (using a $CATALINA_BASE of $SRC_DIR/site and
> $CATALINA_HOME of /usr/share/tomcat4).  However, the file
> $SRC_DIR/conf/web.xml is read in before
> $CATALINA_BASE/webapps/myapp/WEB-INF/web.xml.  Since both these files
> contain the same content, my web app is initialized multiple times.
>
> That the conf/web.xml relative to my current working directory is used
> at all at seems like undesirable behavior to me.  If a conf/web.xml
> file is going to be looked for at all, at the very least it could be
> looked for relative to $CATALINA_BASE.

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




Re: cvs commit: jakarta-tomcat-4.0/catalina/src/bin setenv.sh catalina.sh tool-wrapper.sh

2001-11-27 Thread Daniel Rall

Jon Stevens <[EMAIL PROTECTED]> writes:

> on 11/27/01 2:34 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
>> Index: setenv.sh
>> ===
>> #!/bin/sh
>> # 
>> -
>> # setenv.sh - File to hold all user customizable environment variables
>> #
>> # $Id: setenv.sh,v 1.1 2001/11/27 22:34:25 patrickl Exp $
>> # 
>> -
>> 
>> # To permanently set your JAVA_HOME environment variable, uncomment and
>> # customize the following line with the absolute path to your JAVA_HOME
>> # JAVA_HOME=/usr/java
>
> -1
>
> I don't think that this file should exist in CVS if it is a user file.
>
> The problem being that if a user upgrades to a new version of Catalina, then
> they will risk overwriting this file.
>
> Instead, it should be documented that the file needs to be created in order
> to be used.

I agree with Jon.  Files editted by the user should never be in CVS --
clear documentation is key here.  Other than that, I like the change!

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: 4.0.1 ClassLoader breaks singletons on webapp reload.

2001-11-26 Thread Daniel Rall

[EMAIL PROTECTED] (Kevin A. Burton) writes:

> Jon Stevens <[EMAIL PROTECTED]> writes:
>
>> Sadly, I have to admit that the Turbine Services framework shutdown
>> code is currently broken and has been for some time now...it needs
>> to be re-written...
>
> Are you saying that the theory is broken or just Turbine's impl?

Turbine's impl...no one has made use of shutdown in a while.  It'll be
fixed soon, though.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Off topic:Old jserv source question

2001-12-03 Thread Daniel Rall

On Mon, 3 Dec 2001, Antony Bowesman wrote:

> "Craig R. McClanahan" wrote:
> >
> > Apache JServ sources are still available via anonymous CVS from the
> > Jakarta web site (see http://jakarta.apache.org/site/cvsindex.html).
> > The CVS module name is "java-jserv".
>
> Brilliant!  Thanks Craig.  containsHeader() was broken in jserv 1.1.2.

Noticed by Michael Stack, I submitted a fix for this issue a while back
(committed by Jon Stevens).  JServ development is dead, but if you're in
a situation where you must use JServ, I recommend using CVS HEAD.


Daniel



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




Re: cvs commit: jakarta-tomcat/src/share/org/apache/jasper/compilerCharDataGenerator.java JspParseEventListener.java MappedCharDataGenerator.java

2001-12-03 Thread Daniel Rall

On 4 Dec 2001 [EMAIL PROTECTED] wrote:

> larryi  01/12/03 18:21:04
>
>   Modified:src/share/org/apache/jasper/compiler CharDataGenerator.java
> JspParseEventListener.java
> MappedCharDataGenerator.java
>   Log:
>   Eliminate hard coded '\n' line separators.
>
>   Revision  ChangesPath
>   1.5   +5 -4  
>jakarta-tomcat/src/share/org/apache/jasper/compiler/CharDataGenerator.java
>
>   Index: CharDataGenerator.java
>   ===
>   RCS file: 
>/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/CharDataGenerator.java,v
>   retrieving revision 1.4
>   retrieving revision 1.5
>   diff -u -r1.4 -r1.5
>   --- CharDataGenerator.java  2001/07/03 16:27:12 1.4
>   +++ CharDataGenerator.java  2001/12/04 02:21:04 1.5
>   @@ -1,7 +1,7 @@
>/*
>   - * $Header: 
>/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/CharDataGenerator.java,v
> 1.4 2001/07/03 16:27:12 hgomez Exp $
>   - * $Revision: 1.4 $
>   - * $Date: 2001/07/03 16:27:12 $
>   + * $Header: 
>/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/CharDataGenerator.java,v
> 1.5 2001/12/04 02:21:04 larryi Exp $
>   + * $Revision: 1.5 $
>   + * $Date: 2001/12/04 02:21:04 $
> *
> * 
> *
>   @@ -127,7 +127,8 @@
>   }
>   }
>   writer.print(sb.toString());
>   -   writer.print("\");\n");
>   +   writer.print("\");");
>   +   writer.println();
>}

Why not just call println() instead of print() then println()?


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Off topic:Old jserv source question

2001-12-04 Thread Daniel Rall

On Tue, 4 Dec 2001, Antony Bowesman wrote:

> Thanks Daniel, I noticed your name in the comments, we are just trying
> to remove the jserv dependancy to use tomcat 4.  Most of the work is
> done, just have to get customers to move...

Just recently made the switch from JServ to Catalina myself.  Things
could've gone smoothly, but we were fairly coupled to JServ, so I'm still
trying to tie up loose ends (which is involving patching Catalina).  Best of
luck to you.


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




Re: Emulating JServ's session.topleveldomain with Catalina

2001-11-29 Thread Daniel Rall

"Craig R. McClanahan" <[EMAIL PROTECTED]> writes:

> On Sat, 24 Nov 2001, Daniel Rall wrote:
>
>> "Craig R. McClanahan" <[EMAIL PROTECTED]> writes:
>>
>> > On Wed, 21 Nov 2001, Daniel Rall wrote:
>> >
>> >> Using Tomcat 4.0.1, is there any way to emulate JServ's
>> >> session.topleveldomain context configuration?
>> >>
>> >> # Set the domain= header that gets sent with the cookie. This is
>> >> # entirely optional
>> >> # Default: null
>> >> # this is needed when we vhost to avoid multiple login
>> >> session.topleveldomain=.foo.com
>> >>
>> >> I would like all requests to the set of virtual hosts represented by
>> >> the glob *.foo.com to share the same session ID.
>> >
>> > Unfortunately, implementing this functionality would violate the Servlet
>> > spec's requirements about sessions being scoped to a single
>> > ServletContext.  Even if you were willing to do this, you're going to run
>> > into lots of technical problems due to the fact that each webapp is loaded
>> > by it's own classloader -- trying to access a session attribute loaded
>> > from a different webapp will throw ClassNotFoundException errors at you.
>>
>> I wasn't clear enough in my original query --  I don't want to scope
>> one session to multiple contexts, but to a single context accessed by
>> multiple host names which correspond to the same physical host (the
>> default host in server.xml).
>
> This is still illegal based on the same rule - each virtual host has its
> own set of webapps.  Tomcat 4 is built on this assumption.

Using the distinction you mention below, the host name used in the
request is merely a host alias (rather than a virtual host).

> One way to work around it (with Tomcat 4) would be to use the "host
> aliasing" capability, where you say that a set of host names really refer
> to the same virtual host.  This was primarily intended to deal with cases
> like "company.com" and "www.company.com" resolving to the same app, but
> could actually be used for more than that.  Check out the 
> directive (in server.xml).

Thanks for suggesting a work around, Craig (I'm only concerned with
Tomcat 4 ATM =).

Reviewing the implementation of the  directive in
StandardEngineMapper and FastEngineMapper, it appears that only
literal mappings are provided for (i.e. wildcards are not allowed
supported).

I have a requirement of supporting addition of host alias mappings at
run-time, but neither see a way to reload server.xml nor have much of
a desire to modify it from servlet code.  Is there another way to
handle this situation?  If not, would the Catalina developers be
amenable to a patch which adds wildcard capability to the host alias
feature?  Would regex or file system-style globs be preferred (I lean
towards the latter)?  If this is undesirable, what are my options
(i.e. can I configure my Engine entry in server.xml to use a custom
Mapper)?


Thanks, Daniel

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




Re: Emulating JServ's session.topleveldomain with Catalina

2001-11-30 Thread Daniel Rall

"Craig R. McClanahan" <[EMAIL PROTECTED]> writes:

> I'd certainly be interested in a patch to allow pattern matching in the
> host mapper, as long as the code was smart about using direct string
> compares when no patterns are specified (to avoid slowing down all
> requests by regexp processing).

Since "." is a regex character, there is no way to automatically infer
whether an alias string is a pattern or a literal, meaning that a way
to communicate to the Mapper implementations which aliases are
patterns is required.  Because of this, I don't believe that it is
possible to avoid minor API/server.xml additions/changes.

The cleanest implementation route I see for addition of pattern
matching is to solidfy an existing data type (Alias) as an interface
accompanied by standard implementation.  The suggested syntax would be
as follows:


  .*domain.com
  
  www.otherdomain.com


I haven't previously used Digester, Modeler, or BeanUtils, so am
unsure of what changes to make to mbeans-descriptors.xml and
HostRuleSet.java (I definitely screwed up the declaration for Alias).

> Note that Tomcat already loads jakarta-regexp for use in the
> RemoteAddrValve and RemoteHostValve filters.  If you need regexp patterns,
> that would be a convenient choice because no additional dependencies would
> be created.

Gotcha -- I used RE.match() in the style of RequestFilterValve.

Here's an incomplete version of the modifications to solicit feedback,
and make sure I'm following the desired path:


Index: src/share/org/apache/catalina/Alias.java
===
RCS file: Alias.java
diff -N Alias.java
--- /dev/null   Fri Nov 30 17:57:31 2001
+++ Alias.java  Fri Nov 30 17:59:22 2001
@@ -0,0 +1,128 @@
+/*
+ * $Header: 
+/home/cvspublic/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Host.java,v 
+1.7 2001/10/22 04:48:56 remm Exp $
+ * $Revision: 1.7 $
+ * $Date: 2001/10/22 04:48:56 $
+ *
+ * 
+ *
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in
+ *the documentation and/or other materials provided with the
+ *distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ *any, must include the following acknowlegement:
+ *   "This product includes software developed by the
+ *Apache Software Foundation (http://www.apache.org/)."
+ *Alternately, this acknowlegement may appear in the software itself,
+ *if and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
+ *Foundation" must not be used to endorse or promote products derived
+ *from this software without prior written permission. For written
+ *permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ *nor may "Apache" appear in their names without prior written
+ *permission of the Apache Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+
+package org.apache.catalina;
+
+
+import javax.servlet.ServletContext;
+
+/**
+ * An Alias defines a mapping from a host name used in a
+ * request to 

Re: Emulating JServ's session.topleveldomain with Catalina

2001-11-27 Thread Daniel Rall

[This was originally sent to tomcat-user, but is probably better
discussed on tomcat-dev.]

Why does the Valve implementation at the bottom of this message never
print out any session cookies?

"Craig R. McClanahan" <[EMAIL PROTECTED]> writes:

> On Wed, 21 Nov 2001, Daniel Rall wrote:
>
>> Using Tomcat 4.0.1, is there any way to emulate JServ's
>> session.topleveldomain context configuration?
>>
>> # Set the domain= header that gets sent with the cookie. This is
>> # entirely optional
>> # Default: null
>> # this is needed when we vhost to avoid multiple login
>> session.topleveldomain=.foo.com
>>
>> I would like all requests to the set of virtual hosts represented by
>> the glob *.foo.com to share the same session ID.
>
> Unfortunately, implementing this functionality would violate the Servlet
> spec's requirements about sessions being scoped to a single
> ServletContext.  Even if you were willing to do this, you're going to run
> into lots of technical problems due to the fact that each webapp is loaded
> by it's own classloader -- trying to access a session attribute loaded
> from a different webapp will throw ClassNotFoundException errors at you.

I wasn't clear enough in my original query -- I don't want to scope
one session to multiple contexts, but to a single context accessed by
multiple host names which correspond to the same physical host (the
default host in server.xml).

So, if the DNS for both baz.foo.com and bar.foo.com resolves to the
same IP, a request to /myapp for baz.foo.com will create a session
with a JSESSIONID cookie domain of .foo.com, allowing requests to
bar.foo.com (or any other DNS mappings) to /myapp servlet context to
share the same HttpSession.

I took a stab at implementing this as a , with some success.
My original thought was to groom the JSESSIONID cookies in the request
and response -- however, they never seem to show up (i.e. I never have
any cookies available from HttpRequest::getCookies() or
HttpResponse::getCookies()).  Perhaps I just attached the Valve at the
wrong spot (in the config file)?  Because I haven't been able to
access the JSESSIONID cookies, I end up getting a two cookies written
on the original request, one for the first host requested
(baz.foo.com), and another from my Valve for .foo.com (also from the
first request).  I get the desired result from this (unfortunately
with an extra cookie set for baz.foo.com), but am curious why I those
JSESSIONID cookies haven't turned up.

Any comments would be appreciated.

Dan


/*
 * $Header: $
 * $Revision: $
 * $Date: $
 *
 * 
 *
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 1999 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in
 *the documentation and/or other materials provided with the
 *distribution.
 *
 * 3. The end-user documentation included with the redistribution, if
 *any, must include the following acknowlegement:
 *   "This product includes software developed by the
 *Apache Software Foundation (http://www.apache.org/)."
 *Alternately, this acknowlegement may appear in the software itself,
 *if and wherever such third-party acknowlegements normally appear.
 *
 * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
 *Foundation" must not be used to endorse or promote products derived
 *from this software without prior written permission. For written
 *permission, please contact [EMAIL PROTECTED]
 *
 * 5. Products derived from this software may not be called "Apache"
 *nor may "Apache" appear in their names without prior written
 *permission of the Apache Group.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIG

Re: Emulating JServ's session.topleveldomain with Catalina

2001-12-05 Thread Daniel Rall

"Craig R. McClanahan" <[EMAIL PROTECTED]> writes:

> I'd certainly be interested in a patch to allow pattern matching in the
> host mapper, as long as the code was smart about using direct string
> compares when no patterns are specified (to avoid slowing down all
> requests by regexp processing).
>
> Note that Tomcat already loads jakarta-regexp for use in the
> RemoteAddrValve and RemoteHostValve filters.  If you need regexp patterns,
> that would be a convenient choice because no additional dependencies would
> be created.

Hi Craig.  Did you have a chance to look over my initial rev of the
patch to add pattern matching to the host mapper?  Is the Alias change
acceptable?  (Sorry if you already responded -- I've been off-line.
My ATT@Home service was temporarily down after Excite declared chapter
11.)

If so, would you comment on how to get the Digester/Modeler to
properly configure an Alias object?  I could use some guidance with
that.

If not, how would you suggest I proceed to make such a patch
acceptable (i.e. what other constraints should I take into account)?


 Thanks, Dan

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




[PATCH][Catalina] Improved flexiblity of pipeline WRT session cookies

2001-11-28 Thread Daniel Rall

First, this patch fixes a problem with Catalina's sendHeaders()
implementation which prevents post-service() Valve code from having a
chance to cleanly set or modify the JSESSIONID cookie used to store
Catalina's session identifier.

Second, this removes some of the remnants of a cut and paste birth of
WarpResponse from jakarta-tomcat-4.0 (note that there is another copy
of this file in the jakarta-turbine-connectors repository).

This patch is against CVS HEAD of jakarta-tomcat-4.0 from the evening
of Wed, Nov 28.

On a parallel note, neither JServ (in JServServletManager) nor
Catalina (in two HttpProcessor impls and WarpRequestHandler) use the
equalsIgnoreCase that section 4.1 of RFC 2109 to me suggests use when
rooting through the cookies parsed from the request stream (when
initially seeking the session identifier).  Even though a constant is
used internally in Catalina, I would assume that Catalina would accept
cookies formatted as per the RFC (perhaps common usage suggests
otherwise?).


Index: HttpResponseBase.java
===
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java,v
retrieving revision 1.40
diff -u -u -r1.40 HttpResponseBase.java
--- HttpResponseBase.java   2001/11/13 19:39:27 1.40
+++ HttpResponseBase.java   2001/11/28 09:15:20
@@ -614,25 +614,7 @@
 }
 
 // Add the session ID cookie if necessary
-HttpServletRequest hreq = (HttpServletRequest) request.getRequest();
-HttpSession session = hreq.getSession(false);
-
-if ((session != null) && session.isNew() && (getContext() != null)
-&& getContext().getCookies()) {
-Cookie cookie = new Cookie(Globals.SESSION_COOKIE_NAME,
-   session.getId());
-cookie.setMaxAge(-1);
-String contextPath = null;
-if (context != null)
-contextPath = context.getPath();
-if ((contextPath != null) && (contextPath.length() > 0))
-cookie.setPath(contextPath);
-else
-cookie.setPath("/");
-if (hreq.isSecure())
-cookie.setSecure(true);
-addCookie(cookie);
-}
+addAbsentSessionCookie((HttpServletRequest) request.getRequest());
 
 // Send all specified cookies (if any)
 synchronized (cookies) {
@@ -657,6 +639,63 @@
 
 // The response is now committed
 committed = true;
+
+}
+
+
+/**
+ * Adds the session ID cookie if a new session exists for
+ * hreq, the Context is configured to pass the
+ * session ID via cookies (the default), and the session cookie
+ * doesn't already exist in the request (could've been inserted by
+ * a meddling Valve during Pipeline execution).
+ *
+ * @param hreq The HttpServletRequest whose session to service.
+ */
+protected void addAbsentSessionCookie(HttpServletRequest hreq) {
+
+HttpSession session = hreq.getSession(false);
+
+if ((session != null) && session.isNew() && (getContext() != null)
+&& getContext().getCookies() && !containsSessionCookie()) {
+Cookie cookie = new Cookie(Globals.SESSION_COOKIE_NAME,
+   session.getId());
+cookie.setMaxAge(-1);
+String contextPath = null;
+if (context != null)
+contextPath = context.getPath();
+if ((contextPath != null) && (contextPath.length() > 0))
+cookie.setPath(contextPath);
+else
+cookie.setPath("/");
+if (hreq.isSecure())
+cookie.setSecure(true);
+addCookie(cookie);
+}
+
+}
+
+
+/**
+ * Returns whether this HttpResponse contains the session
+ * identifier cookie.  Though section 4.1 of RFC 2109 suggests
+ * that cookie name comparisons are case-insentive, a
+ * case-sensitive comparison is performed for consistancy with the
+ * rest of Catalina's implementation.
+ *
+ * @return Whether this response has a session identifier cookie
+ * set.
+ */
+protected boolean containsSessionCookie() {
+
+Cookie c;
+for (Iterator i = cookies.iterator(); i.hasNext(); ) {
+c = (Cookie) i.next();
+if (Globals.SESSION_COOKIE_NAME.equals(c.getName())) {
+return true;
+}
+}
+return false;
 
 }
 


Index: WarpResponse.java
===
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpResponse.java,v
retrieving revision 1.7
diff -u -u -r1.7 WarpResponse.java
--- WarpResponse.java   2001/08/09 20:08:58 1.7
+++ WarpResponse.java   2001/11/28 09:15:00
@@ -201,25 +201,7 @@
 

Re: Emulating JServ's session.topleveldomain with Catalina

2001-11-28 Thread Daniel Rall

Daniel Rall <[EMAIL PROTECTED]> writes:

> [This was originally sent to tomcat-user, but is probably better
> discussed on tomcat-dev.]
>
> Why does the Valve implementation at the bottom of this message never
> print out any session cookies?

To answer myself (as addressed by my recent patch), because the
session cookie is added via the sendHeaders() method of
HttpResponseBase AFTER the Pipeline finishes processing.

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




Re: Jk2: error handling and method signatures

2001-12-13 Thread Daniel Rall

This is reminiscent of what the Subersion folks are doing for error
handling.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Jk2: error handling and method signatures

2001-12-13 Thread Daniel Rall

<[EMAIL PROTECTED]> writes:

> On Thu, 13 Dec 2001, Daniel Rall wrote:
>
>> This is reminiscent of what the Subersion folks are doing for error
>> handling.
>
> Could you give a URL ? If it was already invented... ( I was thinking to
> use a subset of what's 'invented' in jni, I believe there are
> quite a few people who'll feel 'familiar' with this and it's natural for
> java programmers ).

Here's what Subversion does for error progation:

http://svn.collab.net/repos/svn/trunk/subversion/include/svn_error.h

Could propogate that in the suggested env.

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




Re: Refactor of o-a-j-JspC

2001-12-13 Thread Daniel Rall

"David Hoag" <[EMAIL PROTECTED]> writes:

> How do I contribute these changes?

http://jakarta.apache.org/site/source.html

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Jk2: error handling and method signatures

2001-12-13 Thread Daniel Rall

<[EMAIL PROTECTED]> writes:

> On Thu, 13 Dec 2001, Daniel Rall wrote:
>
>> http://svn.collab.net/repos/svn/trunk/subversion/include/svn_error.h
>
> It seems they are using a struct that is returned instead of a simple int,
> as status. It does solve the problem of propagating more info.

In practice, I've found casual error information to be extremely
useful.  It seems that I'm not the only one, as it's been incorporated
into the JDK for version 1.4.  Catalina, Commons Util, Ant, and other
project employ this technique with good results.  It's just another
tool to consider (which might not apply equally well to all
situations).

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




Re: Jk2: error handling and method signatures

2001-12-13 Thread Daniel Rall

I meant causal, not casual.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: [PATCH][4.0] remove spurious casts in ApplicationFilterChain

2001-12-30 Thread Daniel Rall

+1, old code was redundant.  Java should find the right method to call
based on object--not reference--type.

"Christopher K. St. John" <[EMAIL PROTECTED]> writes:

>  The "fall off the end of the chain" code in
> ApplicationFilterChain.internalDoFilter checks if the
> passed in request and response are HttpServletRequest/
> Response objects. Based on the test, it casts the 
> objects and invokes servlet.service(). However, since
> the servlet member has a static type of javax.servlet.Servlet,
> the exact same method is called in both cases. The code
> operates correctly (since the non-http version of the 
> service() method eventually invokes the correct version
> of service()), but the test and cast are redundant and
> confusing. The following patch removes them:
>
>
> Index: ApplicationFilterChain.java
> ===
> RCS file: 
>/home/cvspublic/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationFilterChain.java,v
> retrieving revision 1.11
> diff -u -r1.11 ApplicationFilterChain.java
> --- ApplicationFilterChain.java 2001/10/11 23:30:58 1.11
> +++ ApplicationFilterChain.java 2001/12/28 19:06:24
> @@ -242,13 +242,7 @@
>  try {
>  support.fireInstanceEvent(InstanceEvent.BEFORE_SERVICE_EVENT,
>servlet, request, response);
> -if ((request instanceof HttpServletRequest) &&
> -(response instanceof HttpServletResponse)) {
> -servlet.service((HttpServletRequest) request,
> -(HttpServletResponse) response);
> -} else {
> -servlet.service(request, response);
> -}
> +servlet.service(request, response);
>  support.fireInstanceEvent(InstanceEvent.AFTER_SERVICE_EVENT,
>servlet, request, response);
>  } catch (IOException e) {

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: tomcat 4.0.2 and jakarta-tomcat-connectors

2002-01-04 Thread Daniel Rall

Kevin Seguin <[EMAIL PROTECTED]> writes:

> there was a thread a couple weeks ago regarding what to do with j-t-c and
> tomcat 4.0.2.  i believe it was decided that the 4.0.2 release would contain
> the same jars from j-t-c (tomcat-ajp.jar, tomcat-util.jar) as 4.0.1 did.
>
> well, i just did some quick tests with the 4.0.2-b1 dist and the head of
> j-t-c, and all seemed to be in working order.
>
> so, i think it might be a good idea to try to release the latest stuff from
> j-t-c with 4.0.2 for a couple of reasons:
>
>   *) if we release and tag j-t-c along with jakarta-tomcat-4.0, i think
> it'll 
>  be easier to do maintenance, fix bugs, etc..  i'm not only talking
> about
>  the java code in j-t-c, but also the c code.
>   *) there have been some bug fixes in j-t-c since 4.0.1 -- these may as
> well
>  be released :)

The mod_webapp connector code is definitely in a freshening.  :)

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: tomcat 4.0.2 and jakarta-tomcat-connectors

2002-01-04 Thread Daniel Rall

Daniel Rall <[EMAIL PROTECTED]> writes:

> The mod_webapp connector code is definitely in a freshening.  :)
^
 need of

Specifically, it would be great to get in Pier's fix to the file
upload problem (if not the rest of the changes as well).

Index: catalina/src/share/org/apache/catalina/connector/warp/WarpRequest.java 
=== 
RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpRequest.java,v 
retrieving revision 1.9 
retrieving revision 1.10 
diff -u -r1.9 -r1.10 
--- catalina/src/share/org/apache/catalina/connector/warp/WarpRequest.java  2001/07/25 
22:32:05 1.9 
+++ catalina/src/share/org/apache/catalina/connector/warp/WarpRequest.java  2001/10/19 
+19:18:28 1.10 
@@ -139,7 +139,7 @@ 
 throw new IOException("Invalid WARP packet type for body"); 

 if (this.packet.pointermailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




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

2002-01-04 Thread Daniel Rall

Remy, I built today's HEAD and verified your fix (much cleaner than
what was previously proposed).

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5368

Please backport this bug fix to the 4.0.x branch.

 Thanks, Dan

[EMAIL PROTECTED] writes:

> remm02/01/04 08:33:40
>
>   Modified:catalina/src/share/org/apache/catalina/core
> StandardContextValve.java StandardHostValve.java
>   Log:
>   - Fix for 5368: mark the session as accessed before going in the Context
> pipeline (before, the session was marked as non-new only in the last useable
> valve of the pipeline). This is not the proposed patch for this bug. Please 
>confirm
> it does fix the problem.
>   
>   Revision  ChangesPath
>   1.15  +6 -17 
>jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContextValve.java
>   
>   Index: StandardContextValve.java
>   ===
>   RCS file: 
>/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContextValve.java,v
>   retrieving revision 1.14
>   retrieving revision 1.15
>   diff -u -r1.14 -r1.15
>   --- StandardContextValve.java   5 Oct 2001 22:03:53 -   1.14
>   +++ StandardContextValve.java   4 Jan 2002 16:33:40 -   1.15
>   @@ -1,7 +1,7 @@
>/*
>   - * $Header: 
>/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContextValve.java,v
> 1.14 2001/10/05 22:03:53 remm Exp $
>   - * $Revision: 1.14 $
>   - * $Date: 2001/10/05 22:03:53 $
>   + * $Header: 
>/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContextValve.java,v
> 1.15 2002/01/04 16:33:40 remm Exp $
>   + * $Revision: 1.15 $
>   + * $Date: 2002/01/04 16:33:40 $
> *
> * 
> *
>   @@ -74,10 +74,9 @@
>import org.apache.naming.ContextBindings;
>import org.apache.naming.resources.DirContextURLStreamHandler;
>import org.apache.catalina.Container;
>   -import org.apache.catalina.Manager;
>   +import org.apache.catalina.Context;
>import org.apache.catalina.Request;
>import org.apache.catalina.Response;
>   -import org.apache.catalina.Session;
>import org.apache.catalina.ValveContext;
>import org.apache.catalina.Wrapper;
>import org.apache.catalina.util.RequestUtil;
>   @@ -93,7 +92,7 @@
> * when processing HTTP requests.
> *
> * @author Craig R. McClanahan
>   - * @version $Revision: 1.14 $ $Date: 2001/10/05 22:03:53 $
>   + * @version $Revision: 1.15 $ $Date: 2002/01/04 16:33:40 $
> */
>
>final class StandardContextValve
>   @@ -169,17 +168,7 @@
>return;
>}
>
>   -// Update the session last access time for our session (if any)
>   -StandardContext context = (StandardContext) getContainer();
>   -String sessionId = hreq.getRequestedSessionId();
>   -if (sessionId != null) {
>   -Manager manager = context.getManager();
>   -if (manager != null) {
>   -Session session = manager.findSession(sessionId);
>   -if ((session != null) && session.isValid())
>   -session.access();
>   -}
>   -}
>   +Context context = (Context) getContainer();
>
>// Select the Wrapper to be used for this Request
>Wrapper wrapper = null;
>   
>   
>   
>   1.6   +21 -5 
>jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHostValve.java
>   
>   Index: StandardHostValve.java
>   ===
>   RCS file: 
>/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHostValve.java,v
>   retrieving revision 1.5
>   retrieving revision 1.6
>   diff -u -r1.5 -r1.6
>   --- StandardHostValve.java  22 Jul 2001 20:25:08 -  1.5
>   +++ StandardHostValve.java  4 Jan 2002 16:33:40 -   1.6
>   @@ -1,7 +1,7 @@
>/*
>   - * $Header: 
>/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHostValve.java,v
> 1.5 2001/07/22 20:25:08 pier Exp $
>   - * $Revision: 1.5 $
>   - * $Date: 2001/07/22 20:25:08 $
>   + * $Header: 
>/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHostValve.java,v
> 1.6 2002/01/04 16:33:40 remm Exp $
>   + * $Revision: 1.6 $
>   + * $Date: 2002/01/04 16:33:40 $
> *
> * 
> *
>   @@ -71,8 +71,10 @@
>import javax.servlet.http.HttpServletResponse;
>import org.apache.catalina.Container;
>import org.apache.catalina.Context;
>   +import org.apache.catalina.Manager;
>import org.apache.catalina.Request;
>import org.apache.catalina.Response;
>   +import org.apache.catalina.Session;
>import org.apache.cata

Re: mod_webapp and other connectors status...

2002-01-09 Thread Daniel Rall

GOMEZ Henri <[EMAIL PROTECTED]> writes:

> BTW: How did we get TOMCAT 4.1 and 4.0.2 ? Which is the head ?

I believe that 4.1-dev is the tip of the HEAD, 4.0.2-dev is the tip of
tomcat_40_branch.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: nbio connector

2002-01-09 Thread Daniel Rall

"Attila Szegedi" <[EMAIL PROTECTED]> writes:

> Well I didn't want to bring this to the sunlight so soon but since
> you brought up the issue: I'm developing a generic non-blocking
> server framework for JDK 1.4.
>
> It handles all subtleties of the non-blocking server's life, such as
> non-blocking pipes for servlet output buffering, thread scaling
> (since a single selector handles at most 63 channels, you still need
> multiple threads), channel registration from a different thread than
> the thread that listens to the selector via a mechanism similar to
> Swing's invokeAndWait(), etc, etc. Using this framework, all you
> need to do is implement a single ProtocolHandler interface and focus
> your attention on the protocol implementation and not on the details
> of non-blocking I/O.

Have you looked at Matt Welsh's SEDA
?

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: mod_webapp and other connectors status...

2002-01-09 Thread Daniel Rall

"Craig R. McClanahan" <[EMAIL PROTECTED]> writes:

>> I believe that 4.1-dev is the tip of the HEAD, 4.0.2-dev is the tip of
>> tomcat_40_branch.
>
> That's correct.
>
> Currently I'm only building nightly distributions from the HEAD branch,
> but it would be fairly straightforward to do nightly builds of the 4.0
> branch as well.

I'm currently using nightlies from the HEAD and am running into some
SAX parser class loading issues (ClassCastExceptions due to classes
coming from different loaders).  Have their been any significant
changes to class loading in HEAD which are not in tomcat_40_branch?

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: How to find the Changelog files for different versions of Tomcat?

2002-01-10 Thread Daniel Rall

chenk <[EMAIL PROTECTED]> writes:

> I am doing research on software engineering. I wish to use the Tomcat as an
> example to analysis the process of the java open source software. It is
> important for me to get changelog files for different versions of the Tomcat. 
> I
> have tried my best, but can't find it.
>
> Are there anybody who would like to tell me how to find the
> Changelog file?
>
> Your help is highly appreciated!

http://jakarta.apache.org/site/cvsindex.html

http://cvs.apache.org/viewcvs/jakarta-tomcat-4.0/
Look at the RELEASE-NOTES* entries.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




[PATCH] Fix for data corruption in the Warp connector

2002-01-10 Thread Daniel Harding

When using the Warp connector, the read method of the stream returned by 
request.getInputStream() would return negative numbers for bytes greater than 0xEF. 
The attached patch fixes this problem.



--- WarpRequest.javaWed Jan  9 20:38:23 2002
+++ WarpRequest.java.newWed Jan  9 20:36:00 2002
@@ -139,7 +139,7 @@
 throw new IOException("Invalid WARP packet type for body");
 
 if (this.packet.pointer

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Re: [PATCH] Fix for data corruption in the Warp connector

2002-01-10 Thread Daniel Rall

Hi Daniel.  Pier checked this change into jakarta-tomcat-connectors
CVS a while back.  I don't believe it's been ported to the
jakarta-tomcat-4.0 repository yet -- it really needs to be, there have
been a lot of reports of this bug (though few fixes :).

Daniel Harding <[EMAIL PROTECTED]> writes:

> When using the Warp connector, the read method of the stream
> returned by request.getInputStream() would return negative numbers
> for bytes greater than 0xEF. The attached patch fixes this problem.
>
>
> --- WarpRequest.java  Wed Jan  9 20:38:23 2002
> +++ WarpRequest.java.new  Wed Jan  9 20:36:00 2002
> @@ -139,7 +139,7 @@
>  throw new IOException("Invalid WARP packet type for body");
>  
>  if (this.packet.pointer -return((int)this.packet.buffer[this.packet.pointer++]);
> +return((int)this.packet.buffer[this.packet.pointer++] & 0xFF);
>  
>  this.packet.reset();
>  this.packet.setType(Constants.TYPE_CBK_READ);

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




Re: [PATCH] JvmRoute changes

2002-01-14 Thread Daniel Rall

Hey Tom, when sending patches inline, you need to instruct your email
client to not line wrap at 76 columns (what's good for the humans
isn't good for the machines :-).

Dan

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: [PATCH] JvmRoute changes

2002-01-14 Thread Daniel Rall

Daniel Rall <[EMAIL PROTECTED]> writes:

> Hey Tom, when sending patches inline, you need to instruct your email
> client to not line wrap at 76 columns (what's good for the humans
> isn't good for the machines :-).

Look like you already noticed.  :-)

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




Re: Updating the site

2002-01-16 Thread Daniel Rall

I answered this on general@.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: [tomcat3] Sharing Utility Code

2002-01-18 Thread Daniel Rall

Like Jason suggests, feel free to park the servlet utilities in
jakarta-commons-sandbox/util (that's going to need a release pretty
soon anyways).

<[EMAIL PROTECTED]> writes:

> +1, it'll solve a lot of problems with jk and probably coyotee as well.
>
> I allways wanted to move some of the utils in commons, but there were
> allways more important things to do, but if there is at least one other
> project besides tomcat using it we should certainly make the change.
>
> I guess we need at least another +1, and that's Remy, who is also using
> some classes. And we can discuss if/when  jk2, coyotee, 3.3.1 ( or 2 )
> will start using the common package.
>
> It already is a problem, I had to do changes to C2B - the efficient
> char to byte used for output - and I can't do it in j-t-c/utils since
> it'll generate conflicts with 3.3.0.
>
>> In Turbine we have a new caching package that we have introduced and it uses
>> a few of the utility classes in the tomcat3 tree. We are having problems
>> with Gump because the package structure changed and some classes were
>> probably refactored and moved.
>>
>> I realize that these utilities are used internally for tomcat3 uses but I
>> was wondering if there's anyway we could share this code.
>>
>> Possibly in the commons-util package? It is in the sandbox right now only
>> because there wasn't a dire need to push it up to the top level, but if we
>> could get your code into the commons-util package I would be will to the
>> proposal and first release of that package.
>>
>> Any takers?

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




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

2002-01-30 Thread Daniel Rall

[EMAIL PROTECTED] writes:

> billbarker02/01/29 19:45:23
>
>   Modified:catalina/src/share/org/apache/catalina/connector
> HttpResponseBase.java
>   Log:
>   Fix for case where URL only has an anchor.
>   
>   Now response.encodeURL("#foobar") works as expected.

Thanks for fixing the other part of that issue, Bill.  I realized that
the other patch didn't statisfy the whole complaint when looking at
that Bugzilla message, but hadn't a chance to update the issue yet.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: HTML : multipart/form-data

2002-03-14 Thread Daniel Rall

Bojan Smojver <[EMAIL PROTECTED]> writes:

> On Wed, 2002-03-13 at 06:39, Jon Scott Stevens wrote:
>
>> p.s. Don't use JavaMail for it, because JavaMail tends to have a lot of
>> overhead.
>
> Yes, you're right. And I don't think you can limit (with JavaMail) how
> much data you want to allow, so that's another downside.

When dealing with MIME email messages (using MimeMessage), JavaMail
reads entire messages memory into memory at a time.  For huge
messages, this can be a very bad thing.  For Eyebrowse, I was able to
replace JavaMail's MimeMessage with my own skeleton implementation:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Problem with forward() and setCharacterEncoding

2002-03-28 Thread Marczisovszky Daniel

Hi,

My situation is the following: I have to servlets, let's call them
Forwarder and Test. I send requests (both GET and POST) to the
Forwarder servlet which uses request.getRequestDispatcher to forward
it to the Test servlet. I'm using Tomcat 4.0.3, but 4.0.4 produced the
same.

The problem is the following: when the Test servlet receives the
request in doGet or doPost, or even in service(), the parameters are
already parsed according to the ISO-8859-1 character encoding. This
makes impossible to specify the character encoding with
request.setCharacterEncoding() in the Test servlet.

Actually I can't tell where is it implemented exactly, because the
source code is too big for me, but I read the Servlet specification
and probably I know why this happens and what may be a workaround for
it.

The Servlet API 2.3 Specification says on page 56: "Parameters
specified in the query string used to create the RequestDispatcher
take precedence over other parameters of the same name passed to the
included servlet. The parameters associated with a RequestDispatcher
are scoped to apply only for the duration of the include or forward
call."

So when forwarding to a path "/servlet/Test?id=5678" the original id
parameter is overwritten with value 1234, if, for example the original
request was /servlet/Forwarder?id=1234.

I guess this overwriting is made by parsing the parameters in the
original request and parsing the parameters in the path specified for
the Dispatcher and after that they are merged. But at this point, the
original parameters are encoded with ISO-8859-1, and I'm loosing
valuable accented characters... Moreover, even posted parameters are
parsed, although the specification is not clear about it, but on page
58 (SRV.8.4.1) it says "The request dispatching mechanism is
responsible for aggregating query string parameters when forwarding or
including requests."

IMHO this means only query strings should be merged, but posted data
not.

Additionally the ServletInputStream is completely read (0 bytes can be
read from it) in the Test servlet, so I even can't reparse the
parameters.

My suggestion is that neither path nor the original query string
should be URLDecoded. Only those parts should be overwritten in the
original query string in which the parameter name equals to any in the
path string. Parameter parsing should be done in Test servlet, not in
Forwarder servlet.

Best wishes,
Daniel Marczisovszky


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




[PATCH/COMMENTS] Automatic Application Deployment and Host.liveDeploy

2002-04-18 Thread Daniel Rall

Added missing closing paren.

Index: host.xml
===
RCS file: /home/cvspublic/jakarta-tomcat-4.0/webapps/tomcat-docs/config/host.xml,v
retrieving revision 1.12
diff -u -u -r1.12 host.xml
--- host.xml20 Mar 2002 12:33:01 -  1.12
+++ host.xml19 Apr 2002 00:11:30 -
@@ -245,7 +245,7 @@
 If you are using the standard Host implementation,
 the following actions take place automatically when Catalina is first
 started, if the autoDeploy property is set to
-true (which is the default value:
+true (which is the default value):
 
 Any XML file in this directory is assumed to contain a
 Context element (and its associated

This "Automatic Application Deployment" section should also mention
the new liveDeploy flag.  This flag must be used in conjunction with
autoDeploy if the name of your web application directory differs from
the name of the Context where you mount your web app (when you want
_only_ the Context entries defined in server.xml to be deployed).

Consider the following layout:

$CATALINA_BASE/
  webapps/
secretapp/

...with a server.xml like:

  
...

  

The initial startup occurs, and secretapp is mounted at "/mycontext".
After the initial startup, if I haven't included liveDeploy="false" in
my  entry, Catalina's live deployment thread wanders over, spots
the "secretapp" directory under my Host's appBase, and decides to load
it as another web app (even though it has already been loaded and
mounted at "/mycontext").  Wasted resources aside, this can be painful
(example: consider the case where your web app's servlets open TCP
listener sockets).

Definitely worth mentioning in the doc, and perhaps protecting against
in some fashion in the code (if possible).

- Dan

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Replacing WebappClassLoader

2002-04-24 Thread Daniel Rall

"hung" <[EMAIL PROTECTED]> writes:

> Dear Tomcat Dev,
>   Is there a website that have the instruction on how to connection Tomcat 4
> with Apache 2?  Please help.  Made me running tomcat as module of apache.

This sort of question is most appropriate on the Tomcat User list.

The documentation for what you're asking about is located under the
"Connectors" section of the left nav in the following links:

http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/index.html
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/index.html

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




TC4-m4 startup

2000-11-06 Thread Daniel Ritchey

When and what loads the global web.xml located at 
%CATALINA_HOME%/conf/web.xml.

I need to know how to move the web.xml file and tomcat_users.xml from the 
conf directory to something like conf/catalina/

I know you can specify where server.xml should be loaded from, but how do 
you do this for the other files.



Daniel Ritchey
-
[EMAIL PROTECTED]
http://ritchey.dyndns.org
AIM: CaptainSlapHappy

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


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




Re: TC4-m4 startup

2000-11-06 Thread Daniel Ritchey

I think I got it figured out ...

do you do something like this...



Then write a ContextConfig that loads the Constants from a properties file 
or something...

Does this sound right?

Thanks ...

>When and what loads the global web.xml located at
>%CATALINA_HOME%/conf/web.xml.
>
>I need to know how to move the web.xml file and tomcat_users.xml from the
>conf directory to something like conf/catalina/
>
>I know you can specify where server.xml should be loaded from, but how do
>you do this for the other files.
>
>
>
>Daniel Ritchey
>-
>[EMAIL PROTECTED]
>http://ritchey.dyndns.org
>AIM: CaptainSlapHappy
>
>_
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>Share information about yourself, create your own public profile at
>http://profiles.msn.com.
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


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




Re: TC4-m4 startup

2000-11-07 Thread Daniel Ritchey

>Hi,
>
> You can add these lines to Tomcat conf/server.xml:
>
>
>
> The directory path/YourApp have to contains a subdirectory WEB-INF.
>

Let me clarify a bit, I was wondering how it is you change the location of 
the base web.xml found in the %TOMCAT_HOME%/conf directory.  Last night I 
posted what I think might be a possible solution, but haven't had a chance 
to test it.

Another question...
is the base web.xml even used or necessary, what purpose does it serve?

Just trying to get a handle on all this...

Thanks,

Daniel Ritchey
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


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




Re: TC4-m4 startup

2000-11-07 Thread Daniel Ritchey





>You've got it basically right.
>
>The global configuration files are all assumed to be in
>"%CATALINA_HOME%/conf", and the global web.xml in particular is read in
>org.apache.catalina.startup.ContextConfig.
>
>Do you need to do something in particular that you can't fix just by 
>setting
>CATALINA_HOME appropriately?

I was just doing some experimenting with some stuff i had developed and was 
merging my stuff with the catalina stuff, among other things.

I would perfer to have a directory structure like

myproject
  +--conf
   +--catalina (web.xml, server.xml, etc.)
   |
   +--myproject
   |
   +--otherstuff

So back to the original question, how do I specify where the base web.xml 
file should be loaded from.

>You've got it basically right.

What would be completely right?

I have started work on what I think will work (Making my own 
startup.ContextConfig, startup.Constants, and startup.Catalina classes that 
are dependent on properties files instead of hardcoded locations (for 
example say I want the conf dir. to be called config instead).  Property 
files isn't the greatest of solutions but I think it will work and add bit 
more flexibility.

I still have alot to figure out about how catalina is setup, so this all 
might be unecessary.

Thanks,

Daniel Ritchey
-
[EMAIL PROTECTED]
http://ritchey.dyndns.org
AIM: CaptainSlapHappy

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


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




Re: TC4-m4 startup

2000-11-08 Thread Daniel Ritchey

I think you missed my point ...
I want to make project that uses the catalina core, similar to how Tomcat is 
a project that uses the catalina core.  Meaning I want to use the catalina 
stuff in my project to run servlets.  My project is not a webapp that gets 
put in the webapp dir as a war file, but is an application, like tomcat, 
that runs webapps.

So just as

jakarta-tomcat
  |
  +--conf
  |
  +--webapps

I would like to setup something like
myproject
  |
  +--conf
  |   |
  |   +--catalina
  |   |
  |   +--myproject
  |
  +--webapps

This wouldn't violate the .war specification becasue it isn't a .war webapp.

So back to my original question, how exactly do I define where the base 
web.xml file is located.

I pretty much resolved to making my own catalina startup package that uses 
value from a properties file rather than hardcoded values.

I hope what I mean is clear...

Daniel Ritchey

>I think what you say you want to do is going to violate the spec for what
>a WAR file is supposed to be for. Your web.xml is supposed to be packaged
>with your WAR ("*.war") file: your WAR file is supposed to contain not
>only your app, but also the content and resources your app needs, this
>includes html, jpgs, properties et al.
>
>That WAR file unpacks into a kind of document root that must have a
>standards-based layout (I believe it's either the servlet API standard
>or it's the J2EE, I'm not sure). If all you know is IIS or Apache, this
>is going to be a bit confusing.
>
>The idea of a WAR file is that it more closely solves problems related to
>how business organizations develop and deploy content, including how ISPs
>deploy content for customers.
>
>In the end, it's supposed to make things easier and more secure than
>current web-server-specific techniques for deploying content. These are
>the goals, at least.
>
>Hope this helps.

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


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




Re: TC4-m4 startup

2000-11-08 Thread Daniel Ritchey

>You might look at the org.apache.catalina.startup.Embedded class, which 
>lets you
>bypasses the global configuration files and do things yourself.

Ahhh, I hadn't looked at org.apache.catalina.startup.Embedded, this should 
work perfectly for what I need.

Thanks for everyone's patience and help,

Daniel Ritchey
-
[EMAIL PROTECTED]
http://ritchey.dyndns.org
AIM: CaptainSlapHappy

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


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




RE: How can I ckeck how many users are connected to a Web Site?

2002-08-01 Thread Daniel Leong

Hi,

Perhaps the Interface HttpSessionListener (servlet 2.3+ spec only!) could be
used?

Dan

-Original Message-
From: Luca Ventura [mailto:[EMAIL PROTECTED]]
Sent: 01 August 2002 14:13
To: tomcat-dev
Subject: How can I ckeck how many users are connected to a Web Site?


Hello everybody!

I would like to know if it is possible to know in any moment
how many users are connected to a Web Site.

How can I do this?

Thanks a lot in advance!

  Luca

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




[PATCH] Remove redundant constructor from StandardSessionFacade

2003-01-29 Thread Daniel Rall
* catalina/src/share/org/apache/catalina/session/StandardSessionFacade.java
  StandardSessionFacade(StandardSession): Removed redundant constructor.  As 
  StandardSession implements HttpSession, the 
  StandardSessionFacade(HttpSession) constructor already does the job 
  admirably.


--- 
/tmp/jakarta-tomcat-4.1.18-src/catalina/src/share/org/apache/catalina/session/StandardSessionFacade.java
Wed Jan 29 15:56:00 2003
+++ /tmp/StandardSessionFacade.java Wed Jan 29 15:56:00 2003
@@ -104,15 +104,6 @@
 /**
  * Construct a new session facade.
  */
-public StandardSessionFacade(StandardSession session) {
-super();
-this.session = (HttpSession) session;
-}
-
-
-/**
- * Construct a new session facade.
- */
 public StandardSessionFacade(HttpSession session) {
 super();
 this.session = session;



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




Taglib lifecycle issues

2003-06-20 Thread Daniel Rabe
I'm using Tomcat 4.1.24-LE-jdk14, and have written a simple taglib by
extending the TagSupport class. It basically works, but the lifecycle is
being handled differently than I expected. My tag has no body, and has one
required attribute. My JSP page contains several invocations, all with
different values for the attribute. I expected setPageContext() to be called
once, followed by a bunch of doStartTag() / doEndTag() calls, followed by
one release() call. Instead, setPageContext() is being called for each
invocation of my tag (followed by doStartTag() and doEndTag()). My release()
method is *never* called.

I'm basing my expectations on the JSP 1.2 spec, esp pp. 163-164, and the
discussion about "Tag handler life cycle and instance reuse" at
http://www.onjava.com/pub/a/onjava/2001/11/07/jsp12.html?page=2.

The two issues in my mind are: (a) Is this working according to spec?
Perhaps I misunderstood how it's supposed to work. and (b) Could this be
done more efficiently? Replacing several scriptlet method calls with a
taglib caused the JSP's class file to double in size.

The code that's being generated for the JSP includes a bunch of private
methods that look like this:
  private boolean _jspx_meth_xlate_get_61(javax.servlet.jsp.PageContext
pageContext)
  throws Throwable {
JspWriter out = pageContext.getOut();
/*   xlate:get  */
com.eloquent.ecs.tags.xlate.EXlateTagGet _jspx_th_xlate_get_61 =
(com.eloquent.ecs.tags.xlate.EXlateTagGet)
_jspx_tagPool_xlate_get_key.get(com.eloquent.ecs.tags.xlate.EXlateTagGet.cla
ss);
_jspx_th_xlate_get_61.setPageContext(pageContext);
_jspx_th_xlate_get_61.setParent(null);
_jspx_th_xlate_get_61.setKey("jsp.edownloadplayer.File");
int _jspx_eval_xlate_get_61 = _jspx_th_xlate_get_61.doStartTag();
if (_jspx_th_xlate_get_61.doEndTag() ==
javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
  return true;
_jspx_tagPool_xlate_get_key.reuse(_jspx_th_xlate_get_61);
return false;
  }

Thanks for any insights you can provide.

Daniel Rabe
Eloquent, Inc.



Session restore classloading problem

2002-10-24 Thread Daniel . HAMS
Dear developers, (apologies for the expected crap formatting from outlook)

Just want to know if this is expected behavoir.

I've had some trouble with sessions being restored on tomcat restart when
data stored in the session is an object array.

e.g.

if (action != null && action.equals("insert"))
{
System.out.println("Action was insert - will create
a new one.");
SomeDataClass[] twoSize = new SomeDataClass[2];
twoSize[0] = new SomeDataClass();
twoSize[1] = new SomeDataClass();
session.setAttribute( "data", twoSize);
}
else if (action != null && action.equals("retrieve"))
{
SomeDataClass[] twoArray =
(SomeDataClass[])session.getAttribute("data");
if (twoArray == null)
{
System.out.println("I did not get back an
object :-(");
}
else
{
System.out.println("I got back the object: "
+ twoArray.toString());
}
}

On restart of tomcat (with SomeDataClass[] in the session) I get the
following on startup, with the session data trashed:

2002-10-24 13:53:59 StandardManager[/test] Exception loading sessions from
persistent storage java.lang.ClassNotFoundException: [LSomeDataClass;
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1428)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1274)
at
org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectIn
putStream.java:119)
at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1503)
at
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1425)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1550)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1261)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
at
org.apache.catalina.session.StandardSession.readObject(StandardSession.java:
1357)
at
org.apache.catalina.session.StandardSession.readObjectData(StandardSession.j
ava:852)
at
org.apache.catalina.session.StandardManager.load(StandardManager.java:411)
at
org.apache.catalina.session.StandardManager.start(StandardManager.java:626)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3496)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:8
21)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.j
ava:257)

I am running:

Tomcat 4.1 win32 with apache2, default install, minus 8080 listener.

My question is - is this expected behavoir, or should the WebappClassLoader
be handling this compound type of array?

Thanks for any help,

Daniel Hams
DG Trade A4
European Commission
Tel: +32.2.299.96.81
Fax: +32.2.295.38.56
Email: [EMAIL PROTECTED]


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




[PATCH][JK] Ajp13Processor connection leak prevention

2002-11-06 Thread Daniel Rall
Adjusted Ajp13Processor's run() method to protect against unexpected
unchecked excpetions, preventing the possibility of a leak in
Ajp13Connector's request processor pool.

Index: Ajp13Processor.java
===
RCS file: 
/home/cvspublic/jakarta-tomcat-connectors/jk/java/org/apache/ajp/tomcat4/Ajp13Processor.java,v
retrieving revision 1.9
diff -u -u -r1.9 Ajp13Processor.java
--- Ajp13Processor.java 7 Jun 2002 18:54:21 -   1.9
+++ Ajp13Processor.java 6 Nov 2002 08:01:14 -
@@ -547,14 +547,16 @@
 logger.log("socket assigned.");
 }
 
-   // Process the request from this socket
-   process(socket);
-
-   // Finish up this request
-if (debug > 0) {
-logger.log("recycling myself ...");
+try {
+// Process the request from this socket
+process(socket);
+} finally {
+// Finish up this request
+if (debug > 0) {
+logger.log("recycling myself ...");
+}
+connector.recycle(this);
 }
-   connector.recycle(this);
}
 
// Tell threadStop() we have shut ourselves down successfully



On another note, what's the most robust Java and Apache httpd
connector code bases these days for Tomcat 4.1?  Not trying to start a
religious war -- interested in your opinions.  Please send me to the
appropriate docs if this is a RTFM question.

Thanks!
-- 

Daniel Rall <[EMAIL PROTECTED]>

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




Servlet API support for multiple HTTP status codes (1xx)?

2003-11-03 Thread Daniel Rall
Question

How to send multiple 1xx responses and a final 200 response to a single request?


An example
--
A HTTP/1.1 user agent (UA) sends a large, multi-GB XML data file to your server. 
 Thirty seconds pass and the server is still digesting the data file.  The 
server responds with a 100 status code to inform the UA to continue waiting. 
Another 30 seconds pass -- rinse, repeat ten more times over the same HTTP 
connection.  Withouth the 1xx responses, a UA like MS IE or Mozilla would've 
timed out the request by now.  Seven more seconds pass and the server finally 
gets back to the UA with the real response -- a fancy PDF-formatted graphical 
representation of their XML file, perhaps.



Some background
---
HTTP/1.1 (RFC 2616) [1] defines informational status codes as those in the 1xx 
range, and indicates that HTTP/1.1 UAs must be prepared to accept many such 
intermediate responses before the final response (to the single, original request).

Here's the relevant section from RFC 2616:

10.1 Informational 1xx

   This class of status code indicates a provisional response,
   consisting only of the Status-Line and optional headers, and is
   terminated by an empty line. There are no required headers for this
   class of status code. Since HTTP/1.0 did not define any 1xx status
   codes, servers MUST NOT send a 1xx response to an HTTP/1.0 client
   except under experimental conditions.
   A client MUST be prepared to accept one or more 1xx status responses
   prior to a regular response, even if the client does not expect a 100
   (Continue) status message. Unexpected 1xx status responses MAY be
   ignored by a user agent.
   Proxies MUST forward 1xx responses, unless the connection between the
   proxy and its client has been closed, or unless the proxy itself
   requested the generation of the 1xx response. (For example, if a
   proxy adds a "Expect: 100-continue" field when it forwards a request,
   then it need not forward the corresponding 100 (Continue)
   response(s).)
10.1.1 100 Continue

   The client SHOULD continue with its request. This interim response is
   used to inform the client that the initial part of the request has
   been received and has not yet been rejected by the server. The client
   SHOULD continue by sending the remainder of the request or, if the
   request has already been completed, ignore this response. The server
   MUST send a final response after the request has been completed. See
   section 8.2.3 for detailed discussion of the use and handling of this
   status code.


WebDAV extensions to HTTP/1.1 (RFC 2518) [2] continues definition of 
informational status codes with 102 (Processing) as a way for the server to 
provide "yes I'm still working so hold your horses" feedback to the UA when 
dealing with long-lived requests.  Using our XML -> PDF example from above, this 
is a bit more descriptive than "continue waiting" 100 response, indicating not 
just that the UA should wait, but also that the server is indeed working on 
proessing the request.  Here's the relevant section:

10.1 102 Processing

   The 102 (Processing) status code is an interim response used to
   inform the client that the server has accepted the complete request,
   but has not yet completed it.  This status code SHOULD only be sent
   when the server has a reasonable expectation that the request will
   take significant time to complete. As guidance, if a method is taking
   longer than 20 seconds (a reasonable, but arbitrary value) to process
   the server SHOULD return a 102 (Processing) response. The server MUST
   send a final response after the request has been completed.
   Methods can potentially take a long period of time to process,
   especially methods that support the Depth header.  In such cases the
   client may time-out the connection while waiting for a response.  To
   prevent this the server may return a 102 (Processing) status code to
   indicate to the client that the server is still processing the
   method.


Servlet API lacking?

Brief examination of the source for Tomcat 4.1 leads me to believe that though 
sendError(int) does provide a way for communicating informational responses in 
the 1xx range -- which incidently aren't error conditions -- that later attempts 
to communicate additional 1xx or the final 200 response are not supported, and 
result in an IllegalStateException or IOException or some such.  Without writing 
code directly against Tomcat's own API to gain access to the underlying TCP 
socket connection (rather than against the more portable Servlet API), I'm not 
seeing a way of sending multiple interim responses to the UA.  Is Servlet API 
2.3 really lacking this feature, or did I just miss it somewhere?  If so, is 
this feature planned for future versions of the Servlet API, and is there an 
interim work-around?

Thanks for your time,
Dan
p.s. Please CC me on any responses.

[1] http://www.ietf.org/rfc/rfc

Re: Re: Minimal HOWTO for jk2 2.0.4 - Was: [Fwd: Releasing JK 2.0.4]

2004-03-19 Thread Daniel Savard
>--- Guenter Knauf <[EMAIL PROTECTED]> wrote:
><>
>>I would like to see some
>> feedback from those admins who have to install the connectors what
>they would
>> prefer.
>
>A quick start covering:
>- What to download
>- What to compile
>- Compatible Apache versions
>- Which folder to copy files into
>- What entries does Apache expect
>- What workers and MPM are and how we can configure them
>
>> thanks, Guenter.
>> 
>-- Sriram

Well, given my recent trauma, oups experience, setting up mod_jk2, may I
suggest a few things?

- A working configure script. Let me explain what I expect from a
configure script. It should check all requirements are met including
proper versions and not require more than necessary (for example, if
Berkley BD version 2.5 and up is fine, do not insist on version 4.0
because it may have some cascading effect on my system and if not
necessary, why should someone insist I upgrade 50% of the packages on
the system?)

- Working Makefiles. This is a side effect of a working configure
script. Given proper checking and identification of the system, the  
proper Makefiles should be build. This include the appropriate list of
libraries I should link to in order to have working modules. To make
things clear, I should never get undefined symbols at runtime because
the Makefile never specified a complete list of libraries required to
resolve all the symbols in my module and the module has no hint on where
it should look for the undefined symbols to get them resolved. The
sysadmin is not supposed to be a developper (even if it happens it's not
always true) and don't expect him to manually edit the Makefile to make
it working with his system. If the configure cannot find the libraries,
it means they are not installed or the user didn't specified the correct
options to configure (library paths, if any) and it should be catch at
the configure step, not at runtime.

- A comprehensive guide of the configuration options (properties), not
necessarily something lengthy, but enough to figure out what is the
purpose of each configuration option and how it is used.

- Don't make any RPMS available if it is not possible to guarantee they
will provide a working system. Instead, with limited man-power and time,
I think it will be a better move to invest in a clean, documented,
straight forward building process with consistent results.

This should reduce drastically the number of redundant questions on the
Tomcat-user mailing list (including mines).



-- 

===
Daniel Savard
Consultation Informatique Daniel Savard
551, boul. Sir-Wilfrid-Laurier
suite 105
Beloeil, (Québec)
Canada J3G 4J1

Tél: (450) 467-8014
Internet: [EMAIL PROTECTED]
===



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



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

2004-04-01 Thread daniel andefors
Hi,

IMO, this will not work if you are trying to avoid serializing attributes 
with the name "javax.security.auth.subject".

Daniel


From: [EMAIL PROTECTED]
Reply-To: "Tomcat Developers List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: cvs commit: 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session 
StandardSession.java
Date: 1 Apr 2004 17:39:53 -

jfarcand2004/04/01 09:39:53

  Modified:catalina/src/share/org/apache/catalina Globals.java
   catalina/src/share/org/apache/catalina/session
StandardSession.java
  Log:
  Minor fixe. Instead of using an exclude list, make the variable 
transient.

  Revision  ChangesPath
  1.8   +2 -2  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Globals.java

  Index: Globals.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Globals.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Globals.java	27 Feb 2004 14:58:38 -	1.7
  +++ Globals.java	1 Apr 2004 17:39:53 -	1.8
  @@ -287,7 +287,7 @@
   /**
* The subject under which the AccessControlContext is running.
*/
  -public static final String SUBJECT_ATTR =
  +public static transient final String SUBJECT_ATTR =
   "javax.security.auth.subject";





  1.42  +2 -26 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/StandardSession.java

  Index: StandardSession.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/StandardSession.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- StandardSession.java	25 Mar 2004 22:17:54 -	1.41
  +++ StandardSession.java	1 Apr 2004 17:39:53 -	1.42
  @@ -160,14 +160,6 @@

   /**
  - * Set of attribute names which are not allowed to be persisted.
  - */
  -private static final String[] excludedAttributes = {
  -Globals.SUBJECT_ATTR
  -};
  -
  -
  -/**
* We are currently processing a session expiration, so bypass
* certain IllegalStateException tests.  NOTE:  This value is not
* included in the serialized version of this object.
  @@ -1393,8 +1385,7 @@
   }
   if (value == null)
   continue;
  -else if ( (value instanceof Serializable)
  -&& (!exclude(keys[i]) )) {
  +else if ( (value instanceof Serializable) ) {
   saveNames.add(keys[i]);
   saveValues.add(value);
   } else {
  @@ -1422,21 +1413,6 @@
   }
   }
  -}
  -
  -
  -/**
  - * Exclude attribute that cannot be serialized.
  - * @param name the attribute's name
  - */
  -protected boolean exclude(String name){
  -
  -for (int i = 0; i < excludedAttributes.length; i++) {
  -if (name.equalsIgnoreCase(excludedAttributes[i]))
  -return true;
  -}
  -
  -return false;
   }




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Chat: Ha en fest på Habbo Hotel 
http://habbohotel.msn.se/habbo/sv/channelizer Checka in här!

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


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

2004-04-01 Thread daniel andefors



From: Jeanfrancois Arcand <[EMAIL PROTECTED]>
Reply-To: "Tomcat Developers List" <[EMAIL PROTECTED]>
To: Tomcat Developers List <[EMAIL PROTECTED]>
Subject: Re: cvs commit: 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session 
StandardSession.java
Date: Thu, 01 Apr 2004 14:13:42 -0500



daniel andefors wrote:

Hi,

IMO, this will not work if you are trying to avoid serializing attributes 
with the name "javax.security.auth.subject".
You are right. The key will not be serializable, but the value will be. I 
also need to make the value (e.g. the Subject) transient.
Actually, i think that will not help either. AFAIK, the transient keyword
should only be used on non-static fields to make the *default* serialization
mechanism exclude that field (i.e., oos.defaultWriteObject() will not write
transient fields, oos.writeObject(...) will write whatever object used as
argument assuming it implements java.io.Serializable or 
java.io.Externalizable).
Although, i might be wrong, and if I am I should probably give you my
SCJP diploma ;-)

Daniel


Thanks!

-- Jeanfrancois


Daniel


From: [EMAIL PROTECTED]
Reply-To: "Tomcat Developers List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: cvs commit: 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session 
StandardSession.java
Date: 1 Apr 2004 17:39:53 -

jfarcand2004/04/01 09:39:53

  Modified:catalina/src/share/org/apache/catalina Globals.java
   catalina/src/share/org/apache/catalina/session
StandardSession.java
  Log:
  Minor fixe. Instead of using an exclude list, make the variable 
transient.

  Revision  ChangesPath
  1.8   +2 -2  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Globals.java

  Index: Globals.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Globals.java,v

  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Globals.java27 Feb 2004 14:58:38 -1.7
  +++ Globals.java1 Apr 2004 17:39:53 -1.8
  @@ -287,7 +287,7 @@
   /**
* The subject under which the AccessControlContext is running.
*/
  -public static final String SUBJECT_ATTR =
  +public static transient final String SUBJECT_ATTR =
   "javax.security.auth.subject";




  1.42  +2 -26 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/StandardSession.java

  Index: StandardSession.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/StandardSession.java,v

  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- StandardSession.java25 Mar 2004 22:17:54 -1.41
  +++ StandardSession.java1 Apr 2004 17:39:53 -1.42
  @@ -160,14 +160,6 @@
   /**
  - * Set of attribute names which are not allowed to be persisted.
  - */
  -private static final String[] excludedAttributes = {
  -Globals.SUBJECT_ATTR
  -};
  -
  -
  -/**
* We are currently processing a session expiration, so bypass
* certain IllegalStateException tests.  NOTE:  This value is not
* included in the serialized version of this object.
  @@ -1393,8 +1385,7 @@
   }
   if (value == null)
   continue;
  -else if ( (value instanceof Serializable)
  -&& (!exclude(keys[i]) )) {
  +else if ( (value instanceof Serializable) ) {
   saveNames.add(keys[i]);
   saveValues.add(value);
   } else {
  @@ -1422,21 +1413,6 @@
   }
   }
  -}
  -
  -
  -/**
  - * Exclude attribute that cannot be serialized.
  - * @param name the attribute's name
  - */
  -protected boolean exclude(String name){
  -
  -for (int i = 0; i < excludedAttributes.length; i++) {
  -if (name.equalsIgnoreCase(excludedAttributes[i]))
  -return true;
  -}
  -
  -return false;
   }




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Chat: Ha en fest på Habbo Hotel 
http://habbohotel.msn.se/habbo/sv/channelizer Checka in här!

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

Daniel Vanderhoof is out of the office.

2005-02-24 Thread daniel . vanderhoof
I will be out of the office starting  02/14/2005 and will not return until
03/01/2005.

I will not have access to e-mail while I am away from the office.  I will
respond to your message when I return.




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



procrun and stack size

2005-03-24 Thread Daniel Rabe
I'm running Tomcat 5.0.28 on Windows XP Pro. I recently discovered that the 
number of threads I could create from within my webapp was significantly less 
than I could running a program with java.exe. After a lot of research, I 
discovered that if you run a JVM from a C wrapper (as Tomcat does with 
procrun), the default stack size is taken from the "stack reserve" field in the 
.exe header. Passing -Xss to the created JVM does not appear to have any 
effect. Has anybody considered building Tomcat's procrun with a smaller stack 
size, to make it more consistent with java.exe? In j2sdk 1.4.2_06 (I haven't 
looked at other versions), java.exe is linked with a 256k stack. I would 
suggest that would be a reasonable size for Tomcat as well.

Thanks,
--Daniel Rabe



Windows service shutdown not invoking destroy()?

2005-03-25 Thread Daniel Rabe
I'm running Tomcat 5.0.28 on Windows XP Pro as a Windows service. If I use 
shutdown.bat to stop Tomcat, then the destroy() method of my servlet is 
invoked. If I simply "stop" the Windows service, destroy() apparently is NOT 
called. The behavior is not consistent; I've seen it work on one machine, but 
not on another. I uninstalled and re-installed on the machine where it wasn't 
working, and it didn't make a difference (still doesn't work).

Has anyone else run into this? Any ideas on what might cause the problem?

Thanks,
--Dan



RE: procrun and stack size

2005-03-30 Thread Daniel Rabe
   }
}

public synchronized void release()
{
notify();
}
}
%>


Done.
--- 

-Original Message-
From: Mladen Turk [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 24, 2005 11:58 PM
To: Tomcat Developers List
Subject: Re: procrun and stack size

Daniel Rabe wrote:
> I'm running Tomcat 5.0.28 on Windows XP Pro. I recently discovered that the 
> number of threads I could create from within my webapp was significantly less 
> than I could running a program with java.exe. After a lot of research, I 
> discovered that if you run a JVM from a C wrapper (as Tomcat does with 
> procrun), the default stack size is taken from the "stack reserve" field in 
> the .exe header. Passing -Xss to the created JVM does not appear to have any 
> effect. Has anybody considered building Tomcat's procrun with a smaller stack 
> size, to make it more consistent with java.exe? In j2sdk 1.4.2_06 (I haven't 
> looked at other versions), java.exe is linked with a 256k stack. I would 
> suggest that would be a reasonable size for Tomcat as well.
>

I do not understand you question.
If it's how to set the stack size for the JVM, you can either use
manager gui or when install/update parameters use the
--JvmSs=NN that will be passed as -XssNNk

OTOH have no idea what would be the 'optimum' default stack size.
Also I'm not sure that java.exe itself sets the -Xss by itself unless
you explicitly pass that in command line.

Regards,
Mladen


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



[PATCH] Bug # 1002 patch (plus misc)

2001-03-22 Thread Matthew L Daniel


All of these patches are against the jakarta-tomcat-4.0-b1.tar.gz
distribution, since it gave me a stable(?) place from which to work.  If I
have commited a faux pas by doing this, just let me know.

Bug 1002 is in regard to the SecurityException: sealing violation.
The comments and javadoc explain in detail, but the brief idea is that
there is a HIGH likelyhood that the sealing exception is caused by a user's
WEB-INF entry, thus, to circumvent the SecurityException just catch it and
delegate to the parent classloader (who has a HIGH likelyhood of containing
the real jar, otherwise we wouldn't have gotten the SecurityException).

This patch also fixes a NullPointerException (I hate those) because
our WebApp (deployed from our filesystem) did not contain a Manifest.  This is
a double patch, since the Extension class did not return empty Lists like the
javadoc said it would, and the StandardClassLoader didn't check for there not
being a Manifest before calling Extension.  I saw that someone else in the
mailing list called this out, but it was still broken in 4.0-b1.

Also included in this patch (for continutity) is the RequestBase
returning -1 as the server port, which IMHO is extremely bad.  Above and
beyond the moral implications of a port being -1, when used with my Warp
connection it was returning "Location: http://localhost:-1/index.jsp" headers.

Further included in this patch is a WarpEngine correction with regard
to the HostID not being initialized.  I realize that this is a touch "kludgy",
but that's why it's OpenSource, right? :-)

In the separate file, I patched the JikesJavaCompiler to work to my
liking.  :-)  Seriously, on the Linux Sun 1.3.0_02 vm (and prior ones), the
java.class.path does not contain rt.jar, which jikes will not work without.  I
saw that someone had already included a workaround for MicrosoftVM, so I just
updated it.

In the last patch, I found it a thousand times more useful to use the
Ant support for property files rather than trying to monkey with your build.sh
and the 100 environmental variables.  I think including this patch in the
standard distribution is a Good Thing(tm) because if the user wants to use
build.properties, great, and if not Ant will /silently/ ignore the entry.

I also know how to make a WebApp talk to Inprise Application Server
using only the WebApp (contra starting Catalina using vbj), if anyone is
interested in such a trick.

  I hope these help you as much as they help me.
  -- /v\atthew
-- 
Matthew L Daniel Discovery is seeing what everybody 
Internet Developer,  else has seen, and thinking what 
Still Current Development, Inc.  nobody else has thought.
[EMAIL PROTECTED] -- Albert, Szent-Gyorgi


diff -Nru src_orig/catalina/src/share/org/apache/catalina/connector/RequestBase.java 
src/catalina/src/share/org/apache/catalina/connector/RequestBase.java
--- src_orig/catalina/src/share/org/apache/catalina/connector/RequestBase.java  Sat 
Dec 23 22:40:15 2000
+++ src/catalina/src/share/org/apache/catalina/connector/RequestBase.java   Wed 
+Mar 21 19:13:51 2001
@@ -97,6 +97,7 @@
  * be used for the Request implementation required by most Connectors.  Only
  * the connector-specific methods need to be implemented.
  *
+ * @author Matthew L Daniel <[EMAIL PROTECTED]>
  * @author Craig R. McClanahan
  * @version $Revision: 1.9 $ $Date: 2000/12/22 18:58:00 $
  */
@@ -929,6 +930,19 @@
  * Return the server port responding to this Request.
  */
 public int getServerPort() {
+if( serverPort == -1 ) {
+// If they didn't say, presume the worst.
+serverPort = secure ? 443 : 80;
+// This is only to print the stack trace to the output so
+// someone smarter than me can REALLY fix this.
+try {
+throw new IllegalArgumentException(
+"ServerPort is -1; secure is "+secure
++", so I am returning "+serverPort);
+} catch( IllegalArgumentException iae ) {
+iae.printStackTrace(System.out);
+}
+}
 
return (this.serverPort);
 
diff -Nru 
src_orig/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java 
src/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java
--- src_orig/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java 
 Sat Dec 23 22:40:15 2000
+++ src/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java   Wed 
+Mar 21 19:15:00 2001
@@ -72,6 +72,7 @@
 /**
  *
  *
+ * @author Matthew L Daniel <[EMAIL PROTECTED]>
  * @author mailto:[EMAIL PROTECTED]">Pier Fumagalli
  * @author Copyright © 1999, 2000 http://www.apache.org">The
  * Apache Software Foundation.
@@ -176,6 +177,11 @@

[PATCH] catalina.sh more flexible

2001-03-22 Thread Matthew L Daniel

Sorry, I forgot to include this is the last post.  But, after looking
at what these patches provide, I guess it's better I didn't include them in
the last post. :-)

Basically, I enjoy greatly having files that prevent me from syncing
environmental variables.  This just makes catalina.sh find it's CATALINA_HOME
more intelligently, if such a .rc is available.  I hijacked the idea from Ant
and it's .antrc.

And, I like a restart command, but that's just me.

  HTH,
  -- /v\atthew
-- 
Matthew L Daniel Discovery is seeing what everybody 
Internet Developer,  else has seen, and thinking what 
Still Current Development, Inc.  nobody else has thought.
[EMAIL PROTECTED] -- Albert, Szent-Gyorgi


--- bin/catalina.sh_origMon Mar 19 17:45:49 2001
+++ bin/catalina.sh Mon Mar 19 17:46:21 2001
@@ -16,6 +16,9 @@
 # -
 
 
+if test -f $HOME/.catalinarc; then
+. $HOME/.catalinarc;
+fi
 # - Verify and Set Required Environment Variables -
 
 if [ -z "$CATALINA_HOME" ] ; then
--- /dev/null   Wed Sep 27 06:31:54 2000
+++ bin/restart.sh  Mon Mar 19 17:59:17 2001
@@ -0,0 +1,10 @@
+#!/bin/sh
+# -
+# startup.sh - Start Script for the CATALINA Server
+#
+# $Id: startup.sh,v 1.1 2000/08/11 05:22:16 craigmcc Exp $
+# -
+
+BASEDIR=`dirname $0`
+$BASEDIR/catalina.sh stop "$@"
+$BASEDIR/catalina.sh start "$@"



sealing violation still exists? Was: [FOLLOWUP] Proposed Tomcat 4.0-Beta-2 Code Freeze Date?

2001-03-28 Thread Matthew L Daniel

> I believe that someone is working on the "sealing viloation" fix that he
> wanted to include in beta 2.

Can someone confirm (from a CVS build) that this bug still exists?  The
biggest thing that I need to see from someone else's machine is:
* use the CVS jakarta-servletapi-4, 
* use the CVS jakarta-regexp-1.3-dev,
* and make /double-backflippingly/ sure that the jars Catalina uses are still
Sealed: true.  The jars in your webapp shouldn't matter, but the ones in the
various lib directories of Catalina must still be sealed (as they are by
default)

In unix, my favorite way of testing this is:
cd $CATALINA_HOME;
for j in `find . -name "*.jar"`; do
echo $j; 
unzip -c $j META-INF/MANIFEST.MF | grep Sealed;
done

You should see that jaxp.jar and crimson.jar ARE, repeat, ARE sealed.  If
they are not, and you don't get the sealing violation, then you are a victim
of the earlier CVS commits of unsealed jars.

However, if you jump through my little hoops and you still don't (or do)
get the sealing violation, PLEASE send me (and/or the list) email.  The
problem has vanished on my development machine, so it makes tracking the
problem a nightmare.

Craig knows all of this, but the more input I can get the better.

  -- /v\atthew
-- 
Matthew L DanielNever put off until tomorrow what you can do today.
Wizard  There might be a law against it by that time.
[EMAIL PROTECTED]-- `/usr/bin/fortune`



Re: SSL-Keytool Problem

2001-03-28 Thread Matthew L Daniel

> You can download a SunJSSE RSA provider which is free from the java.sun home
> site.

Also look at http://www.openjce.org/ as that may or may not fit your
licensing needs better than Sun's license.

> After installing the JSSE, you need to copy the lib/*.jar to the jre's
> lib/ext directory.

Don't forget to add the provider to your
JRE_HOME/lib/security/java.security file.  It should go after
security.provider.1 but before security.provider.2 (at least with OpenJCE).
YMMV.

  -- /v\atthew
-- 
Matthew L DanielNever put off until tomorrow what you can do today.
Wizard  There might be a law against it by that time.
[EMAIL PROTECTED]-- `/usr/bin/fortune`



Re: TC3.3 Proposal: Refactoring org.apache.jasper.servlet

2001-03-28 Thread Matthew L Daniel

> ( BTW, my interest is more in the jsp->java convertor area, I would be
> interested to try a more customizable generator that would use XSL
> templates, but that depends on a modularization and refactoring that would 

I remember back in the "old days" when the JSP spec actually contained a
representation of JSP syntax as XML tags ( and whatnot), but
Tomcat didn't support it because (as I recall) Sun deprecated it.  I'm with
Costin, I think that would be/was just super-cool.

I just wanted you to know you're not alone, Costin. :-)

  -- /v\atthew
-- 
Matthew L DanielNever put off until tomorrow what you can do today.
Wizard  There might be a law against it by that time.
[EMAIL PROTECTED]-- `/usr/bin/fortune`



[PATCH] Bugzilla #1002 (against CVS, this time)

2001-03-29 Thread Matthew L Daniel

> * Deploy the struts-example application from Struts (includes Xerces
>   in WEB-INF/lib)

That was the boost I needed.  Now I got it.
Fortunately, it was the same problem as with m1, thus after you showed me
the systematic way to reproduce it, no problem.

Please see the comments in StandardClassLoader, and feel free to mail me
with questions that are not covered therein.

  HTH,
  -- /v\atthew
-- 
Matthew L DanielNever put off until tomorrow what you can do today.
Wizard  There might be a law against it by that time.
[EMAIL PROTECTED]-- `/usr/bin/fortune`


diff -u -r1.12 StandardClassLoader.java
--- catalina/src/share/org/apache/catalina/loader/StandardClassLoader.java  
2001/03/06 01:43:46 1.12
+++ catalina/src/share/org/apache/catalina/loader/StandardClassLoader.java  
+2001/03/30 05:27:03
@@ -110,6 +110,7 @@
  *
  * @author Craig R. McClanahan
  * @author Remy Maucherat
+ * @author Matthew L Daniel ([EMAIL PROTECTED])
  * @version $Revision: 1.12 $ $Date: 2001/03/06 01:43:46 $
  */
 
@@ -1018,6 +1019,24 @@
 resolveClass(clazz);
 return (clazz);
 }
+} catch (SecurityException se) {
+/*
+ * Q.V. Bugzilla #1002
+ *   Because of the nested nature of the classloaders, the SecurityException
+ * will be thrown if any class defined in a "Sealed" jar (for example, jaxp.jar
+ * or crimson.jar) is found in the user's WEB-INF.  This exception signals that
+ * the parent already has the class in question, and it is Sealed, so loading
+ * the user's version of that class is bad.  
+ *   The SecurityException will not be thrown if this is the first occurance of
+ * the offending class.  If the SecurityException is thrown, then we are
+ * assured (by the definition of the SecurityException) that the parent already
+ * has the "magic" version of the class in question.  Ergo, the proper course
+ * of action is to delegate the request "upstream" to our parent classloader.
+ */
+ if (debug >= 3) log(
+ "  Eating SecurityException \""+se.getMessage()+"\".\n"
++" Please see StandardClassLoader.loadClass comments.");
+   // fall through to parent class loader
 } catch (ClassNotFoundException e) {
 ;
 }



[PATCH] JikesJavaCompiler vendor classpath bug

2001-03-29 Thread Matthew L Daniel

Some kind soul had already hacked in a Microsoft workaround, but the Linux
port of the Sun VM does the same thing.  Ergo, I broadened the hack a little.
:-)

  -- /v\atthew
-- 
Matthew L DanielNever put off until tomorrow what you can do today.
Wizard  There might be a law against it by that time.
[EMAIL PROTECTED]-- `/usr/bin/fortune`


diff -u -r1.4 JikesJavaCompiler.java
--- jasper/src/share/org/apache/jasper/compiler/JikesJavaCompiler.java  2001/02/08 
13:37:54 1.4
+++ jasper/src/share/org/apache/jasper/compiler/JikesJavaCompiler.java  2001/03/30 
+05:34:53
@@ -72,6 +72,7 @@
   *
   * @author Jeffrey Chiu
   * @author Hans Bergsten <[EMAIL PROTECTED]>
+  * @author Matthew L Daniel ([EMAIL PROTECTED])
   */
 public class JikesJavaCompiler implements JavaCompiler {
 
@@ -83,8 +84,10 @@
  * Microsoft does not report it's internal classpath in 
  * System.getProperty(java.class.path) which results in jikes to fail.  
  * (Internal classpath with other JVMs contains for instance rt.jar).
+ * The Sun Linux VMs also exhibit this "feature," thus, this is a vendor
+ * specific classpath.
  */
- static StringBuffer MicrosoftClasspath = null;
+ static StringBuffer vendorClasspath = null;
 
 String encoding;
 String classpath;
@@ -138,8 +141,8 @@
 
 // Used to dynamically load classpath if using Microsoft 
 // virtual machine
-if (MicrosoftClasspath==null) {
-MicrosoftClasspath = new StringBuffer(200);
+if (vendorClasspath==null) {
+vendorClasspath = new StringBuffer(200);
 if (System.getProperty("java.vendor").startsWith("Microsoft")) {
 quote = "\"";
 //Get Microsoft classpath
@@ -148,9 +151,17 @@
 File libDir=new File(javaHome);
 String[] zips=libDir.list();
 for(int i=0;i


[PATCH] Jikes 1.13 doesn't compile RequestUtil

2001-03-29 Thread Matthew L Daniel

Jikes 1.13 has become REALLY picky about type casting, and the switch of a
byte against char constants really irks Jikes.  Oh that all bugs were this
easy. :-)

  -- /v\atthew
-- 
Matthew L DanielNever put off until tomorrow what you can do today.
Wizard  There might be a law against it by that time.
[EMAIL PROTECTED]-- `/usr/bin/fortune`


diff -u -r1.13 RequestUtil.java
--- catalina/src/share/org/apache/catalina/util/RequestUtil.java2001/01/30 
19:40:19 1.13
+++ catalina/src/share/org/apache/catalina/util/RequestUtil.java2001/03/30 
+05:27:04
@@ -78,6 +78,7 @@
  *
  * @author Craig R. McClanahan
  * @author Tim Tye
+ * @author Matthew L Daniel ([EMAIL PROTECTED])
  * @version $Revision: 1.13 $ $Date: 2001/01/30 19:40:19 $
  */
 
@@ -377,7 +378,7 @@
  * IMPLEMENTATION NOTE:  URL decoding is performed
  * individually on the parsed name and value elements, rather than on
  * the entire query string ahead of time, to properly deal with the case
- * where the name or value includes an encoded "=" or "&" character
+ * where the name or value includes an encoded "=" or "&" character
  * that would otherwise be interpreted as a delimiter.
  *
  * NOTE: byte array data is modified by this method.  Caller beware.
@@ -399,7 +400,9 @@
 String value = null;
 while (ix < data.length) {
 byte c = data[ix++];
-switch (c) {
+// This cast is because Jikes 1.13 is getting REALLY picky
+// about types.
+switch ((char)c) {
 case '&':
 value = new String(data, 0, ox, encoding);
 if (key != null) {



[PATCH] build.xml instead of build.sh

2001-03-29 Thread Matthew L Daniel

I (personally) hate setting all those crazy environmental variables to build
Catalina, and since Ant is kind enough to ignore the "property file" tag if
the file does not exist, I feel this can be safely included for general use.

  -- /v\atthew
-- 
Matthew L DanielNever put off until tomorrow what you can do today.
Wizard  There might be a law against it by that time.
[EMAIL PROTECTED]-- `/usr/bin/fortune`


diff -u -r1.21 build.xml
--- build.xml   2001/03/23 01:12:10 1.21
+++ build.xml   2001/03/30 05:27:01
@@ -2,6 +2,9 @@
 
   
 
+  
+  
+
   
   
   



Re: Now, am I stupid or what?

2000-11-28 Thread Matthew L Daniel

I asked Pier off-list about why autoconf/automake was not good.  It was 
requested that the response go back to the list so that all can benefit.

As for me, I would love to hear more opinions on the subject, on or off-list,
since I am trying to learn the best-practices of large scale development like
the ASF projects.

  Thank you,
  -- /v\atthew

--- Begin Forwarded Message ---

Matthew L Daniel wrote:
> 
> On Mon, Nov 27, 2000 at 04:41:58PM -0800, Pier P. Fumagalli wrote:
> 
> > > On the former topic, we probably need someone who is autoconf-savvy to make
> > > our build procedures for native code reasonably platform independent.  Any
> > > volunteers?
> >
> > NOO. Please, let's try to avoid the use of
> > Autoconf/Automake... I HATE those tools, and we don't need them for the 2 or
> > 3 extra unportable calls we have...
> 
> If you don't mind my asking, why do you feel this way?  I am not trying
> to pick a fight, I am just not really familiar with these tools in depth.  I
> did want to learn them because they seemed like a good utility.  I just wanted
> to be corrected off-list before I got in trouble for my advocacy later. :-)

They're dirty unix hacks, that's why! :) And because if you use
autoconf/automake under unix, you will loose the ability to have
parallel builds on another operating system wich doesn't support those
(ala Windows or MacOS/X)...

And also there's a slight problem with licensing... AutoConf and
AutoMake are GPL... I am not 100% convinced that we can include them as
a part of our distribution...

Pier

 --
Pier Fumagalli <[EMAIL PROTECTED]> <http://www.betaversion.org/~pier>
--- End Forwarded Message ---
-- 
Matthew L Daniel   Rich bachelors should be heavily taxed.
Internet Director  It is not fair that some men should be
SterlingPlanet, Inc.   happier than others.
[EMAIL PROTECTED]-- Oscar Wilde



Catalina-4M5 question: parameters?

2000-11-29 Thread Matthew L Daniel

If this is not the proper forum to be discussing Catalina related difficulties,
please advise me and I will take this elsewhere.  As some other kind soul
reported, BugRat is exactly that.  Even the usage page is broken.

I am using the CVS build of Catalina 4.0M5.  It was updated 15 minutes ago,
with no changes.  I am using IBM's 1.3 JDK on Linux 2.2.17 i686.

The parameter handling is HORRIBLY broken.  Asking for any valid name results
in a null value, and asking:

Enumeration params = request.getParameterNames();
while( params.hasMoreElements() ) {
String name = params.nextElement().toString();
log("Param("+name+") := "+request.getParameter(name));
}

results in

Param(/velocity/myservlet?) := 

for any number of parameters passed, regardless of their values.  
Same thing for JSP:

/velocity/test1.jsp?

I wanted to ask if this was a known problem before I tear into the meat of
Catalina (having only Tomcat 3.2b8 development experience prior).

  Thanks,
  -- /v\atthew
-- 
Matthew L Daniel Rich bachelors should be heavily taxed.
Internet DirectorIt is not fair that some men should be
SterlingPlanet, Inc. happier than others.
[EMAIL PROTECTED]-- Oscar Wilde



Re: Catalina-4M5 question: parameters?

2000-11-30 Thread Matthew L Daniel

> To my knowledge, this is not a known issue.  In fact, I've got tons of stuff
> that
> depends on request parameters working just fine in 4.0.  I would be very
> interested
> in a simple test case that can reproduce what you're seeing.

I have included a jar (the java needs to be recompiled, so not a .war) of
the stuff I am using, and I tossed in my Catalina server.xml for good measure.

For completeness, I also tested the examples.war that comes with Catalina,
and the snoop.jsp doesn't work there either.  Same output:

Query string: /examples/jsp/snp/snoop.jsp? 

And numguess.jsp doesn't work either, indicating that it's not just the
GETs.  Does that mean I should take this to tomcat-user, since it is obviously
something wrong with my system more so than Catalina?

I tried it with Mozilla 2000112108 and Lynx, both which work fine with
Tomcat and other websites.

My curiousity is could the wrong servletapi.jar cause something like this
to happen?  I was using the old stuff for 3.2b8, and I _got_ servletapi-4.0
from CVS, but I ass-u-med that Catalina would copy it somewhere important.

  Thanks again,
  -- /v\atthew
-- 
Matthew L Daniel   Rich bachelors should be heavily taxed.
Internet Director  It is not fair that some men should be
SterlingPlanet, Inc.   happier than others.
[EMAIL PROTECTED]-- Oscar Wilde



JDBCStore implementation

2002-06-24 Thread Daniel . Rodrigues-Ambrosio

Hello everyone,

I am writing about an issue on invalidation of sessions.
In the current implementation, a session is deleted from the Database when 
it is invalidated. Is this really the behavior expected?

I mean, if there is an attribute to specify if a session is valid or not, 
a session that is invalidated should have this attribute reset instead of 
being deleted, isn't it? If this is not true, it is not possible to see 
difference between a session that is not valid anymore and a new one.

Can anyone tell me something about the plans for the implementation of 
this feature?

Cheers,
Daniel



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




JDBCStore implementation

2002-06-24 Thread Daniel . Rodrigues-Ambrosio

Hello everyone,

I am writing about an issue on invalidation of sessions.
In the current implementation, a session is deleted from the Database when 
it is invalidated. Is this really the behavior expected?

I mean, if there is an attribute to specify if a session is valid or not, 
a session that is invalidated should have this attribute reset instead of 
being deleted, isn't it? If this is not true, it is not possible to see 
difference between a session that is not valid anymore and a new one.

Can anyone tell me something about the plans for the implementation of 
this feature?

Cheers,
Daniel







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




JDBCStore implementation

2002-06-24 Thread Daniel . Rodrigues-Ambrosio

Hello everyone,

I am writing about an issue on invalidation of sessions.
In the current implementation, a session is deleted from the Database when 
it is invalidated. Is this really the behavior expected?

I mean, if there is an attribute to specify if a session is valid or not, 
a session that is invalidated should have this attribute reset instead of 
being deleted, isn't it? If this is not true, it is not possible to see 
difference between a session that is not valid anymore and a new one.

Can anyone tell me something about the plans for the implementation of 
this feature?

Cheers,
Daniel








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




Re: JDBCStore implementation

2002-06-25 Thread Daniel . Rodrigues-Ambrosio

Hi Bob,

Thanks for your answer!

Well, I agree that the refered field in the database would fit perfectly 
in the case of having more than one instance of Tomcat handling requests, 
but why can't it be used for the "local" session handling as well?

About what you wrote: "Once a session is marked invalid, my understanding 
is that it only exists for the remaining scope of the page that marked it 
invalid.". In my case I am ont invalidating the session in any page, the 
session is timed out by tomcat. And I had a simple test page in an 
environment with a timeout for the session set to a low value (3 minutes). 
If I follow what tomcat is doing, these are the steps:

1 - The session is backed up to the database (I set the value maxIdleBackup="10") 
after nearly 10 seconds of inactivity.
2 - In my jsp page I check the methods session.isNew() = false, 
request.isRequestedSessionIdValid() = true. This would be the expected 
behavior.
3 - After the session is timed out by tomcat (I simply take no action 
during 3 minutes), it is removed from the database.
4 - I try again to acess the same JSP page and the methods return session.isNew() = 
true and request.isRequestedSessionIdValid() = false. 
This would also be ok except for the fact that I have a NEW value for the 
sessionID.

With this behavior it is impossible to find out if I have a new session or 
an expired one. Maybe I am missing something here, but my idea was to 
redirect the user to a page telling him something like: "hi my friend, 
please login again because your session has expired". With the current 
implementation I am finding no solution to this.


Cheers,
Daniel





[EMAIL PROTECTED]
24.06.2002 18:17
Please respond to "Tomcat Developers List"

 
To: [EMAIL PROTECTED]
cc: 
Subject:Re: JDBCStore implementation






> Hello everyone,
> 
> I am writing about an issue on invalidation of sessions.
> In the current implementation, a session is deleted from the Database 
when 
> it is invalidated. Is this really the behavior expected?

I have been looking over the code some, and I think that behavior is
correct.  I think the DB schema was written with the thinking that
that field may some day be useful when more than one instance of
Tomcat is handling requests. 

> I mean, if there is an attribute to specify if a session is valid or 
not, 
> a session that is invalidated should have this attribute reset instead 
of 
> being deleted, isn't it? If this is not true, it is not possible to see 
> difference between a session that is not valid anymore and a new one.

Once a session is marked invalid, my understanding is that it only
exists for the remaining scope of the page that marked it invalid.

I think if you have a page with 2 frames in it, and one of the 
frames marks the session as invalid, the other frame might get;

  * a valid session until it is marked invalid by the other page
 or
  * a new session

depending on the race condition of the browser and webserver loading
both frames.

Cheers,
-bob


> Can anyone tell me something about the plans for the implementation of 
> this feature?
> 
> Cheers,
> Daniel
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 

Cheers,
-bob

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





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




Re: JDBCStore implementation

2002-06-25 Thread Daniel . Rodrigues-Ambrosio

"Craig R. McClanahan" <[EMAIL PROTECTED]>
25.06.2002 18:08
Please respond to "Tomcat Developers List"

 
To: Tomcat Developers List <[EMAIL PROTECTED]>
cc: 
Subject:Re: JDBCStore implementation



Hello Craig,

On Mon, 24 Jun 2002 [EMAIL PROTECTED] wrote:

> Date: Mon, 24 Jun 2002 16:34:12 +0200
> From: [EMAIL PROTECTED]
> Reply-To: Tomcat Developers List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: JDBCStore implementation
>
> Hello everyone,
>
> I am writing about an issue on invalidation of sessions.
> In the current implementation, a session is deleted from the Database 
when
> it is invalidated. Is this really the behavior expected?
>
>
> What purpose would be served by leaving the expired session in the
> database?  There is no API that would let a servlet retrieve that data
> again, so wouldn't it just clog up the disk?


Ok, this is true, but what other way do I have to find out if the session 
for this request was expired or not? (please check my reply to bob's mail)



> I mean, if there is an attribute to specify if a session is valid or 
not,
> a session that is invalidated should have this attribute reset instead 
of
> being deleted, isn't it? If this is not true, it is not possible to see
> difference between a session that is not valid anymore and a new one.
>
>
> Identifying a new session versus an old (but still active one) is a
> different question.  The in-memory session manager knows this by noting 
a
> difference between the created time and the last accessed time (which is
> updated via a call to access()).  It looks like JDBCStore isn't saving 
the
> created time, or the value of the isNew flag, so there's no way to know
> when the session is reloaded -- that sounds like a reasonable 
enhancement.

Well the JDBStore has no way to know this, unless he is saving these 
values in BLOB field (I did not check this in the code), because the 
attributes in the "sessions" table are not related to creation time; it is 
possible to access only the lastacess time.



> Can anyone tell me something about the plans for the implementation of
> this feature?
>
>
> Best way to ensure that this gets done eventually is to submit an
> enhancement request to the bug tracking system:
> 
>   http://nagoya.apache.org/bugzilla/


Thanks for the hint! I'll wait for some replies to be sure that I 
really cannot do what I intend to, and if this is true, I'll submit the 
request later.


Cheers,
Daniel


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





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




AW: [OT] Dead laptop

2003-06-30 Thread Daniel S. Haischt
get an apple power book with a 17" display ;-)

bye

daniel s. haischt
--

> -Ursprungliche Nachricht-
> Von: Remy Maucherat [mailto:[EMAIL PROTECTED]
> Gesendet: Sonntag, 29. Juni 2003 23:55
> An: Tomcat Developers List
> Betreff: [OT] Dead laptop
> 
> 
> Snif, snif, my Sony Vaio GRX laptop is dead :-(
> 
> I was using it for all my TC development, as well as my email. That 
> means I'll waste some time reconfiguring stuff on my desktop (which I 
> was using as a test machine) before I'm up and running again on TC 
> development.
> 
> As a replacement, I'm considering getting a Dell Centrino-based laptop 
> (with the 14.1" hi res screen). Any opinion on these ? How's the battery 
> life ?
> 
> Remy
> 
> 
> 
> -
> 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]



AW: [OT] Dead laptop

2003-06-30 Thread Daniel S. Haischt
IDEA and Together are available as OS X versions too.

> -Ursprungliche Nachricht-
> Von: kev [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 30. Juni 2003 19:34
> An: Tomcat Developers List
> Betreff: Re: [OT] Dead laptop
> 
> 
> For laptoppy goodness you can't beat a Powerbook G4[1], java 1.4.1 on 
> these guys rocks, and Eclipse is available now.  Project builder isn't 
> so great, but the form factor, battery life, unix/gnu tools built-in 
> and OS makes it the best laptop (IMHO) that you can buy.
> 
> On the other hand they're a bit more expensive than a PC, but you get 
> what you pay for.
> 
> Kev
> 
> 
> [1] www.apple.com/powerbook/index15.html
> --
> "To be governed is to be watched over, inspected, spied on, directed, 
> legislated..." - Pierre-Joseph Proudhon
> 
> 
> -
> 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]



Newbie: minor submission - 4.1.27 admin webapp

2003-09-19 Thread SANTOS, DANIEL (SBCSI)
Hi guys, I'm new here, sorry I haven't gone through all the guidelines and
such, just flame me if I'm out of place...

I'm working on tracking down an annoying bug that is causing an
administrative page to error out when attempting to view the database
properties of a data source in a specific context (haven't even checked the
bug database yet, yeesh). Anyway, I wanted to submit some changes to
org.apache.webapp.admin.AttributeTag. The only change was to include
relevant exceptions within the thrown JspExceptions as the root cause. I
actually did this originally to help me track down the bug I'm trying to fix
but I felt that the changes were appropriate to submit.

 <> 

Daniel

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

RE: Newbie: minor submission - 4.1.27 admin webapp

2003-09-19 Thread SANTOS, DANIEL (SBCSI)
I finally figured out how to build tomcat (which was a lot of fun :) so I
could test my change and it worked great. I did not find a bug in the tomcat
admin however, only my config files. A fat-fingered entry cause an exception
in the admin tool, the problem was that I couldn't see the root exception so
troubleshooting was very difficult and the exception that was displayed was
not related at all to the problem. Once I rebuilt webapps/admin with the
below file I saw the root exception which immediately explained my config
problem and told me exactly where to go in my config files, so I highly
recommend my fix below.

Daniel

>  -Original Message-
> From:     SANTOS, DANIEL (SBCSI)  
> Sent: Friday, September 19, 2003 9:38 PM
> To:   '[EMAIL PROTECTED]'
> Subject:  Newbie: minor submission - 4.1.27 admin webapp
> 
> Hi guys, I'm new here, sorry I haven't gone through all the guidelines and
> such, just flame me if I'm out of place...
> 
> I'm working on tracking down an annoying bug that is causing an
> administrative page to error out when attempting to view the database
> properties of a data source in a specific context (haven't even checked
> the bug database yet, yeesh). Anyway, I wanted to submit some changes to
> org.apache.webapp.admin.AttributeTag. The only change was to include
> relevant exceptions within the thrown JspExceptions as the root cause. I
> actually did this originally to help me track down the bug I'm trying to
> fix but I felt that the changes were appropriate to submit.
> 
>  <> 
> 
> Daniel

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