Re: cvs commit: jakarta-tomcat-connectors/webapp/javaConstants.java.in
[EMAIL PROTECTED] at [EMAIL PROTECTED] wrote: jfclere 01/07/19 07:17:18 Modified:webapp/java Constants.java.in Log: Add missing Constants. Revision ChangesPath 1.2 +8 -0 jakarta-tomcat-connectors/webapp/java/Constants.java.in Index: Constants.java.in === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/Constants.java.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Constants.java.in2001/07/15 08:42:361.1 +++ Constants.java.in2001/07/19 14:17:181.2 @@ -149,4 +149,12 @@ * No payload:br */ public static final int TYPE_CONF_DONE=0x06; + +/* + * Added by JFC (please check) + */ +public static final int TYPE_DISCONNECT=0x07; +public static final int TYPE_CONF_DEPLOY=0x08; +public static final int TYPE_CONF_APPLIC=0x09; +public static final int TYPE_CONF_PROCEED=0x10; } Those are wrong.. :) Me dumb for not updating the Constants.java.in file, but only my local copy :) Pier
[3.2] JSP Compiling Classpath issues -- finding WEB-INF/classes
Greetings! Over on tomcat-users, theres been a discussion on JSP's finding the WEB-INF/classes directory when compiling. They can't. From searches, I understand this issue has come up before in regards to the Coocon project. The root problem is that Jasper cannot find classes located in WEB-INF/classes of the web application that the JSP's belong to. This occurs when a JSP is either first deployed or the TOMCAT_HOME/work directory is cleared, requiring a recompile of the JSP's. The system is Tomcat 3.2 under Apache with mod_jk, running on SunOS 2.7 with JDK 1.2. The code in question is coming from a production Tomcat 3.1 system. I cannot add the WEB-INF/classes directory to my classpath. This will break several other parts of the system. What is the problem with Jasper reading WEB-INF/classes? I understand the the Coocon users found some kind of workaround, but I have been unable to find it. Thank you for any pointers or tips! Will -- /~'find `funny quote`': Command not found; humor not installed. 1986 Concours 72,xxx 1982 Maxim 12,xxx (For Sale!) CDA #00046 Overland Park, KS [EMAIL PROTECTED] PCS: 316-371-FOAD http://will.mylanders.com/
AdaptiveClassLoader, getResources, jndi.properties (Tomcat bug?)
Hi, I got no response to this message on the tomcat-user list, so I am trying here. I could find nothing in the archives except the message I refer to below -- I apologize if this issue has been addressed and I just couldn't find the info... I am having problems with jndi.properties being read from my WEB-INF/classes directory. I have seen this problem referenced once on the tomcat-dev mailing list -- someone submitted a patch, but apparently it did not get committed. (I couldn't find a reason why, so I am not sure if that was the real solution to the problem or not). The original message is here: http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg06588.html I have verified that the same behaivor he refers to is going on with my application -- InitialContext is using getResources(), which doesn't return anything becuase AdaptiveClassLoader doesn't implement findResource or findResources. Has anyone else having this problem found a solution/work-around? Is there a Tomcat guru/developer out there who can explain why AdaptiveClassLoader doesn't implement findResources()? Thanks, David
RE: cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp_config.c
Pier, I'm curious and appear to be too thick to understand exactly what the WebAppDeploy step does with the webAppConnector, could you find some time in your extremely busy schedule to jot down a few notes w.r.t. the what the WebAppDeploy/configure step does exactly. I'm curious to know what information is passed between tomcat and apache in that stage. -Thom -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 18, 2001 9:25 PM To: [EMAIL PROTECTED] Subject: cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp_config.c pier01/07/18 21:25:24 Modified:webapp/lib pr_warp_config.c Log: Now web-applications are correctly deployed from the configuration data contained in the web-server config file. Revision ChangesPath 1.3 +38 -1 jakarta-tomcat-connectors/webapp/lib/pr_warp_config.c Index: pr_warp_config.c === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/pr_warp_config.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- pr_warp_config.c 2001/07/18 19:12:38 1.2 +++ pr_warp_config.c 2001/07/19 04:25:24 1.3 @@ -54,7 +54,7 @@ * * * = */ -/* @version $Id: pr_warp_config.c,v 1.2 2001/07/18 19:12:38 pier Exp $ */ +/* @version $Id: pr_warp_config.c,v 1.3 2001/07/19 04:25:24 pier Exp $ */ #include pr_warp.h wa_boolean n_check(wa_connection *conn, warp_packet *pack) { @@ -105,6 +105,7 @@ apr_pool_t *pool=NULL; wa_boolean ret=wa_false; warp_packet *pack=NULL; +char *temp=NULL; if (apr_pool_create(pool,wa_pool)!=APR_SUCCESS) { wa_log(WA_MARK,Cannot create WARP temporary configuration pool); @@ -133,7 +134,43 @@ p_write_string(pack,appl-rpth); n_send(conf-sock,pack); +if (n_recv(conf-sock,pack)!=wa_true) { +wa_log(WA_MARK,Cannot read packet (%s:%d),WA_MARK); +return(wa_false); +} +if (pack-type==TYPE_ERROR) { +wa_log(WA_MARK,Cannot deploy application %s,appl-name); +continue; +} +if (pack-type!=TYPE_CONF_APPLIC) { +wa_log(WA_MARK,Unknown packet received (%d),pack-type); +p_reset(pack); +pack-type=TYPE_FATAL; +p_write_string(pack,Invalid packet received); +n_send(conf-sock,pack); +} +p_read_int(pack,(int *)appl-conf); +p_read_string(pack,temp); +wa_debug(WA_MARK,TEMP=\%s\,temp); +appl-lpth=apr_pstrdup(wa_pool,temp); +appl-depl=wa_true; +wa_debug(WA_MARK,Application \%s\ deployed with root=%s id=%d, +appl-name,appl-lpth,appl-conf); + elem=elem-next; +} + +p_reset(pack); +pack-type=TYPE_CONF_DONE; +n_send(conf-sock,pack); + +if (n_recv(conf-sock,pack)!=wa_true) { +wa_log(WA_MARK,Cannot read packet (%s:%d),WA_MARK); +return(wa_false); +} +if (pack-type!=TYPE_CONF_PROCEED) { +wa_log(WA_MARK,Cannot proceed on this connection); +return(wa_false); } apr_pool_destroy(pool);
Re: cvs commit: jakarta-tomcat-connectors/webapp/javaConstants.java.in
Pier P. Fumagalli wrote: [EMAIL PROTECTED] at [EMAIL PROTECTED] wrote: jfclere 01/07/19 07:17:18 Modified:webapp/java Constants.java.in Log: Add missing Constants. Revision ChangesPath 1.2 +8 -0 jakarta-tomcat-connectors/webapp/java/Constants.java.in Index: Constants.java.in === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/Constants.java.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Constants.java.in2001/07/15 08:42:361.1 +++ Constants.java.in2001/07/19 14:17:181.2 @@ -149,4 +149,12 @@ * No payload:br */ public static final int TYPE_CONF_DONE=0x06; + +/* + * Added by JFC (please check) + */ +public static final int TYPE_DISCONNECT=0x07; +public static final int TYPE_CONF_DEPLOY=0x08; +public static final int TYPE_CONF_APPLIC=0x09; +public static final int TYPE_CONF_PROCEED=0x10; } Those are wrong.. :) Me dumb for not updating the Constants.java.in file, but only my local copy :) Well I have noted that these were wrong in lib/pr_warp.h we have: #define TYPE_DISCONNECT 0xfe #define TYPE_CONF_DEPLOY 0x02 #define TYPE_CONF_APPLIC 0x03 #define TYPE_CONF_DONE0x04 #define TYPE_CONF_PROCEED 0x05 I think the WARP Protocol file needs an update... Pier
Re: cvs commit: jakarta-tomcat-connectors/webapp/libpr_warp_config.c
Thom Park at [EMAIL PROTECTED] wrote: Pier, I'm curious and appear to be too thick to understand exactly what the WebAppDeploy step does with the webAppConnector, could you find some time in your extremely busy schedule to jot down a few notes w.r.t. the what the WebAppDeploy/configure step does exactly. I'm curious to know what information is passed between tomcat and apache in that stage. Oh, simple... In the web-server configuration file you have something like: WebAppConnection myConnection warp localhost:8008 WebAppDeploy example.jar myConnection /servlet-examples/ Basically you configure a warp connection between Apache and Tomcat (first line), and over that connection you deploy a web application: Specifically what goes on, is that Apache tells to Tomcat that there should be a web application in its directories, in a file called example.jar, and that should be deployed under the /servlet-examples/ URL path (it's Context path). Tomcat finds the example.jar file, unpacks it, deploys it into the appropriate host (which is derived from Apache's VirtualHost directive), and is ready to process requests... So you don't have to configure the same thing twice :) Actually, my server.xml file for Tomcat is something like: Server Service Connector className=WarpConnector port=8008 / Engine / /Service /Server SIX LINES :) Pier
Re: cvs commit:jakarta-tomcat-connectors/webapp/javaConstants.java.in
jean-frederic clere at [EMAIL PROTECTED] wrote: Pier P. Fumagalli wrote: [EMAIL PROTECTED] at [EMAIL PROTECTED] wrote: jfclere 01/07/19 07:17:18 Modified:webapp/java Constants.java.in Log: Add missing Constants. Revision ChangesPath 1.2 +8 -0 jakarta-tomcat-connectors/webapp/java/Constants.java.in Index: Constants.java.in === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/Constants.java.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Constants.java.in2001/07/15 08:42:361.1 +++ Constants.java.in2001/07/19 14:17:181.2 @@ -149,4 +149,12 @@ * No payload:br */ public static final int TYPE_CONF_DONE=0x06; + +/* + * Added by JFC (please check) + */ +public static final int TYPE_DISCONNECT=0x07; +public static final int TYPE_CONF_DEPLOY=0x08; +public static final int TYPE_CONF_APPLIC=0x09; +public static final int TYPE_CONF_PROCEED=0x10; } Those are wrong.. :) Me dumb for not updating the Constants.java.in file, but only my local copy :) Well I have noted that these were wrong in lib/pr_warp.h we have: #define TYPE_DISCONNECT 0xfe #define TYPE_CONF_DEPLOY 0x02 #define TYPE_CONF_APPLIC 0x03 #define TYPE_CONF_DONE0x04 #define TYPE_CONF_PROCEED 0x05 I think the WARP Protocol file needs an update... Oh _SO_BADLY_... The packet structure changed, packet types changed, multiplexing was dropped (you can't beat the Kernel) You won't believe :) After the code is stable :) Pier
Clearing, or even setting cookies that already exist
Hmm, I'm honestly not positive whether this is a problem with Tomcat, or something more basic than that... I've got this servlet, let's say I'm just testing cookie-setting and -clearing capabilities. When the servlet is invoked from a form, I set two cookies, with -1 MaxAge. Later, if I call it alone, not from a form, it's set to clear the cookies. That is, set their MaxAge to 0. When clearing a cookie, do I create a new cookie object of the name I want to clear, set its max age to 0, and add it to the response? I tried this, but it wouldn't clear the cookie. In fact, it doesn't look like it adds a new cookie at all. I'm doing all my cookie-adding before I call the getWriter method of my response, or setting any other headers. Furthermore, even though I setDomain on the cookies before I add them initially, I get null when I getDomain on the cookies later. I'm not sure if this is a problem with Tomcat or not, and I hope I'm not on the wrong list to post this, but it may be a bug in Tomcat? Thanks in advance, -KSH
John Gardner is out of the office.
I will be out of the office starting 19/07/2001 and will not return until 13/08/2001. Any general support queries should be emailed to: [EMAIL PROTECTED] Infoshop queries should be emailed to: [EMAIL PROTECTED] Technical Queries should be directed to Andy Armstrong ([EMAIL PROTECTED]) Any other queries should be directed to Sarah Carter ([EMAIL PROTECTED])
Re: [TC4.0] Disabling debug output...
On Wed, 18 Jul 2001, Justin Erenkrantz wrote: On Thu, Jul 19, 2001 at 12:16:27AM +0100, Pier P. Fumagalli wrote: Checking out the source code, I see a lot of // (commented out lines) when debug() is supposed to be called... Can't we have a global constant boolean called DEBUG and replace the // with if (DEBUG), so that we can simply compile in and out the debugging information without touching the sources? Check out org.apache.catalina.connector.warp.Constants and WarpLogger... Old trick we used in JServ. :) I *believe* most Java compilers do not have constant conditional optimizations (they certainly could, but I don't think they did last time I checked). Without that optimization, you must check that value each time you execute the statement. That might hurt. -- justin In trivial experiments a long while back, I seem to recall that this trick worked if your constant was static final. But I haven't looked lately. There are also some cases where you want to be able to set the debug level at runtime, without having to recompile. In such cases, I typically am real liberal about debug statements when first creating a module, and then comment them out (versus removing them) in high-frequency-of-use portions of the code. That way, you've got ready-made debug code to uncomment if you run into problems later. Craig
Re: [TC4.0] Disabling debug output...
Craig R. McClanahan at [EMAIL PROTECTED] wrote: In trivial experiments a long while back, I seem to recall that this trick worked if your constant was static final. But I haven't looked lately. Yep... Setting a public static final boolean DEBUG = true/false; will behave like an ifdef in C for something like: If(DEBUG) logger.debug(...); If DEBUG is set to true, logger.debug() will be compiled in, otherwise it'll be left out. There are also some cases where you want to be able to set the debug level at runtime, without having to recompile. In such cases, I typically am real liberal about debug statements when first creating a module, and then comment them out (versus removing them) in high-frequency-of-use portions of the code. That way, you've got ready-made debug code to uncomment if you run into problems later. I'm not arguing about le debug level, but, instead of commenting out pieces of code (and then, when you want to do a debug build, you have to remove all comments) it would be nicer to set a public static final boolean, and instead of using comments, using the if boolean. Aesthetics, but I had to do that while checking the WARP connector to behave like HTTP, and the source was full of comments. Using the static final boolean I would have had to change just one line :) As I said, it's just aesthetics... Pier
Re: John Gardner is out of the office.
John Gardner at [EMAIL PROTECTED] wrote: I will be out of the office starting 19/07/2001 and will not return until 13/08/2001. Any general support queries should be emailed to: [EMAIL PROTECTED] Infoshop queries should be emailed to: [EMAIL PROTECTED] Technical Queries should be directed to Andy Armstrong ([EMAIL PROTECTED]) Any other queries should be directed to Sarah Carter ([EMAIL PROTECTED]) John Gardner has been kicked out of the mailing list. Pier
Re: [TC4.0] Disabling debug output...
I believe the Java Language Spec makes specific requirements on the order of evaluation of static finals to facilitate this kind of usage. In the past I have gone so far as to compile test programs and disassemble the byte code and on every JVM I have ever tried, code wrapped in if statements that evaluate a static final boolean doesn't even generate byte code for the contents of the block if the boolean is false. So there is no performance or size penalty. The real problem with this sort of thing is more subtle. How do you control the value of the boolean? Should there be a single public static final in a class that is referred to everywhere? More likely one wants to turn on and off debugging in a single class, or package, or globally, depending on what is being tested. Having to do search and replace on scattered variables is annoying at best. How is the make system coerced into doing debug builds vs production builds in a simple manner, in the absence of a preprocessor? These are specifically the sort of problems the new java.util.logging package in JDK 1.4 is addressing. I believe the philosophy there is to always leave the code in place, be liberal in writing tracing log calls and assume that integer comparisons to decide whether to execute a particular logging call are so cheap that there is essentially no performance penalty at runtime. I am not as familiar with log4j. Cheers - Mark At 08:56 AM 7/19/2001, Craig R. McClanahan wrote: On Wed, 18 Jul 2001, Justin Erenkrantz wrote: On Thu, Jul 19, 2001 at 12:16:27AM +0100, Pier P. Fumagalli wrote: Checking out the source code, I see a lot of // (commented out lines) when debug() is supposed to be called... Can't we have a global constant boolean called DEBUG and replace the // with if (DEBUG), so that we can simply compile in and out the debugging information without touching the sources? Check out org.apache.catalina.connector.warp.Constants and WarpLogger... Old trick we used in JServ. :) I *believe* most Java compilers do not have constant conditional optimizations (they certainly could, but I don't think they did last time I checked). Without that optimization, you must check that value each time you execute the statement. That might hurt. -- justin In trivial experiments a long while back, I seem to recall that this trick worked if your constant was static final. But I haven't looked lately. There are also some cases where you want to be able to set the debug level at runtime, without having to recompile. In such cases, I typically am real liberal about debug statements when first creating a module, and then comment them out (versus removing them) in high-frequency-of-use portions of the code. That way, you've got ready-made debug code to uncomment if you run into problems later. Craig
Re: John Gardner is out of the office.
Pier P. Fumagalli wrote: John Gardner at [EMAIL PROTECTED] wrote: I will be out of the office starting 19/07/2001 and will not return until 13/08/2001. Any general support queries should be emailed to: [EMAIL PROTECTED] Infoshop queries should be emailed to: [EMAIL PROTECTED] Technical Queries should be directed to Andy Armstrong ([EMAIL PROTECTED]) Any other queries should be directed to Sarah Carter ([EMAIL PROTECTED]) John Gardner has been kicked out of the mailing list. I will be drop-kicked out of the mailing list starting 19/07/2001 and will not return until I learn that Auto-Reply + Mailing List == Bad Idea. Any general support queries should be emailed to: [EMAIL PROTECTED] ;-)
Re: cvs commit:jakarta-tomcat-connectors/webapp/javaConstants.java.in
Pier P. Fumagalli wrote: jean-frederic clere at [EMAIL PROTECTED] wrote: Pier P. Fumagalli wrote: [EMAIL PROTECTED] at [EMAIL PROTECTED] wrote: jfclere 01/07/19 07:17:18 Modified:webapp/java Constants.java.in Log: Add missing Constants. Revision ChangesPath 1.2 +8 -0 jakarta-tomcat-connectors/webapp/java/Constants.java.in Index: Constants.java.in === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/Constants.java.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Constants.java.in2001/07/15 08:42:361.1 +++ Constants.java.in2001/07/19 14:17:181.2 @@ -149,4 +149,12 @@ * No payload:br */ public static final int TYPE_CONF_DONE=0x06; + +/* + * Added by JFC (please check) + */ +public static final int TYPE_DISCONNECT=0x07; +public static final int TYPE_CONF_DEPLOY=0x08; +public static final int TYPE_CONF_APPLIC=0x09; +public static final int TYPE_CONF_PROCEED=0x10; } Those are wrong.. :) Me dumb for not updating the Constants.java.in file, but only my local copy :) Well I have noted that these were wrong in lib/pr_warp.h we have: #define TYPE_DISCONNECT 0xfe #define TYPE_CONF_DEPLOY 0x02 #define TYPE_CONF_APPLIC 0x03 #define TYPE_CONF_DONE0x04 #define TYPE_CONF_PROCEED 0x05 I think the WARP Protocol file needs an update... Oh _SO_BADLY_... The packet structure changed, packet types changed, multiplexing was dropped (you can't beat the Kernel) You won't believe :) After the code is stable :) That makes harder to help... BTW what had happended with warp_handle(), could you commit it? (It says Not yet implemented, would perfer a buggy code...). Pier
Re: cvscommit:jakarta-tomcat-connectors/webapp/javaConstants.java.in
jean-frederic clere at [EMAIL PROTECTED] wrote: Pier P. Fumagalli wrote: jean-frederic clere at [EMAIL PROTECTED] wrote: Pier P. Fumagalli wrote: [EMAIL PROTECTED] at [EMAIL PROTECTED] wrote: jfclere 01/07/19 07:17:18 Modified:webapp/java Constants.java.in Log: Add missing Constants. Revision ChangesPath 1.2 +8 -0 jakarta-tomcat-connectors/webapp/java/Constants.java.in Index: Constants.java.in === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/Constants.java.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Constants.java.in2001/07/15 08:42:361.1 +++ Constants.java.in2001/07/19 14:17:181.2 @@ -149,4 +149,12 @@ * No payload:br */ public static final int TYPE_CONF_DONE=0x06; + +/* + * Added by JFC (please check) + */ +public static final int TYPE_DISCONNECT=0x07; +public static final int TYPE_CONF_DEPLOY=0x08; +public static final int TYPE_CONF_APPLIC=0x09; +public static final int TYPE_CONF_PROCEED=0x10; } Those are wrong.. :) Me dumb for not updating the Constants.java.in file, but only my local copy :) Well I have noted that these were wrong in lib/pr_warp.h we have: #define TYPE_DISCONNECT 0xfe #define TYPE_CONF_DEPLOY 0x02 #define TYPE_CONF_APPLIC 0x03 #define TYPE_CONF_DONE0x04 #define TYPE_CONF_PROCEED 0x05 I think the WARP Protocol file needs an update... Oh _SO_BADLY_... The packet structure changed, packet types changed, multiplexing was dropped (you can't beat the Kernel) You won't believe :) After the code is stable :) That makes harder to help... BTW what had happended with warp_handle(), could you commit it? (It says Not yet implemented, would perfer a buggy code...). Coming... Fixing some bugs due to the new protocol... Pier
Re: cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp_config.c
Thom Park wrote: Wow! I'm impressed - that looks pretty good for a default case but, what if I want tweak and tune my web app to use things like custom loggers or realms or even valves or listeners? I guess in that case I need to edit the server.xml directly wouldn't you say? What happens if my WebAppDeploy command matches an already defined webapp, will it override the existing one or just notice that it's already there and ignore the webappdeploy request. What happens if they conflict, ie. WebAppDeploy says the following: WebAppDeploy example.jar myConnection /servlet-examples/ but my server.xml entry is something like Context path=/servlet-examples, docBase=example_two, debug=99 Realm className=myRealm /Realm /Context Now I have two jar/webapp folders referring to the same path name and am looking at a potentially nasty conflict. Will the Warp handler object to this? I have tried to deploy an existing application it seems it works. (As least I think it does!). -Thom p.s. Damn good job though - it looks much simpler to manage that mod_jk - mod_jk relies on the Tomcat server.xml, and mod_jk manage is improving a lot. now, how about load balancing ;-) -Original Message- From: Pier P. Fumagalli [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 19, 2001 8:20 AM To: [EMAIL PROTECTED] Subject: Re: cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp_config.c Thom Park at [EMAIL PROTECTED] wrote: Pier, I'm curious and appear to be too thick to understand exactly what the WebAppDeploy step does with the webAppConnector, could you find some time in your extremely busy schedule to jot down a few notes w.r.t. the what the WebAppDeploy/configure step does exactly. I'm curious to know what information is passed between tomcat and apache in that stage. Oh, simple... In the web-server configuration file you have something like: WebAppConnection myConnection warp localhost:8008 WebAppDeploy example.jar myConnection /servlet-examples/ Basically you configure a warp connection between Apache and Tomcat (first line), and over that connection you deploy a web application: Specifically what goes on, is that Apache tells to Tomcat that there should be a web application in its directories, in a file called example.jar, and that should be deployed under the /servlet-examples/ URL path (it's Context path). Tomcat finds the example.jar file, unpacks it, deploys it into the appropriate host (which is derived from Apache's VirtualHost directive), and is ready to process requests... So you don't have to configure the same thing twice :) Actually, my server.xml file for Tomcat is something like: Server Service Connector className=WarpConnector port=8008 / Engine / /Service /Server SIX LINES :) Pier
Cookies, and things
Problem solved. It had to do with me not setting the domain on my cookie before clearing it. Sorry for the useless post. -KSH
cvs commit: jakarta-tomcat build.xml
larryi 01/07/19 10:30:36 Modified:.build.xml Log: Update javadoc build to not require jakarta-tomcat-connectors to be present. Plus a little clean up. Revision ChangesPath 1.146 +9 -11 jakarta-tomcat/build.xml Index: build.xml === RCS file: /home/cvs/jakarta-tomcat/build.xml,v retrieving revision 1.145 retrieving revision 1.146 diff -u -r1.145 -r1.146 --- build.xml 2001/07/19 06:18:48 1.145 +++ build.xml 2001/07/19 17:30:36 1.146 @@ -45,8 +45,6 @@ !-- External packages we depend on -- !-- Tomcat depends on: - Ant ( latest 1.3 binary install in jakarta-ant, peer to jakarta-tomcat ) - - jakarta-tomcat-connectors ( latest src, peer to jakarta-tomcat ) - - jakarta-tomcat-jasper ( latest src, peer to jakarta-tomcat ) - jakarta-commons (optional, latest src, peer to jakarta-tomcat ) - Jaxp ( optional, the jar files from ant can be used instead ) - Jsse ( optional ) @@ -242,7 +240,7 @@ /target !-- Tomcat util -- - !-- Independent ( stand alone ) utilities -- + !-- Local Tomcat utilities -- target name=tomcat_util depends=init javac destdir=${tomcat.build}/classes @@ -659,7 +657,7 @@ !-- Add Tomcat internal javadoc -- mkdir dir=${tomcat.build}/webapps/ROOT/javadoc/ javadoc packagenames=org.apache.* - sourcepath=src/share;src/facade22;${jakarta-tomcat-connectors}/util/java + sourcepath=src/share;src/facade22 classpathref=javadoc.classpath destdir=${tomcat.build}/webapps/ROOT/javadoc author=true @@ -672,7 +670,7 @@ /target target name=javadoc.tomcat depends=main,webapps,tomcat-jars javadoc packagenames=org.apache.tomcat.* - sourcepath=src/share;src/facade22;${jakarta-tomcat-connectors}/util/java + sourcepath=src/share;src/facade22 classpathref=javadoc.classpath destdir=${tomcat.build}/webapps/ROOT/javadoc author=true @@ -684,7 +682,7 @@ /target target name=javadoc.tomcat.core depends=main,webapps,tomcat-jars javadoc packagenames=org.apache.tomcat.core - sourcepath=src/share;src/facade22;${jakarta-tomcat-connectors}/util/java + sourcepath=src/share;src/facade22 classpathref=javadoc.classpath destdir=${tomcat.build}/webapps/ROOT/javadoc author=true @@ -696,7 +694,7 @@ /target target name=javadoc.tomcat.facade depends=main,webapps,tomcat-jars javadoc packagenames=org.apache.tomcat.facade - sourcepath=src/share;src/facade22;${jakarta-tomcat-connectors}/util/java + sourcepath=src/share;src/facade22 classpathref=javadoc.classpath destdir=${tomcat.build}/webapps/ROOT/javadoc author=true @@ -708,7 +706,7 @@ /target target name=javadoc.tomcat.modules depends=main,webapps,tomcat-jars javadoc packagenames=org.apache.tomcat.modules.* - sourcepath=src/share;src/facade22;${jakarta-tomcat-connectors}/util/java + sourcepath=src/share;src/facade22 classpathref=javadoc.classpath destdir=${tomcat.build}/webapps/ROOT/javadoc author=true @@ -720,7 +718,7 @@ /target target name=javadoc.tomcat.startup depends=main,webapps,tomcat-jars javadoc packagenames=org.apache.tomcat.startup - sourcepath=src/share;src/facade22;${jakarta-tomcat-connectors}/util/java + sourcepath=src/share;src/facade22 classpathref=javadoc.classpath destdir=${tomcat.build}/webapps/ROOT/javadoc author=true @@ -732,7 +730,7 @@ /target target name=javadoc.tomcat.util depends=main,webapps,tomcat-jars javadoc packagenames=org.apache.tomcat.util.* - sourcepath=src/share;src/facade22;${jakarta-tomcat-connectors}/util/java + sourcepath=src/share;src/facade22 classpathref=javadoc.classpath destdir=${tomcat.build}/webapps/ROOT/javadoc author=true @@ -744,7 +742,7 @@ /target target name=javadoc.jasper depends=main,webapps,tomcat-jars javadoc packagenames=org.apache.jasper.* - sourcepath=src/share;src/facade22;${jakarta-tomcat-connectors}/util/java + sourcepath=src/share;src/facade22 classpathref=javadoc.classpath destdir=${tomcat.build}/webapps/ROOT/javadoc author=true
cvs commit: jakarta-tomcat/src/etc server.xml
larryi 01/07/19 10:36:16 Modified:src/etc server.xml Log: Remove Ajp14Interceptor since it won't be part of the distribution and could become out of date with respect to development in jakarta-tomcat-connectors. Also, some minor clean up. Revision ChangesPath 1.84 +4 -13 jakarta-tomcat/src/etc/server.xml Index: server.xml === RCS file: /home/cvs/jakarta-tomcat/src/etc/server.xml,v retrieving revision 1.83 retrieving revision 1.84 diff -u -r1.83 -r1.84 --- server.xml2001/07/19 05:58:08 1.83 +++ server.xml2001/07/19 17:36:15 1.84 @@ -194,6 +194,7 @@ port=8443 secure=true / -- + !-- JNI connector, make sure that you update the native_lib Parameter to point to your jni_connect.dll. @@ -206,10 +207,9 @@ !-- Apache AJP12 support. This is also used to shut down tomcat. Parameter address defines network interface this Interceptor - binds to. Delete it if you want to bind to all interfaces. + binds to. Add it if you want to bind to just 127.0.0.1. address=127.0.0.1 - -- RequestInterceptor className=org.apache.tomcat.modules.server.Ajp12Interceptor @@ -218,22 +218,13 @@ !-- Apache AJP13 support (mod_jk) Parameter address defines network interface this Interceptor - binds to. Delete it if you want to bind to all interfaces. + binds to. Add it if you want to bind to just 127.0.0.1. + address=127.0.0.1 -- RequestInterceptor className=org.apache.tomcat.modules.server.Ajp13Interceptor port=8009 / - -!-- Apache AJP14 support ( experimental, jakarta-tomcat-connectors) -This will eventually replace Ajp12 and Ajp13 - -- -RequestInterceptor - className=org.apache.ajp.tomcat33.Ajp14Interceptor - tomcatAuthentication=false - password=changeme - debug=10 - port=8011 / !-- Context definitions can be placed here ( not recommended ) or
cvs commit: jakarta-tomcat/src/admin/WEB-INF/classes/tadm AntProperty.java
costin 01/07/19 11:00:39 Modified:src/admin/WEB-INF/classes/tadm AntProperty.java Log: More meaningful message. Revision ChangesPath 1.3 +4 -0 jakarta-tomcat/src/admin/WEB-INF/classes/tadm/AntProperty.java Index: AntProperty.java === RCS file: /home/cvs/jakarta-tomcat/src/admin/WEB-INF/classes/tadm/AntProperty.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- AntProperty.java 2001/05/18 04:46:36 1.2 +++ AntProperty.java 2001/07/19 18:00:38 1.3 @@ -40,6 +40,10 @@ getServletContext(); ServletContext targetCtx=(webapp==null) ? thisCtx: thisCtx.getContext( webapp ); + ServletContext rootCtx= thisCtx.getContext(/); + if( webapp!=null !/.equals( webapp) + ! .equals(webapp ) rootCtx == targetCtx ) + throw new JspException( Can't find context + webapp ); value=targetCtx.getRealPath(location); }
cvs commit: jakarta-tomcat/src/facade22/org/apache/tomcat/facade ServletHandler.java
costin 01/07/19 11:03:15 Modified:src/facade22/org/apache/tomcat/facade ServletHandler.java Log: Added the method from jasper34, is the only piece that prevents complete separation of runtime/compiler. Revision ChangesPath 1.15 +5 -0 jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletHandler.java Index: ServletHandler.java === RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletHandler.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ServletHandler.java 2001/06/24 22:33:14 1.14 +++ ServletHandler.java 2001/07/19 18:03:15 1.15 @@ -643,5 +643,10 @@ return false; } +/** The handler may return a set of classes it depends on + */ +public String [] _getDepends() { + return null; +} }
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets InvokerHttpRequest.java InvokerServlet.java
craigmcc01/07/19 11:37:02 Modified:catalina/src/share/org/apache/catalina/core ApplicationDispatcher.java catalina/src/share/org/apache/catalina/servlets InvokerHttpRequest.java InvokerServlet.java Log: Correct an bad interaction between request dispatching and the invoker servlet that was introduced in recent changes. These changes were required by Servlet 2.3 PFD3 updates that disallowed the previous request dispatcher implementation technique of wrapping the outermost application request before calling the dispatched-to servlet. These changes also fix the JSP-Servlet-JSP example, which was broken by the earlier changes. PR: Bugzilla #2692 Submitted by: Remy Maucherat Revision ChangesPath 1.22 +19 -5 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java Index: ApplicationDispatcher.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- ApplicationDispatcher.java2001/07/17 04:21:12 1.21 +++ ApplicationDispatcher.java2001/07/19 18:37:02 1.22 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java,v 1.21 2001/07/17 04:21:12 craigmcc Exp $ - * $Revision: 1.21 $ - * $Date: 2001/07/17 04:21:12 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java,v 1.22 2001/07/19 18:37:02 craigmcc Exp $ + * $Revision: 1.22 $ + * $Date: 2001/07/19 18:37:02 $ * * * @@ -105,7 +105,7 @@ * codejavax.servlet.ServletResponseWrapper/code. * * @author Craig R. McClanahan - * @version $Revision: 1.21 $ $Date: 2001/07/17 04:21:12 $ + * @version $Revision: 1.22 $ $Date: 2001/07/19 18:37:02 $ */ final class ApplicationDispatcher @@ -420,6 +420,8 @@ } // Commit and close the response before we return +if (debug = 1) +log( Committing and closing response); response.flushBuffer(); try { PrintWriter writer = response.getWriter(); @@ -609,7 +611,11 @@ // Allocate a servlet instance to process this request try { if (!unavailable) { +//if (debug = 2) +//log( Allocating servlet instance); servlet = wrapper.allocate(); +//if ((debug = 2) (servlet == null)) +//log(No servlet instance returned!); } } catch (ServletException e) { log(sm.getString(applicationDispatcher.allocateException, @@ -633,6 +639,8 @@ else request.removeAttribute(Globals.JSP_FILE_ATTR); if (servlet != null) { +//if (debug = 2) +//log( Calling service(), jspFile= + jspFile); if ((hrequest != null) (hresponse != null)) { servlet.service((HttpServletRequest) request, (HttpServletResponse) response); @@ -666,8 +674,11 @@ // Deallocate the allocated servlet instance try { - if (servlet != null) + if (servlet != null) { +//if (debug = 2) +//log( Deallocating servlet instance); wrapper.deallocate(servlet); +} } catch (ServletException e) { log(sm.getString(applicationDispatcher.deallocateException, wrapper.getName()), e); @@ -832,6 +843,9 @@ ServletRequest previous = null; ServletRequest current = outerRequest; while (current != null) { +if (org.apache.catalina.servlets.InvokerHttpRequest. +equals(current.getClass().getName())) +break; // KLUDGE - Make nested RD.forward() using invoker work if (!(current instanceof ServletRequestWrapper)) break; if (current instanceof ApplicationHttpRequest) 1.2 +7 -68 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/InvokerHttpRequest.java Index: InvokerHttpRequest.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/InvokerHttpRequest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1
RE: [3.2] JSP Compiling Classpath issues -- finding WEB-INF/classes
I guess I don't follow, cuz I use this functionality of Tomcat every single day. Whether or not its under Apache shouldn't matter. - r -Original Message- From: Will England [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 19, 2001 10:49 AM To: [EMAIL PROTECTED] Subject: [3.2] JSP Compiling Classpath issues -- finding WEB-INF/classes Greetings! Over on tomcat-users, theres been a discussion on JSP's finding the WEB-INF/classes directory when compiling. They can't. From searches, I understand this issue has come up before in regards to the Coocon project. The root problem is that Jasper cannot find classes located in WEB-INF/classes of the web application that the JSP's belong to. This occurs when a JSP is either first deployed or the TOMCAT_HOME/work directory is cleared, requiring a recompile of the JSP's. The system is Tomcat 3.2 under Apache with mod_jk, running on SunOS 2.7 with JDK 1.2. The code in question is coming from a production Tomcat 3.1 system. I cannot add the WEB-INF/classes directory to my classpath. This will break several other parts of the system. What is the problem with Jasper reading WEB-INF/classes? I understand the the Coocon users found some kind of workaround, but I have been unable to find it. Thank you for any pointers or tips! Will -- /~'find `funny quote`': Command not found; humor not installed. 1986 Concours 72,xxx 1982 Maxim 12,xxx (For Sale!) CDA #00046 Overland Park, KS [EMAIL PROTECTED] PCS: 316-371-FOAD http://will.mylanders.com/
RE: AdaptiveClassLoader, getResources, jndi.properties (Tomcat bug?)
If this is what I'm remembering, your ContextFactory class can't be found. This is cuz the JNDI code is broken in that it doesn't rely on its parent classloader (in our case, the one that knows about WEB-INF/classes and lib) to load the context factory. You have to implement your own InitialContextFactoryBuilder. Check the Sun messages boards. I ran into the same problem last month. - r -Original Message- From: David Haraburda [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 19, 2001 10:51 AM To: [EMAIL PROTECTED] Subject: AdaptiveClassLoader, getResources, jndi.properties (Tomcat bug?) Hi, I got no response to this message on the tomcat-user list, so I am trying here. I could find nothing in the archives except the message I refer to below -- I apologize if this issue has been addressed and I just couldn't find the info... I am having problems with jndi.properties being read from my WEB-INF/classes directory. I have seen this problem referenced once on the tomcat-dev mailing list -- someone submitted a patch, but apparently it did not get committed. (I couldn't find a reason why, so I am not sure if that was the real solution to the problem or not). The original message is here: http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg06588.html I have verified that the same behaivor he refers to is going on with my application -- InitialContext is using getResources(), which doesn't return anything becuase AdaptiveClassLoader doesn't implement findResource or findResources. Has anyone else having this problem found a solution/work-around? Is there a Tomcat guru/developer out there who can explain why AdaptiveClassLoader doesn't implement findResources()? Thanks, David
Re: [TC4.0] Disabling debug output...
On Thu, 19 Jul 2001, Mark Abbott wrote: [snip] These are specifically the sort of problems the new java.util.logging package in JDK 1.4 is addressing. I believe the philosophy there is to always leave the code in place, be liberal in writing tracing log calls and assume that integer comparisons to decide whether to execute a particular logging call are so cheap that there is essentially no performance penalty at runtime. I am not as familiar with log4j. At least in this respect, the JSR047 API is similar in spirit to Log4J -- I'm not going to touch on the places where the philosphies differ! :-) However, there are some subtleties that are kind of important here: - The typical approach with the JSR47 API or with Log4J is to let the logger decide whether to really output the message or not. So, you would instrument your code with things like (conceptual, not real API): logger.log(The object is + myObject, Logger.DEBUG); and let the logger configuration decide whether you care about debug messages or not. - However, there is a performance problem with leaving this code in -- you will be doing the string concatenation (and the method call) whether or not you want debug messages printed! If you are liberal about debug messages, especially inside frequently executed methods, this can have adverse impacts on performance (and increased garbage collection). - Log4J (and I imagine JSR047 does too, but haven't looked) has a way to ask the logger whether debug mode is enabled or not. But it's pretty verbose, and a developer isn't going to want to think about it when in the middle of diagnosing a problem. It also requires a method call, so it's still more expensive than the integer compare mechanism described below. - As others have pointed out, you often want to enable/disable debug messages on a module-by-module level. Therefore, if I were using Pier's proposed method, I'd put the static final global in each module independently. - However, Pier's proposed approach doesn't deal with a need that I've experienced regularly -- the need to turn on debugging messages dynamically on an existing component, *without* recompiling it. This is NOT simply aesthetics; either you can or you cannot change the level of debugging output at runtime. An example of this is the following scenario: I'm developing an app in an environment that relies on webapp reloading when classes are changed (sound familiar, Jon? :-), and the ability to save and restore session attributes across the reload. I'm probably running a *binary* distribution of Tomcat, not the source. If I have a problem with my attributes being saved and restored, it is crucially important to be able to just do this: Context path=... ... Manager debug=99/ /Context in my server.xml file and restart, so I can see the verbose debugging info in the log files. Not everybody will have the ability (or the inclination) to rebuild Tomcat from source to do this. - My general approach has been to embed debugging output in an idiom like this: if (debug = 2) log(The object is + myObject); which has a small runtime cost (evaluating the conditional), but avoids the most expensive computations (string concatenation, method call, and subsequent garbage collection) in the usual case of debugging being turned off. - Ideally, the compiler would be able to optimize this code out if debug were really set to zero. However, because it's not final static (so that it can be changed at runtime), that wouldn't be legal. Therefore, I've tended to comment out the debug stuff in the most frequently executed parts of the code, to avoid even the minimal runtime overhead of the integer comparison and jump. Commenting out instead of removing is my habit, and lets me easily re-introduce the debug stuff if I'm investigating a problem later. - As you can see, there's a conflict between my primary goals (dynamically turn debugging on and off, and zero runtime overhead). The compromise I'm currently using seems to be a fair balance between the two, but I'm certainly interested in how others deal with it. On the general topic of using Log4J (or the JSR 47 API) inside Tomcat 4, there is something of an impedance mismatch between the Tomcat approach to hierarchical loggers and the logger approach to handling multiple log output streams. Ceki has posted some thoughts about how this might be done (see the TOMCAT-DEV archives). Maybe, now that we're almost done with beta 6 (to be released tonight), we can start thinking about it some more. Cheers - Mark Craig
cvs commit: jakarta-tomcat/src/doc readme
larryi 01/07/19 13:20:10 Modified:src/doc readme Log: Some updates for beta-1 Revision ChangesPath 1.16 +35 -37jakarta-tomcat/src/doc/readme Index: readme === RCS file: /home/cvs/jakarta-tomcat/src/doc/readme,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- readme2001/06/21 22:35:32 1.15 +++ readme2001/07/19 20:20:10 1.16 @@ -1,8 +1,8 @@ -$Id: readme,v 1.15 2001/06/21 22:35:32 larryi Exp $ +$Id: readme,v 1.16 2001/07/19 20:20:10 larryi Exp $ Release Notes for: - TOMCAT Version 3.3m4 + TOMCAT Version 3.3b1 @@ -43,19 +43,19 @@ file. IMPORTANT NOTE: Some important changes have been recently added to -Tomcat 3.3m4 which are not yet covered in the accompanying documentation. -These changes make Tomcat 3.3m4 quite different from Tomcat 3.2 in a number +Tomcat 3.3b1 which are not yet covered in the accompanying documentation. +These changes make Tomcat 3.3b1 quite different from Tomcat 3.2 in a number of ways. These changes include the following: - Class Loading: - Tomcat 3.3m4 now uses a new hierarchy of class loaders. It provides for the + Tomcat 3.3b1 now uses a new hierarchy of class loaders. It provides for the separation of the classes used by the Tomcat container and the classes used by web applications. This solves a major problem in Tomcat 3.2 where all web applications had to share Tomcat's XML parser. Now each web applicaton can have its own XML parser, or if desired all web applications can share an XML parser different from the one used by Tomcat. As a side effect of - this change, web applications in Tomcat 3.3m4 are not provided an XML + this change, web applications in Tomcat 3.3b1 are not provided an XML parser by default. You must supply one if your web application requires one. For details about where to place jar files, see the README files in the lib/container, lib/common, and lib/apps directories of your Tomcat @@ -65,7 +65,7 @@ The configuration of Tomcat has been reorganized into separate configuration files. The conf/modules.xml file contains module definitions for the modules - (a.k.a Interceptors) available in Tomcat 3.3m4. The conf/server.xml file + (a.k.a Interceptors) available in Tomcat 3.3b1. The conf/server.xml file specifies which modules and connectors the Tomcat container should use along with their settings. @@ -80,24 +80,38 @@ Another change related to Tomcat configuration is that auto-generated web server configuration files, such as tomcat-apache.conf, are not generated by default. To turn these on, add the following modules after the - AutoWebApp ... / module in the server.xml file: + AutoWebApp ... / module in the server.xml file. The locations for their + configuration files is also shown. - Apache configs: ApacheConfig / - IIS config: IISConfig / - Netscape config: NSConfig / + Apache mod_jk config:ApacheConfig / + Def conf file:conf/auto/mod_jk.conf + Def workers file:conf/jk/workers.properties + + Apache mod_jserv config: JservConfig / + Def conf file:conf/jserv/tomcat-apache.conf + + IIS config: IISConfig / + Reg file:conf/jk/iis_redirect.reg-auto + Workers file:conf/jk/workers.properties + Workers map file:conf/jk/uriworkermap.properties + + Netscape config: NSConfig / + Conf file:conf/jk/obj.conf-auto + Workers file:conf/jk/workers.properties Note: The old organization used in Tomcat 3.2 where all the configuration is - placed in server.xml is still supported by Tomcat 3.3m4. + placed in server.xml is still supported by Tomcat 3.3b1 for Apache. However, + you will need to set the appropriate parameters on the interceptor. - Tomcat Testing: The test web application along with the test-tomcat.xml and - associated support files are not part of the binary Tomcat 3.3m4 distribution. + associated support files are not part of the binary Tomcat 3.3b1 distribution. The test web application is supplied separately as test.war. This file - may be downloaded from the v3.3-m4/apps directory of the Tomcat 3.3m4 + may be downloaded from the v3.3-b1/apps directory of the Tomcat 3.3b1 release and placed in the webapps directory of your installation. Running the test has been integrated into the Admin web application that is part of - the Tomcat 3.3m4 distribution. A preliminary step to running the test is to +
cvs commit: jakarta-tomcat/src/etc modules.xml
larryi 01/07/19 13:20:50 Modified:src/etc modules.xml Log: Add JservConfig Revision ChangesPath 1.9 +2 -0 jakarta-tomcat/src/etc/modules.xml Index: modules.xml === RCS file: /home/cvs/jakarta-tomcat/src/etc/modules.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- modules.xml 2001/07/19 05:58:08 1.8 +++ modules.xml 2001/07/19 20:20:50 1.9 @@ -13,6 +13,8 @@ module name=ApacheConfig javaClass=org.apache.tomcat.modules.config.ApacheConfig/ +module name=JservConfig javaClass=org.apache.tomcat.modules.config.JservConfig/ + module name=PolicyLoader javaClass=org.apache.tomcat.modules.config.PolicyLoader/ module name=DefaultCMSetter javaClass=org.apache.tomcat.modules.config.DefaultCMSetter/
Re: [TC4.0] Disabling debug output...
Craig R. McClanahan at [EMAIL PROTECTED] wrote: - However, Pier's proposed approach doesn't deal with a need that I've experienced regularly -- the need to turn on debugging messages dynamically on an existing component, *without* recompiling it. This is NOT simply aesthetics; either you can or you cannot change the level of debugging output at runtime. You didn't get it Craig... I'm simply proposing to use the if (DEBUG) approach _instead_ of commenting out logs in the source file... Go and look at HttpConnector.java... There are TONS of // (comments) that could be replaced with an if (DEBUG). If you remove the comments, you too have to recompile the sources... Pier
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config JservConfig.java
larryi 01/07/19 13:23:34 Modified:src/share/org/apache/tomcat/modules/config JservConfig.java Log: Fix protocol name. Remove incorrect comment. Revision ChangesPath 1.2 +2 -3 jakarta-tomcat/src/share/org/apache/tomcat/modules/config/JservConfig.java Index: JservConfig.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/JservConfig.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JservConfig.java 2001/07/03 23:29:32 1.1 +++ JservConfig.java 2001/07/19 20:23:34 1.2 @@ -102,7 +102,7 @@ p @author Costin Manolache @author Mel Martinez - @version $Revision: 1.1 $ $Date: 2001/07/03 23:29:32 $ + @version $Revision: 1.2 $ $Date: 2001/07/19 20:23:34 $ */ public class JservConfig extends BaseInterceptor { @@ -110,7 +110,7 @@ public static final String APACHE_CONFIG=conf/jserv/tomcat-apache.conf; /** default location of mod_jserv Apache plug-in. */ public static final String MOD_JSERV; -public static final String AJPV12=ajp12; +public static final String AJPV12=ajpv12; //set up some defaults based on OS type static{ @@ -343,7 +343,6 @@ // Find Ajp1? connectors int portInt=8007; BaseInterceptor ci[]=cm.getContainer().getInterceptors(); - // try to get jakarta-tomcat-connectors Ajp13 Interceptor class for( int i=0; ici.length; i++ ) { Object con=ci[i]; if( con instanceof Ajp12Interceptor ) {
Re: AdaptiveClassLoader, getResources, jndi.properties (Tomcat bug?)
Hi, Thanks for responding. As far as I can tell this is a problem with Tomcat... AdaptiveClassLoader doesn't override findResources, which is causing the problem. I am digging through the source, and here is what happens when you instantiate an InitialContext object: InitialContext.init(null) is called, which calls ResourceManager.getInitialEnvironment(null) At this point, ResourceManager is going to load any JNDI properties it can find. After getInitialEnvironment checks the system properties, it then attempts to load application resources, by calling ResourceManager.getApplicationResources() This method will load resources with a ClassLoader of course, and it gets the class loader from the current thread by calling VersionHelper12.getContextClassLoader(). Because I am using Jdk12Interceptor, it will return AdaptiveClassLoader. This is where the important stuff happens. It will look for the JNDI properties file by calling getResources(). This is a final method on java.lang.ClassLoader that calls findResources()... The JavaDoc states that ClassLoader implementations should override this method to load resources. AdaptiveClassLoader doesn't. Why not? :) I can submit a patch, but it looks like someone else already did awhile back... I wondered why it wasn't applied, and thought maybe I missed something? If I patch is needed, let me know, I can get one to this list tonight... Thanks again, David Rob S. wrote: If this is what I'm remembering, your ContextFactory class can't be found. This is cuz the JNDI code is broken in that it doesn't rely on its parent classloader (in our case, the one that knows about WEB-INF/classes and lib) to load the context factory. You have to implement your own InitialContextFactoryBuilder. Check the Sun messages boards. I ran into the same problem last month. - r -Original Message- From: David Haraburda [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 19, 2001 10:51 AM To: [EMAIL PROTECTED] Subject: AdaptiveClassLoader, getResources, jndi.properties (Tomcat bug?) Hi, I got no response to this message on the tomcat-user list, so I am trying here. I could find nothing in the archives except the message I refer to below -- I apologize if this issue has been addressed and I just couldn't find the info... I am having problems with jndi.properties being read from my WEB-INF/classes directory. I have seen this problem referenced once on the tomcat-dev mailing list -- someone submitted a patch, but apparently it did not get committed. (I couldn't find a reason why, so I am not sure if that was the real solution to the problem or not). The original message is here: http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg06588.html I have verified that the same behaivor he refers to is going on with my application -- InitialContext is using getResources(), which doesn't return anything becuase AdaptiveClassLoader doesn't implement findResource or findResources. Has anyone else having this problem found a solution/work-around? Is there a Tomcat guru/developer out there who can explain why AdaptiveClassLoader doesn't implement findResources()? Thanks, David
RE: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config JservConfig.java
How do i unsubscribe form mailing list -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: July 19, 2001 1:24 PM To: [EMAIL PROTECTED] Subject: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config JservConfig.java larryi 01/07/19 13:23:34 Modified:src/share/org/apache/tomcat/modules/config JservConfig.java Log: Fix protocol name. Remove incorrect comment. Revision ChangesPath 1.2 +2 -3 jakarta-tomcat/src/share/org/apache/tomcat/modules/config/JservConfig.java Index: JservConfig.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/JservCon fig.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JservConfig.java 2001/07/03 23:29:32 1.1 +++ JservConfig.java 2001/07/19 20:23:34 1.2 @@ -102,7 +102,7 @@ p @author Costin Manolache @author Mel Martinez - @version $Revision: 1.1 $ $Date: 2001/07/03 23:29:32 $ + @version $Revision: 1.2 $ $Date: 2001/07/19 20:23:34 $ */ public class JservConfig extends BaseInterceptor { @@ -110,7 +110,7 @@ public static final String APACHE_CONFIG=conf/jserv/tomcat-apache.conf; /** default location of mod_jserv Apache plug-in. */ public static final String MOD_JSERV; -public static final String AJPV12=ajp12; +public static final String AJPV12=ajpv12; //set up some defaults based on OS type static{ @@ -343,7 +343,6 @@ // Find Ajp1? connectors int portInt=8007; BaseInterceptor ci[]=cm.getContainer().getInterceptors(); - // try to get jakarta-tomcat-connectors Ajp13 Interceptor class for( int i=0; ici.length; i++ ) { Object con=ci[i]; if( con instanceof Ajp12Interceptor ) {
UnSubsribe
UnSubsribe
Re: [TC4.0] Disabling debug output...
Actually I've got a thought on how to add in debug messages without recompiling. For a horrible hack say I've got a java class like: //Constants.java public class Constants{ public static boolean isDebug(){return true;} } And in my main code I call: if(Constants.isDebug()) log(someNastyFunction()); Now I could keep to versions of a class file generated from Constants.java (one which returns true, one with returns false) Replacing the class file Constants.class based upon my needs would effectively turn debugging on/off. There is an overhead of this approach for the lookup of the boolean, but it avoids the need to recompile to turn on debugging. It isn't as nice as having a debug flag passed in, but it would be a quick hack for most classes. It could even be used to debug code in production by replacing the class file and restarting. I prefer flags/config files to turn stuff like this on/off, but it is a relatively quick hack... Jonathan - Original Message - From: Pier P. Fumagalli [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 19, 2001 1:24 PM Subject: Re: [TC4.0] Disabling debug output... Craig R. McClanahan at [EMAIL PROTECTED] wrote: - However, Pier's proposed approach doesn't deal with a need that I've experienced regularly -- the need to turn on debugging messages dynamically on an existing component, *without* recompiling it. This is NOT simply aesthetics; either you can or you cannot change the level of debugging output at runtime. You didn't get it Craig... I'm simply proposing to use the if (DEBUG) approach _instead_ of commenting out logs in the source file... Go and look at HttpConnector.java... There are TONS of // (comments) that could be replaced with an if (DEBUG). If you remove the comments, you too have to recompile the sources... Pier
Re: [TC4.0] Disabling debug output...
On Thu, 19 Jul 2001, Jonathan Reichhold wrote: Actually I've got a thought on how to add in debug messages without recompiling. For a horrible hack say I've got a java class like: //Constants.java public class Constants{ public static boolean isDebug(){return true;} } And in my main code I call: if(Constants.isDebug()) log(someNastyFunction()); Now I could keep to versions of a class file generated from Constants.java (one which returns true, one with returns false) Replacing the class file Constants.class based upon my needs would effectively turn debugging on/off. There is an overhead of this approach for the lookup of the boolean, but it avoids the need to recompile to turn on debugging. It isn't as nice as having a debug flag passed in, but it would be a quick hack for most classes. It could even be used to debug code in production by replacing the class file and restarting. I prefer flags/config files to turn stuff like this on/off, but it is a relatively quick hack... This hack definitely works. As long as you're willing to pay the overhead for the method call, it's essentially equivalent to asking Log4J whether or not debugging output is enabled, which does something similar (but asks the instantiated logger object, instead of being a static method). Jonathan Craig - Original Message - From: Pier P. Fumagalli [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 19, 2001 1:24 PM Subject: Re: [TC4.0] Disabling debug output... Craig R. McClanahan at [EMAIL PROTECTED] wrote: - However, Pier's proposed approach doesn't deal with a need that I've experienced regularly -- the need to turn on debugging messages dynamically on an existing component, *without* recompiling it. This is NOT simply aesthetics; either you can or you cannot change the level of debugging output at runtime. You didn't get it Craig... I'm simply proposing to use the if (DEBUG) approach _instead_ of commenting out logs in the source file... Go and look at HttpConnector.java... There are TONS of // (comments) that could be replaced with an if (DEBUG). If you remove the comments, you too have to recompile the sources... Pier
UnSubsribe
UnSubsribe
Re: [TC4.0] Disabling debug output...
This hack definitely works. As long as you're willing to pay the overhead for the method call, it's essentially equivalent to asking Log4J whether or not debugging output is enabled, which does something similar (but asks the instantiated logger object, instead of being a static method). I'm not sure if Log4j has an accesible boolean like this (maybe it does, haven't used it yet), and if it was accessible it would reduce the gc load at the expense of some readibility of the source. The boolean check is relatively efficient in comparison to the function calls typically used in log messages (usually concat a string with some computed value after unkown work). I've run into problems with gc before and I tend to limit creation of extra objects. Ever run most log packages under a profiler and seen how many strings are created/destroyed on a regular basis? The code log(my message that I think is import + myVar.computeValue()); does unknown for myVar.computeValue() and then there is the creation of a StringBuffer, the concat, and the toString on the StringBuffer. All this for a line that may not be used except in high debug levels. Try doing that in a critical peice of code and watch performance go to hell quickly. On time critical code this gc time hurts. Don't even start me talking about fun in the gc with largs Maps. Can we say 90 second gc pauses every 2 minutes? Does anyone know if Log4j has a boolean method to check whether debugging is on/off? Jonathan
Re: [3.2] JSP Compiling Classpath issues -- finding WEB-INF/classes
(Sorry about the double-qoute, I missed the original message) -Original Message- From: Will England [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 19, 2001 10:49 AM To: [EMAIL PROTECTED] Subject: [3.2] JSP Compiling Classpath issues -- finding WEB-INF/classes Greetings! Over on tomcat-users, theres been a discussion on JSP's finding the WEB-INF/classes directory when compiling. They can't. From searches, I understand this issue has come up before in regards to the Coocon project. The root problem is that Jasper cannot find classes located in WEB-INF/classes of the web application that the JSP's belong to. This occurs when a JSP is either first deployed or the TOMCAT_HOME/work directory is cleared, requiring a recompile of the JSP's. The system is Tomcat 3.2 under Apache with mod_jk, running on SunOS 2.7 with JDK 1.2. I have noticed the same problem while doing some development using Tomcat 3.2.[23]. I worked around it by making sure that I unset the classpath before calling startup.sh, then things seemed to work properly and classes were found as expected. It seems that certain combinations of classes in different ares (CLASSPATH, WEB-INF/lib, or other) will break things, but I haven't pinned it down, so it could simply be user stupidity. -Dave
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util/xml XmlMapper.java
costin 01/07/19 14:43:02 Modified:src/share/org/apache/tomcat/util/compat Jdk11Compat.java Jdk12Support.java src/share/org/apache/tomcat/util/xml XmlMapper.java Log: First part of the 2696 fix. Revision ChangesPath 1.6 +7 -1 jakarta-tomcat/src/share/org/apache/tomcat/util/compat/Jdk11Compat.java Index: Jdk11Compat.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/compat/Jdk11Compat.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Jdk11Compat.java 2001/06/17 18:09:14 1.5 +++ Jdk11Compat.java 2001/07/19 21:43:02 1.6 @@ -61,6 +61,8 @@ import org.apache.tomcat.util.depend.*; import java.net.URL; +import java.util.ResourceBundle; +import java.util.Locale; /** General-purpose utility to provide backward-compatibility and JDK independence. This allow use of JDK1.2 ( or higher ) facilities if @@ -124,7 +126,11 @@ } // Other methods, as needed - + +public java.util.ResourceBundle getBundle(String name, Locale loc, ClassLoader cl ) { + return ResourceBundle.getBundle(name, loc); +} + // Factory /** Get a compatibiliy helper class. 1.4 +10 -0 jakarta-tomcat/src/share/org/apache/tomcat/util/compat/Jdk12Support.java Index: Jdk12Support.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/compat/Jdk12Support.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Jdk12Support.java 2001/06/17 18:09:13 1.3 +++ Jdk12Support.java 2001/07/19 21:43:02 1.4 @@ -118,6 +118,16 @@ return null; } +public java.util.ResourceBundle getBundle(String name, Locale loc, ClassLoader cl ) { + if( cl==null ) + cl=getContextClassLoader(); + if( cl==null ) + return ResourceBundle.getBundle(name, loc); + else + return ResourceBundle.getBundle(name, loc, cl); +} + + // Support static class PrivilegedProxy implements PrivilegedExceptionAction { 1.35 +20 -1 jakarta-tomcat/src/share/org/apache/tomcat/util/xml/XmlMapper.java Index: XmlMapper.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/xml/XmlMapper.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- XmlMapper.java2001/07/16 00:20:57 1.34 +++ XmlMapper.java2001/07/19 21:43:02 1.35 @@ -14,6 +14,7 @@ import org.xml.sax.*; import org.xml.sax.helpers.*; +import org.apache.tomcat.util.compat.*; /** * SAX Handler - it will read the XML and construct java objects @@ -75,7 +76,7 @@ throws SAXException { try { - // if( debug0) log(sp + + tag + + attributes + ); + if( debug5) log(sp + + tag + + attributes + ); attributeStack[sp]=attributes; tagStack[sp]=tag; sp++; @@ -255,7 +256,14 @@ public XmlMapper getMapper() { return this; } + +boolean useLocalLoader=true; +public void useLocalLoader(boolean b ) { + useLocalLoader=b; +} +static final Jdk11Compat jdk11Compat=Jdk11Compat.getJdkCompat(); + /** read an XML file, construct and return the object hierarchy */ public Object readXml(File xmlFile, Object root) @@ -266,12 +274,23 @@ this.pushObject( root ); } try { + // reset the context loader, so we find the parser in the current dir + ClassLoader cl=null; + if( useLocalLoader ) { + cl=jdk11Compat.getContextClassLoader(); + jdk11Compat.setContextClassLoader( this.getClass().getClassLoader()); + } + SAXParser parser=null; SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(false); factory.setValidating(validating); parser = factory.newSAXParser(); parser.parse(xmlFile, this); + + if( useLocalLoader cl!= null ) { + jdk11Compat.setContextClassLoader(cl); + } return root; // assume the stack is in the right position.
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/generators Jdk12Interceptor.java
costin 01/07/19 14:45:52 Modified:src/share/org/apache/tomcat/modules/generators Jdk12Interceptor.java Log: Another try. Revision ChangesPath 1.6 +3 -3 jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java Index: Jdk12Interceptor.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Jdk12Interceptor.java 2001/07/19 21:44:24 1.5 +++ Jdk12Interceptor.java 2001/07/19 21:45:52 1.6 @@ -93,13 +93,13 @@ public void postServletDestroy( Context ctx, Handler sw ) throws TomcatException { - jdk11Compat.setContextClassLoader(this.getClass().getLoader()); + jdk11Compat.setContextClassLoader(this.getClass().getClassLoader()); } public void postServletInit( Context ctx, Handler sw ) throws TomcatException { - jdk11Compat.setContextClassLoader(this.getClass().getLoader()); + jdk11Compat.setContextClassLoader(this.getClass().getClassLoader()); } /** Called before service method is invoked. @@ -125,7 +125,7 @@ if( request != null ) fixJDKContextClassLoader(request.getContext()); else - jdk11Compat.setContextClassLoader(this.getClass().getLoader()); + jdk11Compat.setContextClassLoader(this.getClass().getClassLoader()); return 0; }
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup StopTomcat.java
costin 01/07/19 14:52:48 Modified:src/share/org/apache/tomcat/startup StopTomcat.java Log: Allow users to specify the location of ajp12.id Revision ChangesPath 1.8 +17 -2 jakarta-tomcat/src/share/org/apache/tomcat/startup/StopTomcat.java Index: StopTomcat.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/StopTomcat.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- StopTomcat.java 2001/03/27 20:27:41 1.7 +++ StopTomcat.java 2001/07/19 21:52:48 1.8 @@ -83,6 +83,7 @@ String secret; // explicit command line params ( for port, host or secret ) boolean commandLineParams=false; +String secretFile=null; public StopTomcat() { @@ -90,6 +91,10 @@ // Parameters +public void setSecretFile( String s ) { + secretFile=s; +} + public void setH( String s ) { tomcatHome=s; System.getProperties().put(tomcat.home, s); @@ -140,8 +145,10 @@ // read TOMCAT_HOME/conf/ajp12.id unless command line params // specify a port/host/secret try { + if( secretFile==null ) + secretFile=tchome + /conf/ajp12.id; BufferedReader rd=new BufferedReader - ( new FileReader( tchome + /conf/ajp12.id)); + ( new FileReader(secretFile)); String line=rd.readLine(); if( port 0 ) { @@ -158,7 +165,7 @@ if( secret==null ) secret=line; } catch( IOException ex ) { //ex.printStackTrace(); - System.out.println(Can't read + tchome + /conf/ajp12.id); + System.out.println(Can't read + secretFile); // System.out.println(ex.toString()); if( ! commandLineParams ) return; @@ -279,6 +286,14 @@ commandLineParams=true; if (i args.length) secret=args[i]; + else + return false; + } + if (arg.equalsIgnoreCase(-ajpid) ) { + i++; + commandLineParams=true; + if (i args.length) + secretFile=args[i]; else return false; }
Nice script to change all those cvsroots?
Has anyone got a nice script to replace the jakarta.apache.org cvsroot to the cvs.apache.org cvs root? It's a lot of time to checkout everything again and gives lot's of other problems (losing changes I made to ant and tomcat eg..). It is for linux btw. Just a not : I have a checkout of all the jakarta projects, so I will save a lot of traffic to the cvs server with a nice change script.. (I'm not a guru on bash scripts..) Mvgr, Martin
Re: Nice script to change all those cvsroots?
A collection of invaluable scripts for CVS: http://www.red-bean.com/cvsutils/ cvsco is the one I use daily.. removes all local modifications. Among them: cvschroot makes it possible to change CVS/Root in all subdirectories to the given value. --Jeff On Fri, Jul 20, 2001 at 12:22:32AM +0200, Martin van den Bemt wrote: Has anyone got a nice script to replace the jakarta.apache.org cvsroot to the cvs.apache.org cvs root? It's a lot of time to checkout everything again and gives lot's of other problems (losing changes I made to ant and tomcat eg..). It is for linux btw. Just a not : I have a checkout of all the jakarta projects, so I will save a lot of traffic to the cvs server with a nice change script.. (I'm not a guru on bash scripts..) Mvgr, Martin
Re: [TC4.0] Disabling debug output...
On Thu, 19 Jul 2001, Jonathan Reichhold wrote: This hack definitely works. As long as you're willing to pay the overhead for the method call, it's essentially equivalent to asking Log4J whether or not debugging output is enabled, which does something similar (but asks the instantiated logger object, instead of being a static method). I'm not sure if Log4j has an accesible boolean like this (maybe it does, haven't used it yet), It's accessible, but via a method call. That's still a *lot* cheaper than doing useless string concatenations, but not quite as cheap as an integer comparison. I don't have the Log4J APIs available right at the moment, but there's a call on the logger object that can be used to check for enabled levels (or at least for debug). Craig McClanahan
cvs commit: jakarta-tomcat-connectors/webapp/java WarpEngine.java
pier01/07/19 16:34:07 Added: webapp/java WarpEngine.java Log: Re-enabling WARP engine. Revision ChangesPath 1.12 +9 -163jakarta-tomcat-connectors/webapp/java/WarpEngine.java
cvs commit: jakarta-tomcat-connectors/webapp/java WarpHost.java
pier01/07/19 16:34:35 Added: webapp/java WarpHost.java Log: Re-enabling Warp Host. Revision ChangesPath 1.9 +13 -115 jakarta-tomcat-connectors/webapp/java/WarpHost.java
cvs commit: jakarta-tomcat-connectors/webapp/java WarpRequest.java
pier01/07/19 16:35:07 Added: webapp/java WarpRequest.java Log: Re-enabling WarpRequest Revision ChangesPath 1.6 +16 -101 jakarta-tomcat-connectors/webapp/java/WarpRequest.java
cvs commit: jakarta-tomcat-connectors/webapp/java WarpRequestHandler.java
pier01/07/19 16:35:26 Added: webapp/java WarpRequestHandler.java Log: Re-enabling WarpRequestHandler Revision ChangesPath 1.9 +125 -126 jakarta-tomcat-connectors/webapp/java/WarpRequestHandler.java
cvs commit: jakarta-tomcat-connectors/webapp/java WarpResponse.java
pier01/07/19 16:35:56 Added: webapp/java WarpResponse.java Log: Re-enabling WarpResponse Revision ChangesPath 1.5 +139 -131 jakarta-tomcat-connectors/webapp/java/WarpResponse.java
cvs commit: jakarta-tomcat-connectors/webapp/java WarpConfigurationHandler.java
pier01/07/19 16:36:57 Modified:webapp/java WarpConfigurationHandler.java Log: Creating WarpContainers instead of standard ones (but the standard ones are still allowed) Revision ChangesPath 1.9 +19 -13 jakarta-tomcat-connectors/webapp/java/WarpConfigurationHandler.java Index: WarpConfigurationHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpConfigurationHandler.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- WarpConfigurationHandler.java 2001/07/19 04:19:01 1.8 +++ WarpConfigurationHandler.java 2001/07/19 23:36:56 1.9 @@ -65,6 +65,7 @@ import org.apache.catalina.Deployer; import org.apache.catalina.Host; import org.apache.catalina.core.StandardHost; +import org.apache.catalina.core.StandardContext; public class WarpConfigurationHandler { @@ -76,11 +77,10 @@ super(); } -public boolean handle(WarpConnection connection) +public boolean handle(WarpConnection connection, WarpPacket packet) throws IOException { WarpLogger logger=new WarpLogger(this); logger.setContainer(connection.getConnector().getContainer()); -WarpPacket packet=new WarpPacket(); // Prepare the Welcome packet packet.setType(Constants.TYPE_CONF_WELCOME); @@ -134,9 +134,6 @@ } case Constants.TYPE_CONF_DONE: { -packet.reset(); -packet.setType(Constants.TYPE_CONF_PROCEED); -connection.send(packet); return(true); } @@ -145,7 +142,12 @@ } default: { -logger.log(Invalid packet with type +packet.getType()); +String msg=Invalid packet with type +packet.getType(); +logger.log(msg); +packet.reset(); +packet.setType(Constants.TYPE_FATAL); +packet.writeString(msg); +connection.send(packet); return(false); } } @@ -162,11 +164,13 @@ Host host=(Host)container.findChild(hostName); if (host==null) { -host=new StandardHost(); -host.setName(hostName); -host.setParent(container); -host.setAppBase(connection.getConnector().getAppBase()); -container.addChild(host); +WarpHost whost=new WarpHost(); +whost.setName(hostName); +whost.setParent(container); +whost.setAppBase(connection.getConnector().getAppBase()); +whost.setDebug(connection.getConnector().getDebug()); +container.addChild(whost); +host=whost; if (Constants.DEBUG) logger.debug(Created new host +host.getName()); } else if (Constants.DEBUG) { @@ -207,8 +211,10 @@ logger.debug(Application URL \+url.toString()+\); deployer.install(applPath, url); -return(deployer.findDeployedApp(applPath)); - +StandardContext context=null; +context=(StandardContext)deployer.findDeployedApp(applPath); +context.setDebug(connection.getConnector().getDebug()); +return(context); } else { if (Constants.DEBUG) logger.debug(Found application for \+appl.getName()+\);
cvs commit: jakarta-tomcat-connectors/webapp/java WarpConnection.java
pier01/07/19 16:37:55 Modified:webapp/java WarpConnection.java Log: Handle requests. Revision ChangesPath 1.16 +6 -2 jakarta-tomcat-connectors/webapp/java/WarpConnection.java Index: WarpConnection.java === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpConnection.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- WarpConnection.java 2001/07/19 04:19:01 1.15 +++ WarpConnection.java 2001/07/19 23:37:55 1.16 @@ -179,16 +179,20 @@ * Process data from the socket. */ public void run() { +WarpPacket packet=new WarpPacket(); + if (Constants.DEBUG) logger.debug(Connection starting); try { this.input=this.socket.getInputStream(); this.output=this.socket.getOutputStream(); -boolean success=new WarpConfigurationHandler().handle(this); -if (!success) { +if (!new WarpConfigurationHandler().handle(this,packet)) { logger.log(Configuration handler returned false); this.stop(); } +WarpRequestHandler requestHandler=new WarpRequestHandler(); +while (requestHandler.handle(this,packet)); +this.stop(); } catch (IOException e) { logger.log(Exception on socket,e); }
Re: cvs commit: jakarta-tomcat-connectors/webapp/javaWarpConnection.java
FUCK! Why does MacOS/X crashes right in the middle of a commit? Back in one minute after restart... Pier
Re: [TC4.0] Disabling debug output...
Craig wrote: - The typical approach with the JSR47 API or with Log4J is to let the logger decide whether to really output the message or not. So, you would instrument your code with things like (conceptual, not real API): logger.log(The object is + myObject, Logger.DEBUG); and let the logger configuration decide whether you care about debug messages or not. - However, there is a performance problem with leaving this code in -- you will be doing the string concatenation (and the method call) whether or not you want debug messages printed! If you are liberal about debug messages, especially inside frequently executed methods, this can have adverse impacts on performance (and increased garbage collection). Often the toString() are much worse than the concatenations. After we realized what a HUGE impact this had on performance, we added a bunch of overloadings so that you could convert the above to the equivalent of: logger.log(Logger.DEBUG, The object is {0}, myObject); where the formatting is only done once it's known that the category is enabled (we used named categories instead of levels, but that's another discussion). I just went and looked at log4j and java.util.logging and it looks like both would require going through a wrapper class to get this feature. The number of overloadings is a bit of a pain for the implementer once you consider that you would often want to log boolean, int, and in some applications float parameters, but not for the caller. Louis Tribble
cvs commit: jakarta-tomcat-connectors/webapp/java WarpConnector.java WarpPacket.java
pier01/07/19 16:45:30 Modified:webapp/java WarpConnector.java WarpPacket.java Log: Forgot bean method to set port. Added applications table. Revision ChangesPath 1.16 +34 -0 jakarta-tomcat-connectors/webapp/java/WarpConnector.java Index: WarpConnector.java === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpConnector.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- WarpConnector.java2001/07/19 02:45:33 1.15 +++ WarpConnector.java2001/07/19 23:45:30 1.16 @@ -122,6 +122,8 @@ private int acceptCount=10; /** The server appBase for hosts created via WARP. */ private String appBase=webapps; +/** The debug level. */ +private int debug=0; /* */ /* Lifecycle variables */ @@ -333,6 +335,13 @@ } /** + * Return the port to which this codeConnector/code will bind to. + */ +public void setPort(int port) { +this.port=port; +} + +/** * Set the IP address to which this codeConnector/code will bind to. * * @param address The bind IP address @@ -383,6 +392,20 @@ if (Constants.DEBUG) logger.debug(Setting appBase to +appBase); } +/** + * Return the debug level. + */ +public int getDebug() { +return(this.debug); +} + +/** + * Set the debug level. + */ +public void setDebug(int debug) { +this.debug=debug; +} + /* */ /* Lifecycle methods*/ /* */ @@ -459,6 +482,17 @@ id=this.applications.indexOf(context); } return(id); +} + +/** + * Return the application for a given ID. + */ +protected Context applicationContext(int id) { +try { +return((Context)this.applications.elementAt(id)); +} catch (ArrayIndexOutOfBoundsException e) { +return(null); +} } /** 1.12 +6 -8 jakarta-tomcat-connectors/webapp/java/WarpPacket.java Index: WarpPacket.java === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpPacket.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- WarpPacket.java 2001/07/15 08:40:58 1.11 +++ WarpPacket.java 2001/07/19 23:45:30 1.12 @@ -181,9 +181,8 @@ if ((this.pointer+2)this.size) throw new ArrayIndexOutOfBoundsException(No data available); -int k=0; -k=(k8)|(this.buffer[this.pointer++]); -k=(k8)|(this.buffer[this.pointer++]); +int k=(this.buffer[this.pointer++])0xff; +k=(k8)+((this.buffer[this.pointer++])0xff); return(k); } @@ -199,11 +198,10 @@ if ((this.pointer+4)this.size) throw new ArrayIndexOutOfBoundsException(No data available); -int k=0; -k=(k8)|(this.buffer[this.pointer++]); -k=(k8)|(this.buffer[this.pointer++]); -k=(k8)|(this.buffer[this.pointer++]); -k=(k8)|(this.buffer[this.pointer++]); +int k=(this.buffer[this.pointer++])0xff; +k=(k8)+((this.buffer[this.pointer++])0xff); +k=(k8)+((this.buffer[this.pointer++])0xff); +k=(k8)+((this.buffer[this.pointer++])0xff); return(k); }
cvs commit: jakarta-tomcat-connectors/webapp/java Constants.java.in
pier01/07/19 16:46:30 Modified:webapp/java Constants.java.in Log: Added types. Revision ChangesPath 1.4 +15 -0 jakarta-tomcat-connectors/webapp/java/Constants.java.in Index: Constants.java.in === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/Constants.java.in,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Constants.java.in 2001/07/19 14:37:12 1.3 +++ Constants.java.in 2001/07/19 23:46:30 1.4 @@ -148,4 +148,19 @@ * No payload:br */ public static final int TYPE_CONF_PROCEED=0x05; + +public static final int TYPE_REQ_INIT=0x10; +public static final int TYPE_REQ_CONTENT=0x11; +public static final int TYPE_REQ_SCHEME=0x12; +public static final int TYPE_REQ_AUTH=0x13; +public static final int TYPE_REQ_HEADER=0x14; +public static final int TYPE_REQ_PROCEED=0x1f; + +public static final int TYPE_RES_STATUS=0x20; +public static final int TYPE_RES_HEADER=0x21; +public static final int TYPE_RES_COMMIT=0x2f; +public static final int TYPE_RES_BODY=0x30; +public static final int TYPE_RES_DONE=0x3f; + + }
cvs commit: jakarta-tomcat-connectors/webapp/include wa_request.h
pier01/07/19 16:47:31 Modified:webapp/include wa_request.h Log: Added content-type to the request structure. Revision ChangesPath 1.6 +3 -1 jakarta-tomcat-connectors/webapp/include/wa_request.h Index: wa_request.h === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/include/wa_request.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- wa_request.h 2001/05/10 21:15:01 1.5 +++ wa_request.h 2001/07/19 23:47:31 1.6 @@ -58,7 +58,7 @@ /** * @package Request Handling * @author Pier Fumagalli mailto:[EMAIL PROTECTED] - * @version $Id: wa_request.h,v 1.5 2001/05/10 21:15:01 pier Exp $ + * @version $Id: wa_request.h,v 1.6 2001/07/19 23:47:31 pier Exp $ */ #ifndef _WA_REQUEST_H_ #define _WA_REQUEST_H_ @@ -122,6 +122,8 @@ char *auth; /** The content length of this request. */ long clen; +/** The content type of this request. */ +char *ctyp; /** The number of bytes read out of this request body. */ long rlen; /** The current headers table. */
cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp.h
pier01/07/19 16:49:00 Modified:webapp/lib pr_warp.h Log: Added WARP header structure to process headers from table. Added packet types for request. Changed function names for configuration. Revision ChangesPath 1.4 +24 -3 jakarta-tomcat-connectors/webapp/lib/pr_warp.h Index: pr_warp.h === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/pr_warp.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- pr_warp.h 2001/07/19 04:22:13 1.3 +++ pr_warp.h 2001/07/19 23:49:00 1.4 @@ -54,7 +54,7 @@ * * * = */ -/* @version $Id: pr_warp.h,v 1.3 2001/07/19 04:22:13 pier Exp $ */ +/* @version $Id: pr_warp.h,v 1.4 2001/07/19 23:49:00 pier Exp $ */ #ifndef _PR_WARP_H_ #define _PR_WARP_H_ @@ -90,6 +90,13 @@ char buff[65536]; } warp_packet; +/* Structure for processin headers in WARP */ +typedef struct warp_header { +wa_connection *conn; +warp_packet *pack; +wa_boolean fail; +} warp_header; + /* * */ /* DEFINITIONS */ /* * */ @@ -109,6 +116,20 @@ #define TYPE_CONF_DONE0x04 #define TYPE_CONF_PROCEED 0x05 +#define TYPE_REQ_INIT 0x10 +#define TYPE_REQ_CONTENT 0x11 +#define TYPE_REQ_SCHEME 0x12 +#define TYPE_REQ_AUTH 0x13 +#define TYPE_REQ_HEADER 0x14 +#define TYPE_REQ_PROCEED 0x1f + +#define TYPE_RES_STATUS 0x20 +#define TYPE_RES_HEADER 0x21 +#define TYPE_RES_COMMIT 0x2f +#define TYPE_RES_BODY 0x30 +#define TYPE_RES_DONE 0x3f + + /* * */ /* PACKET FUNCTIONS FROM PR_WARP_PACKET.C*/ /* * */ @@ -132,7 +153,7 @@ /* * */ /* CONFIGURATION FUNCTIONS FROM PR_WARP_CONFIG.C */ /* * */ -wa_boolean n_check(wa_connection *conn, warp_packet *pack); -wa_boolean n_configure(wa_connection *conn); +wa_boolean c_check(wa_connection *conn, warp_packet *pack); +wa_boolean c_configure(wa_connection *conn); #endif /* ifndef _PR_WARP_H_ */
cvs commit: jakarta-tomcat-connectors/webapp/lib wa_main.c
pier01/07/19 16:50:03 Modified:webapp/lib wa_main.c Log: Better debugging output. Revision ChangesPath 1.9 +8 -4 jakarta-tomcat-connectors/webapp/lib/wa_main.c Index: wa_main.c === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/wa_main.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- wa_main.c 2001/07/13 01:15:36 1.8 +++ wa_main.c 2001/07/19 23:50:03 1.9 @@ -55,7 +55,7 @@ * * * = */ -/* @version $Id: wa_main.c,v 1.8 2001/07/13 01:15:36 pier Exp $ */ +/* @version $Id: wa_main.c,v 1.9 2001/07/19 23:50:03 pier Exp $ */ #include wa.h /* The current APR memory pool. */ @@ -189,6 +189,9 @@ /* Dump some debugging information. */ void wa_debug(const char *f, const int l, const char *fmt, ...) { #ifdef DEBUG +char hdr[128]; +char dta[640]; +char buf[768]; apr_time_t at; char st[128]; va_list ap; @@ -196,9 +199,10 @@ at=apr_time_now(); apr_ctime(st, at); va_start(ap,fmt); -fprintf(stderr,[%s] %d (%s:%d) ,st,getpid(),f,l); -vfprintf(stderr,fmt,ap); -fprintf(stderr,\n); +apr_snprintf(hdr,128,[%s] %d (%s:%d),st,getpid(),f,l); +apr_vsnprintf(dta,640,fmt,ap); +apr_snprintf(buf,728,%s %s\n,hdr,dta); +fprintf(stderr,%s,buf); fflush(stderr); va_end(ap); #endif /* ifdef DEBUG */
cvs commit: jakarta-tomcat-connectors/webapp/lib wa_request.c
pier01/07/19 16:50:48 Modified:webapp/lib wa_request.c Log: Set default content-type string. Revision ChangesPath 1.14 +2 -1 jakarta-tomcat-connectors/webapp/lib/wa_request.c Index: wa_request.c === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/wa_request.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- wa_request.c 2001/07/19 04:21:38 1.13 +++ wa_request.c 2001/07/19 23:50:47 1.14 @@ -55,7 +55,7 @@ * * * = */ -/* @version $Id: wa_request.c,v 1.13 2001/07/19 04:21:38 pier Exp $ */ +/* @version $Id: wa_request.c,v 1.14 2001/07/19 23:50:47 pier Exp $ */ #include wa.h /* Allocate a new request structure. */ @@ -107,6 +107,7 @@ req-user=NULL; req-auth=NULL; req-clen=0; +req-ctyp=\0; req-rlen=0; /* All done */
cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp_packet.c
pier01/07/19 16:52:40 Modified:webapp/lib pr_warp_packet.c Log: Fixed bug truncating strings at the end. Revision ChangesPath 1.4 +3 -3 jakarta-tomcat-connectors/webapp/lib/pr_warp_packet.c Index: pr_warp_packet.c === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/pr_warp_packet.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- pr_warp_packet.c 2001/07/19 04:23:07 1.3 +++ pr_warp_packet.c 2001/07/19 23:52:40 1.4 @@ -54,7 +54,7 @@ * * * = */ -/* @version $Id: pr_warp_packet.c,v 1.3 2001/07/19 04:23:07 pier Exp $ */ +/* @version $Id: pr_warp_packet.c,v 1.4 2001/07/19 23:52:40 pier Exp $ */ #include pr_warp.h void p_reset(warp_packet *pack) { @@ -112,10 +112,10 @@ return(wa_false); } -*x=(char *)apr_palloc(pack-pool,(len+1)*sizeof(char)); +*x=(char *)apr_palloc(pack-pool,(len+2)*sizeof(char)); if (*x==NULL) return(wa_false); -apr_cpystrn(*x,pack-buff[pack-curr],len); +apr_cpystrn(*x,pack-buff[pack-curr],len+1); pack-curr+=len; return(wa_true); }
cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp.c
pier01/07/19 16:53:41 Modified:webapp/lib pr_warp.c Log: Readded request handling. Revision ChangesPath 1.10 +182 -4jakarta-tomcat-connectors/webapp/lib/pr_warp.c Index: pr_warp.c === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/pr_warp.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- pr_warp.c 2001/07/18 19:19:26 1.9 +++ pr_warp.c 2001/07/19 23:53:41 1.10 @@ -54,7 +54,7 @@ * * * = */ -/* @version $Id: pr_warp.c,v 1.9 2001/07/18 19:19:26 pier Exp $ */ +/* @version $Id: pr_warp.c,v 1.10 2001/07/19 23:53:41 pier Exp $ */ #include pr_warp.h /* Initialize this provider. */ @@ -73,8 +73,11 @@ wa_debug(WA_MARK,Opening connection \%s\,curr-name); if (n_connect(curr)==wa_true) { wa_debug(WA_MARK,Connection \%s\ opened,curr-name); -if (n_configure(curr)==wa_true) +if (c_configure(curr)==wa_true) { wa_debug(WA_MARK,Connection \%s\ configured,curr-name); +} else { +wa_log(WA_MARK,Cannot configure connection \%s\,curr-name); +} } else wa_log(WA_MARK,Cannot open connection \%s\,curr-name); elem=elem-next; } @@ -185,9 +188,184 @@ return(apr_psprintf(pool,Application ID: %d,(int)(appl-conf))); } +/* Transmit headers */ +static int headers(void *d, const char *n, const char *v) { +warp_header *data=(warp_header *)d; +wa_connection *conn=data-conn; +warp_config *conf=(warp_config *)conn-conf; +warp_packet *pack=data-pack; + +pack-type=TYPE_REQ_HEADER; +p_write_string(pack,(char *)n); +p_write_string(pack,(char *)v); +if (n_send(conf-sock,pack)!=wa_true) { +data-fail=wa_true; +return(FALSE); +} +wa_debug(WA_MARK,Req. header %s: %s,n,v); +return(TRUE); +} + /* Handle a connection from the web server. */ -static int warp_handle(wa_request *r, wa_application *a) { -return(wa_rerror(WA_MARK,r,500,Not yet implemented)); +static int warp_handle(wa_request *r, wa_application *appl) { +warp_header *h=(warp_header *)apr_palloc(r-pool,sizeof(warp_header)); +wa_connection *conn=appl-conn; +warp_config *conf=(warp_config *)conn-conf; +warp_packet *pack=p_create(r-pool); +int status=0; + +// Check packet +if (pack==NULL) +return(wa_rerror(WA_MARK,r,500,Cannot create WARP packet)); + +// Check application +if (((int)(appl-conf))==-1) +return(wa_rerror(WA_MARK,r,404,Application not deployed)); + +// Attempt to reconnect if disconnected +if (conf-sock==NULL) { +if (n_connect(conn)==wa_true) { +wa_debug(WA_MARK,Connection \%s\ opened,conn-name); +if (c_configure(conn)==wa_true) { +wa_debug(WA_MARK,Connection \%s\ configured,conn-name); +} else { +wa_log(WA_MARK,Cannot configure connection %s,conn-name); +return(wa_rerror(WA_MARK,r,500, + Cannot configure connection \%s\, + conn-name)); +} +} else { +wa_log(WA_MARK,Cannot open connection %s,conn-name); +return(wa_rerror(WA_MARK,r,500,Cannot open connection %s, + conn-name)); +} +} + +// Let's do it +pack-type=TYPE_REQ_INIT; +p_write_int(pack,(int)(appl-conf)); +p_write_string(pack,r-meth); +p_write_string(pack,r-ruri); +p_write_string(pack,r-args); +p_write_string(pack,r-prot); +if (n_send(conf-sock,pack)!=wa_true) { +n_disconnect(conn); +return(wa_rerror(WA_MARK,r,500,Communitcation interrupted)); +} else { +wa_debug(WA_MARK,Req. %s %s %s,r-meth,r-ruri,r-prot); +} + +p_reset(pack); +pack-type=TYPE_REQ_CONTENT; +p_write_string(pack,r-ctyp); +p_write_int(pack,r-clen); +if (n_send(conf-sock,pack)!=wa_true) { +n_disconnect(conn); +return(wa_rerror(WA_MARK,r,500,Communitcation interrupted)); +} else { +wa_debug(WA_MARK,Req. content typ=%s len=%d,r-ctyp,r-clen); +} + +if (r-schm!=NULL) { +p_reset(pack); +pack-type=TYPE_REQ_SCHEME; +p_write_string(pack,r-schm); +if (n_send(conf-sock,pack)!=wa_true) { +n_disconnect(conn); +return(wa_rerror(WA_MARK,r,500,Communitcation interrupted)); +} else { +wa_debug(WA_MARK,Req. scheme %s,r-schm); +} +}
Re: cvs commit: jakarta-tomcat-connectors/webapp/javaWarpConnection.java
Pier P. Fumagalli wrote: FUCK! Why does MacOS/X crashes right in the middle of a commit? (Comment on Apple being able to find it with both hands and a flashlight withheld ;-)
cvs commit: jakarta-tomcat-connectors/webapp/apache-1.3 mod_webapp.c
pier01/07/19 16:55:01 Modified:webapp/apache-1.3 mod_webapp.c Log: Added Content-Type direct handling thru wa_request. Revision ChangesPath 1.20 +4 -1 jakarta-tomcat-connectors/webapp/apache-1.3/mod_webapp.c Index: mod_webapp.c === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/apache-1.3/mod_webapp.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- mod_webapp.c 2001/07/15 08:43:43 1.19 +++ mod_webapp.c 2001/07/19 23:55:01 1.20 @@ -57,7 +57,7 @@ /** * @author Pier Fumagalli mailto:[EMAIL PROTECTED] - * @version $Id: mod_webapp.c,v 1.19 2001/07/15 08:43:43 pier Exp $ + * @version $Id: mod_webapp.c,v 1.20 2001/07/19 23:55:01 pier Exp $ */ #include httpd.h @@ -451,6 +451,7 @@ req-user=apr_pstrdup(req-pool,con-user); req-auth=apr_pstrdup(req-pool,con-ap_auth_type); req-clen=0; +req-ctyp=\0; req-rlen=0; /* Copy headers into webapp request structure */ @@ -467,6 +468,8 @@ apr_pstrdup(req-pool,ele[x].val)); if (strcasecmp(ele[x].key,Content-Length)==0) req-clen=atol(ele[x].val); +if (strcasecmp(ele[x].key,Content-Type)==0) +req-ctyp=apr_pstrdup(req-pool,ele[x].val); } }
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp Constants.java WarpConfigurationHandler.java WarpLogger.java
pier01/07/19 16:59:15 Added: catalina/src/share/org/apache/catalina/connector/warp Constants.java WarpConfigurationHandler.java WarpLogger.java Log: New WARP classes. Revision ChangesPath 1.1 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/Constants.java Index: Constants.java === /* = * * * * The Apache Software License, Version 1.1 * * * * Copyright (c) 1999-2001 The Apache Software Foundation. * * All rights reserved.* * * * = * * * * Redistribution and use in source and binary forms, with or without modi- * * fication, are permitted provided that the following conditions are met: * * * * 1. Redistributions of source code must retain the above copyright notice * *notice, this list of conditions and the following disclaimer. * * * * 2. Redistributions in binary form must reproduce the above copyright * *notice, this list of conditions and the following disclaimer in the * *documentation and/or other materials provided with the distribution. * * * * 3. The end-user documentation included with the redistribution, if any, * *must include the following acknowlegement: * * * * This product includes software developed by the Apache Software * *Foundation http://www.apache.org/. * * * *Alternately, this acknowlegement may appear in the software itself, if * *and wherever such third-party acknowlegements normally appear. * * * * 4. The names The Jakarta Project, Tomcat, and Apache Software * *Foundation must not be used to endorse or promote products derived * *from this software without prior written permission. For written * *permission, please contact [EMAIL PROTECTED].* * * * 5. Products derived from this software may not be called Apache nor may * *Apache appear in their names without prior written permission of the * *Apache Software Foundation.* * * * THIS SOFTWARE IS PROVIDED AS IS AND ANY EXPRESSED OR IMPLIED WARRANTIES * * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * * THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY * * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * * POSSIBILITY OF SUCH DAMAGE. * * * * = * * * * This software consists of voluntary contributions made by many indivi- * * duals on behalf of the Apache Software Foundation. For more information * * on the Apache Software Foundation, please see http://www.apache.org/. * * * * = */
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpConnection.java
pier01/07/19 17:00:54 Modified:catalina/src/share/org/apache/catalina/connector/warp WarpConnection.java Log: New WARP implementation from Jakarta-Tomcat-Connectors Revision ChangesPath 1.8 +137 -260 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnection.java Index: WarpConnection.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnection.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- WarpConnection.java 2001/01/24 23:10:42 1.7 +++ WarpConnection.java 2001/07/20 00:00:53 1.8 @@ -2,7 +2,7 @@ * * * The Apache Software License, Version 1.1 * * * - * Copyright (c) 1999, 2000 The Apache Software Foundation. * + * Copyright (c) 1999-2001 The Apache Software Foundation. * * All rights reserved.* * * * = * @@ -56,326 +56,203 @@ * = */ package org.apache.catalina.connector.warp; -import java.io.*; -import java.net.*; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; + import org.apache.catalina.Lifecycle; import org.apache.catalina.LifecycleEvent; -import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleListener; -import org.apache.catalina.util.LifecycleSupport; + +public class WarpConnection implements LifecycleListener, Runnable { -/** - * - * @author a href=mailto:[EMAIL PROTECTED];Pier Fumagalli/a - * @author Copyright copy; 1999, 2000 a href=http://www.apache.org;The - * Apache Software Foundation. - * @version CVS $Id: WarpConnection.java,v 1.7 2001/01/24 23:10:42 pier Exp $ - */ -public class WarpConnection implements Lifecycle, Runnable { - -// -- CONSTANTS - -/** Our debug flag status (Used to compile out debugging information). */ -private static final boolean DEBUG=WarpDebug.DEBUG; - -// LOCAL VARIABLES - -/** The lifecycle event support for this component. */ -private LifecycleSupport lifecycle=null; -/** The WarpHandlerTable contains the list of all current handlers. */ -private WarpHandlerTable table=null; -/** The name of this connection. */ -private String name=null; -/** Wether we started or not. */ +/* */ +/* Instance variables */ +/* */ + +/* */ +/* Local variables */ + +/** Our socket input stream. */ +private InputStream input=null; +/** Our socket output stream. */ +private OutputStream output=null; +/** The started flag. */ private boolean started=false; -/** The number of active connections. */ -private static int num=0; +/** The local thread. */ +private Thread thread=null; +/** Our logger. */ +private WarpLogger logger=null; -// BEAN PROPERTIES +/* */ +/* Bean variables */ -/** The socket used in this connection. */ +/** The socket this connection is working on. */ private Socket socket=null; -/** The connector wich created this connection. */ +/** The connector instance. */ private WarpConnector connector=null; -// CONSTRUCTOR +/* */ +/* Constructor */ +/* */ /** - * Create a new WarpConnection instance. + * Construct a new instance of a codeWarpConnection/code. */ public WarpConnection() { super(); -this.lifecycle=new LifecycleSupport(this); -this.table=new
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpConnector.java
pier01/07/19 17:01:00 Modified:catalina/src/share/org/apache/catalina/connector/warp WarpConnector.java Log: New WARP implementation from Jakarta-Tomcat-Connectors Revision ChangesPath 1.12 +356 -233 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnector.java Index: WarpConnector.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnector.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- WarpConnector.java2001/05/09 23:42:17 1.11 +++ WarpConnector.java2001/07/20 00:01:00 1.12 @@ -2,7 +2,7 @@ * * * The Apache Software License, Version 1.1 * * * - * Copyright (c) 1999, 2000 The Apache Software Foundation. * + * Copyright (c) 1999-2001 The Apache Software Foundation. * * All rights reserved.* * * * = * @@ -56,193 +56,171 @@ * = */ package org.apache.catalina.connector.warp; -import java.io.*; -import java.net.*; -import org.apache.catalina.Container; +import java.io.IOException; +import java.net.InetAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.util.Random; +import java.util.Vector; + import org.apache.catalina.Connector; +import org.apache.catalina.Container; +import org.apache.catalina.Context; +import org.apache.catalina.Lifecycle; +import org.apache.catalina.Lifecycle; +import org.apache.catalina.LifecycleException; +import org.apache.catalina.LifecycleListener; +import org.apache.catalina.Logger; import org.apache.catalina.Request; import org.apache.catalina.Response; import org.apache.catalina.net.DefaultServerSocketFactory; import org.apache.catalina.net.ServerSocketFactory; -import org.apache.catalina.Lifecycle; -import org.apache.catalina.LifecycleEvent; -import org.apache.catalina.LifecycleException; -import org.apache.catalina.LifecycleListener; import org.apache.catalina.util.LifecycleSupport; -import org.apache.catalina.connector.HttpRequestBase; -import org.apache.catalina.connector.HttpResponseBase; -/** - * - * - * @author a href=mailto:[EMAIL PROTECTED];Pier Fumagalli/a - * @author Copyright copy; 1999, 2000 a href=http://www.apache.org;The - * Apache Software Foundation. - * @version CVS $Id: WarpConnector.java,v 1.11 2001/05/09 23:42:17 craigmcc Exp $ - */ public class WarpConnector implements Connector, Lifecycle, Runnable { -// -- CONSTANTS +/* */ +/* Instance variables */ +/* */ + +/* */ +/* Local variables */ + +/** The running thread accepting connections */ +private Thread thread=null; +/** The server socket. */ +private ServerSocket server=null; +/** Our codeWarpLogger/code. */ +private WarpLogger logger=null; +/** Our list of deployed web applications. */ +private Vector applications=new Vector(); +/** The unique ID of this connector instance. */ +protected int uniqueId=-1; -/** Our debug flag status (Used to compile out debugging information). */ -private static final boolean DEBUG=WarpDebug.DEBUG; -/** The descriptive information related to this implementation. */ -private static final String info=WarpConnector/+WarpConstants.VERSION; +/* */ +/* Bean variables */ -// LOCAL VARIABLES - -/** The lifecycle event support for this component. */ -private LifecycleSupport lifecycle=null; -/** The server socket factory for this connector. */ -private ServerSocket socket=null; -/** Wether the start() method was called or not. */ -private boolean started=false; -/** The accept count for the server socket. */ -private int count = 10; -/** Should we enable DNS lookups? */ -private boolean enableLookups = false;
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpEngine.java
pier01/07/19 17:01:06 Modified:catalina/src/share/org/apache/catalina/connector/warp WarpEngine.java Log: New WARP implementation from Jakarta-Tomcat-Connectors Revision ChangesPath 1.11 +9 -163 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java Index: WarpEngine.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- WarpEngine.java 2001/01/24 23:10:46 1.10 +++ WarpEngine.java 2001/07/20 00:01:06 1.11 @@ -2,7 +2,7 @@ * * * The Apache Software License, Version 1.1 * * * - * Copyright (c) 1999, 2000 The Apache Software Foundation. * + * Copyright (c) 1999-2001 The Apache Software Foundation. * * All rights reserved.* * * * = * @@ -58,177 +58,23 @@ import java.io.IOException; import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.http.HttpServletResponse; + import org.apache.catalina.Container; -import org.apache.catalina.Engine; -import org.apache.catalina.Globals; import org.apache.catalina.Host; -import org.apache.catalina.LifecycleException; import org.apache.catalina.Request; import org.apache.catalina.Response; import org.apache.catalina.core.StandardEngine; -/** - * - * - * @author a href=mailto:[EMAIL PROTECTED];Pier Fumagalli/a - * @author Copyright copy; 1999, 2000 a href=http://www.apache.org;The - * Apache Software Foundation. - * @version CVS $Id: WarpEngine.java,v 1.10 2001/01/24 23:10:46 pier Exp $ - */ public class WarpEngine extends StandardEngine { - -// -- CONSTANTS - -/** Our debug flag status (Used to compile out debugging information). */ -private static final boolean DEBUG=WarpDebug.DEBUG; -/** The descriptive information related to this implementation. */ -private static final String info=WarpEngine/+WarpConstants.VERSION; - -// LOCAL VARIABLES - -/** The Java class name of the default Mapper class for this Container. */ -private String mapper=org.apache.catalina.connector.warp.WarpEngineMapper; -/** The root path for web applications. */ -private String appbase=; -/** The Host ID to use for the next dynamically configured host. */ -private int hostid=0; - -// CONSTRUCTOR - -/** - * Create a new WarpEngine component with the default basic Valve. - */ -public WarpEngine() { -super(); -super.addDefaultMapper(this.mapper); -if (DEBUG) this.debug(New instance created); -this.setDebug(9); -} - -// - PUBLIC METHODS - -public void invoke(Request req, Response res) -throws ServletException, IOException { -if (DEBUG) this.debug(Invoked); -super.invoke(req,res); -} - public Container map(Request request, boolean update) { -if (DEBUG) this.debug(Trying to map request to host); +this.log(Mapping request); if (request instanceof WarpRequest) { -WarpRequest r=(WarpRequest)request; - - Container children[]=this.findChildren(); - for (int x=0; xchildren.length; x++) { - if (children[x] instanceof WarpHost) { - WarpHost host=(WarpHost)children[x]; - if (r.getRequestedHostID()==host.getHostID()) { - return(children[x]); - } -} +WarpRequest wreq=(WarpRequest)request; +Host host=wreq.getHost(); +if (update) { +request.setServerName(host.getName()); } -} -if (DEBUG) this.debug(Trying to map request to host (std)); -return(super.map(request,update)); -} - -/** - * Add a default Mapper implementation if none have been configured - * explicitly. - * - * @param mapperClass Java class name of the default Mapper - */ -protected void addDefaultMapper(String
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpHost.java
pier01/07/19 17:01:12 Modified:catalina/src/share/org/apache/catalina/connector/warp WarpHost.java Log: New WARP implementation from Jakarta-Tomcat-Connectors Revision ChangesPath 1.8 +13 -115 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpHost.java Index: WarpHost.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpHost.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- WarpHost.java 2001/01/24 23:10:48 1.7 +++ WarpHost.java 2001/07/20 00:01:12 1.8 @@ -2,7 +2,7 @@ * * * The Apache Software License, Version 1.1 * * * - * Copyright (c) 1999, 2000 The Apache Software Foundation. * + * Copyright (c) 1999-2001 The Apache Software Foundation. * * All rights reserved.* * * * = * @@ -56,127 +56,25 @@ * = */ package org.apache.catalina.connector.warp; +import java.io.IOException; import javax.servlet.ServletException; + +import org.apache.catalina.Container; +import org.apache.catalina.Context; import org.apache.catalina.Request; import org.apache.catalina.Response; -import java.io.IOException; -import java.net.URL; -import org.apache.catalina.Container; -import org.apache.catalina.core.StandardHost; import org.apache.catalina.core.StandardContext; -import org.apache.catalina.startup.HostConfig; -import org.apache.catalina.LifecycleException; +import org.apache.catalina.core.StandardHost; -/** - * - * - * @author a href=mailto:[EMAIL PROTECTED];Pier Fumagalli/a - * @author Copyright copy; 1999, 2000 a href=http://www.apache.org;The - * Apache Software Foundation. - * @version CVS $Id: WarpHost.java,v 1.7 2001/01/24 23:10:48 pier Exp $ - */ public class WarpHost extends StandardHost { - -// -- CONSTANTS - -/** Our debug flag status (Used to compile out debugging information). */ -private static final boolean DEBUG=WarpDebug.DEBUG; -/** The class used for contexts. */ -private static String cc=org.apache.catalina.connector.warp.WarpContext; - -// LOCAL VARIABLES - -/** The Warp Host ID of this Host. */ -private int id=-1; -/** The ID to use for the next dynamically configured application. */ -private int applid=0; - -/** - * Create a new instance of a WarpHost. - */ -public WarpHost() { -super(); -HostConfig conf=new HostConfig(); -conf.setContextClass(cc); -this.setContextClass(cc); -this.addLifecycleListener(conf); -this.setDebug(9); -} - -// - PUBLIC METHODS - -public void invoke(Request req, Response res) -throws ServletException, IOException { -if (DEBUG) this.debug(Invoked); -super.invoke(req,res); -} - public Container map(Request request, boolean update) { -if (DEBUG) this.debug(Trying to map request to context); -if (request instanceof WarpRequest) { -WarpRequest r=(WarpRequest)request; - - Container children[]=this.findChildren(); - for (int x=0; xchildren.length; x++) { - if (children[x] instanceof WarpContext) { - WarpContext c=(WarpContext)children[x]; - if (r.getRequestedApplicationID()==c.getApplicationID()) { - ((WarpRequest)request).setContextPath(c.getPath()); - return(children[x]); - } -} -} -} -if (DEBUG) this.debug(Trying to map request to context (std)); -return(super.map(request,update)); -} - -/** - * Add a new context to this host. - */ -public void addChild(Container container) { -if (container instanceof WarpContext) { -WarpContext cont=(WarpContext)container; -cont.setApplicationID(this.applid++); -if (DEBUG) this.debug(Adding context for path \+cont.getName()+ - \ with ID=+cont.getApplicationID()); -
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpPacket.java
pier01/07/19 17:01:19 Modified:catalina/src/share/org/apache/catalina/connector/warp WarpPacket.java Log: New WARP implementation from Jakarta-Tomcat-Connectors Revision ChangesPath 1.6 +171 -53 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpPacket.java Index: WarpPacket.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpPacket.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- WarpPacket.java 2001/01/24 23:10:49 1.5 +++ WarpPacket.java 2001/07/20 00:01:19 1.6 @@ -2,7 +2,7 @@ * * * The Apache Software License, Version 1.1 * * * - * Copyright (c) 1999, 2000 The Apache Software Foundation. * + * Copyright (c) 1999-2001 The Apache Software Foundation. * * All rights reserved.* * * * = * @@ -56,70 +56,188 @@ * = */ package org.apache.catalina.connector.warp; -/** - * - * - * @author a href=mailto:[EMAIL PROTECTED];Pier Fumagalli/a - * @author Copyright copy; 1999, 2000 a href=http://www.apache.org;The - * Apache Software Foundation. - * @version CVS $Id: WarpPacket.java,v 1.5 2001/01/24 23:10:49 pier Exp $ - */ -public class WarpPacket { - -/** The default size. */ -private static final int defaultsize=4096; - -/** The current buffer. */ -private byte buf[]; +import java.io.UnsupportedEncodingException; -/** The current position in the buffer. */ -private int pos; +public class WarpPacket { +/** This packet's data buffer */ +protected byte buffer[]=null; +/** Number of bytes stored in the buffer */ +protected int size=0; + +/* Pointer to the last byte read in the buffer */ +private int pointer=0; +/* Type of this packet */ +private int type=-1; +/* Maximum value for a 16 bit unsigned value (0x0 +1) */ +private static final int MAX_LENGTH=65536; + +/** + * Construct a new WarpPacket instance. + */ public WarpPacket() { super(); -this.buf=new byte[defaultsize]; +this.buffer=new byte[MAX_LENGTH]; this.reset(); } +/** + * Reset this packet. + */ public void reset() { -this.pos=0; -if (this.buf.length(defaultsize1)) this.buf=new byte[defaultsize]; -} - -public void writeShort(int k) { -// Check if we have room -if ((this.pos+2)this.buf.length) { -byte newbuf[]=new byte[this.buf.length+defaultsize]; -System.arraycopy(this.buf,0,newbuf,0,this.pos); -this.buf=newbuf; +this.pointer=0; +this.size=0; +this.type=Constants.TYPE_INVALID; +} + +/** + * Set this packet type. + * + * @param type The type of this packet. + */ +public void setType(int type) { +this.type=type; +} + +/** + * Return the type of this packet. + * + * @return The type of this packet. + */ +public int getType() { +return(this.type); +} + +/** + * Write an unsigned short value (16 bit) in the packet buffer. + * + * @param value The unsigned short value to write. + * @exception IllegalArgumentException If the value is negative or greater + *than 65535. + * @exception ArrayIndexOutOfBoundsException If the packet buffer cannot + *contain the new value. + */ +public void writeUnsignedShort(int value) { +if (value0) +throw new IllegalArgumentException(Negative unsigned short); +if (value65535) +throw new IllegalArgumentException(Unsigned short is too big); + +if ((this.size+2)=MAX_LENGTH) +throw new ArrayIndexOutOfBoundsException(Too much data); + +this.buffer[this.size++]=(byte) ((value8)0x0ff); +this.buffer[this.size++]=(byte) ((value0)0x0ff); +} + +/** + * Write a signed integer value (32 bit) in the packet buffer. + * + * @param value The signed integer value to write. + * @exception ArrayIndexOutOfBoundsException If the packet buffer cannot + *
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpRequest.java
pier01/07/19 17:01:26 Modified:catalina/src/share/org/apache/catalina/connector/warp WarpRequest.java Log: New WARP implementation from Jakarta-Tomcat-Connectors Revision ChangesPath 1.5 +16 -101 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequest.java Index: WarpRequest.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- WarpRequest.java 2001/01/24 23:10:50 1.4 +++ WarpRequest.java 2001/07/20 00:01:26 1.5 @@ -2,7 +2,7 @@ * * * The Apache Software License, Version 1.1 * * * - * Copyright (c) 1999, 2000 The Apache Software Foundation. * + * Copyright (c) 1999-2001 The Apache Software Foundation. * * All rights reserved.* * * * = * @@ -56,108 +56,23 @@ * = */ package org.apache.catalina.connector.warp; +import org.apache.catalina.Context; +import org.apache.catalina.Host; import org.apache.catalina.connector.HttpRequestBase; -/** - * - * - * @author a href=mailto:[EMAIL PROTECTED];Pier Fumagalli/a - * @author Copyright copy; 1999, 2000 a href=http://www.apache.org;The - * Apache Software Foundation. - * @version CVS $Id: WarpRequest.java,v 1.4 2001/01/24 23:10:50 pier Exp $ - */ public class WarpRequest extends HttpRequestBase { - -// -- CONSTANTS - -/** Our debug flag status (Used to compile out debugging information). */ -private static final boolean DEBUG=WarpDebug.DEBUG; - -// LOCAL VARIABLES - -/** The Warp Host ID of this request. */ -private int hostid=-1; -/** The Warp Application ID of this request. */ -private int applid=-1; -/** The Warp Request ID of this request. */ -private int id=-1; -/** The WarpRequestHandler associated with this request. */ -private WarpRequestHandler handler=null; - -// --- BEAN METHODS - -/** - * Return the WarpRequestHandler associated with this request. - */ -protected WarpRequestHandler getWarpRequestHandler() { -return(this.handler); -} - -/** - * Set the WarpRequestHandler associated with this request. - */ -protected void setWarpRequestHandler(WarpRequestHandler handler) { -this.handler=handler; -} - -/** - * Return the Host ID associated with this WarpRequest instance. - */ -protected int getRequestID() { -return(this.id); -} - -/** - * Set the Host ID associated with this WarpRequest instance. - */ -protected void setRequestID(int id) { -if (DEBUG) this.debug(Setting RequestID to +id); -this.id=id; -} - -/** - * Return the Host ID associated with this WarpRequest instance. - */ -protected int getRequestedHostID() { -return(this.hostid); -} - -/** - * Set the Application ID associated with this WarpRequest instance. - */ -protected void setRequestedHostID(int id) { -if (DEBUG) this.debug(Setting request HostID to +id); -this.hostid=id; -} - -/** - * Return the Application ID associated with this WarpRequest instance. - */ -protected int getRequestedApplicationID() { -return(this.applid); -} - -/** - * Set the Host ID associated with this WarpRequest instance. - */ -protected void setRequestedApplicationID(int id) { -if (DEBUG) this.debug(Setting request ApplicationID to +id); -this.applid=id; -} - -// -- DEBUGGING METHODS - -/** - * Dump a debug message. - */ -private void debug(String msg) { -if (DEBUG) WarpDebug.debug(this,msg); -} - -/** - * Dump information for an Exception. - */ -private void debug(Exception exc) { -if (DEBUG) WarpDebug.debug(this,exc); +private Host host=null; +private Context context=null; +
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpRequestHandler.java
pier01/07/19 17:01:32 Modified:catalina/src/share/org/apache/catalina/connector/warp WarpRequestHandler.java Log: New WARP implementation from Jakarta-Tomcat-Connectors Revision ChangesPath 1.8 +125 -126 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequestHandler.java Index: WarpRequestHandler.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequestHandler.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- WarpRequestHandler.java 2001/01/24 23:10:51 1.7 +++ WarpRequestHandler.java 2001/07/20 00:01:32 1.8 @@ -2,7 +2,7 @@ * * * The Apache Software License, Version 1.1 * * * - * Copyright (c) 1999, 2000 The Apache Software Foundation. * + * Copyright (c) 1999-2001 The Apache Software Foundation. * * All rights reserved.* * * * = * @@ -56,139 +56,138 @@ * = */ package org.apache.catalina.connector.warp; +import java.io.File; import java.io.IOException; +import java.net.URL; -/** - * - * - * @author a href=mailto:[EMAIL PROTECTED];Pier Fumagalli/a - * @author Copyright copy; 1999, 2000 a href=http://www.apache.org;The - * Apache Software Foundation. - * @version CVS $Id: WarpRequestHandler.java,v 1.7 2001/01/24 23:10:51 pier Exp $ - */ -public class WarpRequestHandler extends WarpHandler { - -/** The WarpReader associated with this WarpConnectionHandler. */ -private WarpReader reader=new WarpReader(); -/** The WarpPacket used to write data. */ -private WarpPacket packet=new WarpPacket(); -/** Wether we had an error in the request header. */ -private boolean headererr=false; - -/** The WarpRequest object associated with this request handler. */ -protected WarpRequest request=null; -/** The WarpRequest object associated with this request handler. */ -protected WarpResponse response=null; - -/** - * Process a WARP packet. - * br - * This method is the one which will actually perform the operation of - * analyzing the packet and doing whatever needs to be done. - * br - * This method will return true if another packet is expected for this - * RID, or it will return false if this was the last packet for this RID. - * When we return false this handler is unregistered, and the Thread - * started in the init() method is terminated. - * - * @param type The WARP packet type. - * @param buffer The WARP packet payload. - * @return If more packets are expected for this RID, true is returned, - * false if this was the last packet. - */ -public boolean process(int type, byte buffer[]) { -WarpConnector connector=this.getConnector(); -WarpEngine engine=(WarpEngine)connector.getContainer(); -String arg1=null; -String arg2=null; -int valu=-1; - -this.reader.reset(buffer); -this.packet.reset(); -try { -switch (type) { -// The Request method -case WarpConstants.TYP_REQINIT_MET: -arg1=reader.readString(); -if (DEBUG) this.debug(Request Method +arg1); -this.request.setMethod(arg1); -break; - -// The Request URI -case WarpConstants.TYP_REQINIT_URI: -arg1=reader.readString(); -if (DEBUG) this.debug(Request URI +arg1); -this.request.setRequestURI(arg1); -break; - -// The Request query arguments -case WarpConstants.TYP_REQINIT_ARG: -arg1=reader.readString(); -if (DEBUG) this.debug(Request Query Argument +arg1); -this.request.setQueryString(arg1); -break; - -// The Request protocol -case WarpConstants.TYP_REQINIT_PRO: -arg1=reader.readString(); -if (DEBUG) this.debug(Request Protocol +arg1); -this.request.setProtocol(arg1); -break; - -
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpResponse.java
pier01/07/19 17:01:38 Modified:catalina/src/share/org/apache/catalina/connector/warp WarpResponse.java Log: New WARP implementation from Jakarta-Tomcat-Connectors Revision ChangesPath 1.4 +139 -131 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpResponse.java Index: WarpResponse.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpResponse.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- WarpResponse.java 2001/01/24 23:10:51 1.3 +++ WarpResponse.java 2001/07/20 00:01:38 1.4 @@ -2,7 +2,7 @@ * * * The Apache Software License, Version 1.1 * * * - * Copyright (c) 1999, 2000 The Apache Software Foundation. * + * Copyright (c) 1999-2001 The Apache Software Foundation. * * All rights reserved.* * * * = * @@ -56,12 +56,13 @@ * = */ package org.apache.catalina.connector.warp; -import org.apache.catalina.connector.HttpResponseBase; import java.io.IOException; -import java.io.OutputStreamWriter; +import java.io.OutputStream; import java.io.PrintWriter; import java.net.MalformedURLException; import java.net.URL; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; @@ -69,166 +70,173 @@ import java.util.Iterator; import java.util.Locale; import java.util.TimeZone; +import javax.servlet.ServletResponse; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpUtils; +//import javax.servlet.http.HttpUtils; import org.apache.catalina.HttpResponse; import org.apache.catalina.Globals; import org.apache.catalina.Logger; +import org.apache.catalina.connector.HttpResponseBase; import org.apache.catalina.util.CookieTools; import org.apache.catalina.util.RequestUtil; -/** - * - * - * @author a href=mailto:[EMAIL PROTECTED];Pier Fumagalli/a - * @author Copyright copy; 1999, 2000 a href=http://www.apache.org;The - * Apache Software Foundation. - * @version CVS $Id: WarpResponse.java,v 1.3 2001/01/24 23:10:51 pier Exp $ - */ public class WarpResponse extends HttpResponseBase { - -// -- CONSTANTS - -/** Our debug flag status (Used to compile out debugging information). */ -private static final boolean DEBUG=WarpDebug.DEBUG; - -/** The WarpRequestHandler associated with this response. */ -private WarpRequestHandler handler=null; - -/** The WarpPacket used to write data. */ -private WarpPacket packet=new WarpPacket(); +private WarpPacket packet; +private WarpConnection connection; -private boolean committed=false; +public WarpResponse() { +super(); +recycle(); +} -/** - * Return the WarpRequestHandler associated with this response. - */ -protected WarpRequestHandler getWarpRequestHandler() { -return(this.handler); +public void recycle() { +super.recycle(); +this.setStream(new Stream(this)); } -/** - * Set the WarpRequestHandler associated with this response. - */ -protected void setWarpRequestHandler(WarpRequestHandler handler) { -this.handler=handler; +public void setPacket(WarpPacket packet) { +this.packet=packet; +} + +public WarpPacket getPacket() { +return(this.packet); } + +public void setConnection(WarpConnection connection) { +this.connection=connection; +} -public boolean isCommitted() { -return(this.committed); +public WarpConnection getConnection() { +return(this.connection); } +/** + * Send the HTTP response headers, if this has not already occurred. + */ protected void sendHeaders() throws IOException { -if (DEBUG) this.debug(Sending status and headers); - -if (isCommitted()) return; - + if (isCommitted()) return; +if
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpConnectionHandler.java WarpConstants.java WarpContext.java WarpDebug.java WarpEngineMapper.java WarpHandler.java WarpHandlerTable.java WarpInputStream.java WarpOutputStream.java WarpReader.java WarpTable.java
pier01/07/19 17:05:36 Removed: catalina/src/share/org/apache/catalina/connector/warp WarpConnectionHandler.java WarpConstants.java WarpContext.java WarpDebug.java WarpEngineMapper.java WarpHandler.java WarpHandlerTable.java WarpInputStream.java WarpOutputStream.java WarpReader.java WarpTable.java Log: Removed old files.
Re: cvs commit:jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warpWarpConnectionHandler.java WarpConstants.java WarpContext.javaWarpDebug.java WarpEngineMapper.java WarpHandler.javaWarpHandlerTable.java WarpInputStream.java WarpOutputStream.javaWarpReader.java WarpTable.java
[EMAIL PROTECTED] at [EMAIL PROTECTED] wrote: pier01/07/19 17:05:36 Removed: catalina/src/share/org/apache/catalina/connector/warp WarpConnectionHandler.java WarpConstants.java WarpContext.java WarpDebug.java WarpEngineMapper.java WarpHandler.java WarpHandlerTable.java WarpInputStream.java WarpOutputStream.java WarpReader.java WarpTable.java Log: Removed old files. Will start running the watchdog and tomcat tests...
Re: [TC4.0] Disabling debug output...
On Thu, Jul 19, 2001 at 01:43:32PM -0700, Jonathan Reichhold wrote: Actually I've got a thought on how to add in debug messages without recompiling. For a horrible hack say I've got a java class like: //Constants.java public class Constants{ public static boolean isDebug(){return true;} } And in my main code I call: if(Constants.isDebug()) log(someNastyFunction()); But why don't you have two Constants.java of this type: public class Constants { publict static final boolean DEBUG = true; // or false } and: if( Constants.DEBUG ) { log( ... ); } incze
Re: [DOC] INSTALL.txt
Neat! It might be better to split INSTALLATION into two separate sections, one for Windows, one for Unix. HOWTOs work best with fewer conditionals. - A On Tue, Jul 17, 2001 at 08:23:10PM -0400, Rob S. wrote: Along the right line? Used the formatting from the TC4 readme files. Needs some polish. - r
RE: [DOC] INSTALL.txt
Agreed... (re: Win/Unix sections). Is a Mac section worth it? I don't have access to a Mac and haven't the slightest clue how they work =) I also redid the default homepage (ROOT/index.html) but forgot to send a copy home from work =( - r -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 19, 2001 8:40 PM To: [EMAIL PROTECTED] Subject: Re: [DOC] INSTALL.txt Neat! It might be better to split INSTALLATION into two separate sections, one for Windows, one for Unix. HOWTOs work best with fewer conditionals. - A On Tue, Jul 17, 2001 at 08:23:10PM -0400, Rob S. wrote: Along the right line? Used the formatting from the TC4 readme files. Needs some polish. - r
RE: [DOC] INSTALL.txt
I'm going to include this in the beta 6 release tonight, after a couple of tweaks (and a mention of the new Windows-installer based version that Remy has created). Also, we'll need pointers to the RPMs that Henri so graciously creates, and corresponding directions to install them. MacOS X is, AFAIK, similar enough to the other Unixes that it doesn't need a separate section. Craig On Thu, 19 Jul 2001, Rob S. wrote: Agreed... (re: Win/Unix sections). Is a Mac section worth it? I don't have access to a Mac and haven't the slightest clue how they work =) I also redid the default homepage (ROOT/index.html) but forgot to send a copy home from work =( - r -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 19, 2001 8:40 PM To: [EMAIL PROTECTED] Subject: Re: [DOC] INSTALL.txt Neat! It might be better to split INSTALLATION into two separate sections, one for Windows, one for Unix. HOWTOs work best with fewer conditionals. - A On Tue, Jul 17, 2001 at 08:23:10PM -0400, Rob S. wrote: Along the right line? Used the formatting from the TC4 readme files. Needs some polish. - r
Re: cvs commit:jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warpWarpConnectionHandler.java WarpConstants.java WarpContext.javaWarpDebug.java WarpEngineMapper.java WarpHandler.javaWarpHandlerTable.java WarpInputStream.java WarpOutputStream.javaWarpReader.java WarpTable.java
Pier P. Fumagalli at [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] at [EMAIL PROTECTED] wrote: pier01/07/19 17:05:36 Removed: catalina/src/share/org/apache/catalina/connector/warp WarpConnectionHandler.java WarpConstants.java WarpContext.java WarpDebug.java WarpEngineMapper.java WarpHandler.java WarpHandlerTable.java WarpInputStream.java WarpOutputStream.java WarpReader.java WarpTable.java Log: Removed old files. Will start running the watchdog and tomcat tests... Must have done something in the last updates (SHIT!)... It serves one request (perfectly), but the following ones are just headers... DAMN ME! Working on it... (SHIT!) Pier
Re: [DOC] INSTALL.txt
Rob S. at [EMAIL PROTECTED] wrote: Agreed... (re: Win/Unix sections). Is a Mac section worth it? I don't have access to a Mac and haven't the slightest clue how they work =) Mac? Under OS/9 it doesn't work (only Java platform 1 over there)... OS/X is basically a unix box, so, no worries there... Pier
Re: cvs commit:jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warpWarpConnectionHandler.java WarpConstants.java WarpContext.javaWarpDebug.java WarpEngineMapper.java WarpHandler.javaWarpHandlerTable.java WarpInputStream.java WarpOutputStream.javaWarpReader.java WarpTable.java
Pier P. Fumagalli at [EMAIL PROTECTED] wrote: Must have done something in the last updates (SHIT!)... It serves one request (perfectly), but the following ones are just headers... DAMN ME! Working on it... (SHIT!) Ok, now I'm talking to myself, and that's SCARY... The bitch serves all requests I want for my TroubleShoot servlet, I can reload and reload on my browser, and everything comes out so nicely... BUT, HelloWorldExample just goes once... Now, either I'm stupid or I'm stupid... So, I must be definitely stupid. Pier
cvs commit: jakarta-tomcat-connectors/webapp/java WarpConnection.java
pier01/07/19 19:31:07 Modified:webapp/java WarpConnection.java Log: Better debugging output (packet types dumped in HEX) Revision ChangesPath 1.17 +4 -2 jakarta-tomcat-connectors/webapp/java/WarpConnection.java Index: WarpConnection.java === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpConnection.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- WarpConnection.java 2001/07/19 23:37:55 1.16 +++ WarpConnection.java 2001/07/20 02:31:07 1.17 @@ -210,7 +210,8 @@ public void send(WarpPacket packet) throws IOException { if (Constants.DEBUG) { -logger.debug( TYPE=+packet.getType()+ LENGTH=+packet.size); +String typ=Integer.toHexString(packet.getType()); +logger.debug( TYPE=+typ+ LENGTH=+packet.size); logger.debug( +packet.dump()); } @@ -251,7 +252,8 @@ } if (Constants.DEBUG) { -logger.debug( TYPE=+packet.getType()+ LENGTH=+packet.size); +String typ=Integer.toHexString(packet.getType()); +logger.debug( TYPE=+typ+ LENGTH=+packet.size); logger.debug( +packet.dump()); } }
cvs commit: jakarta-tomcat-connectors/webapp/java WarpRequest.java
pier01/07/19 19:32:12 Modified:webapp/java WarpRequest.java Log: Removed private context (which might have caused some troubles). Revision ChangesPath 1.7 +0 -1 jakarta-tomcat-connectors/webapp/java/WarpRequest.java Index: WarpRequest.java === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpRequest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- WarpRequest.java 2001/07/19 23:35:07 1.6 +++ WarpRequest.java 2001/07/20 02:32:12 1.7 @@ -62,7 +62,6 @@ public class WarpRequest extends HttpRequestBase { private Host host=null; -private Context context=null; public WarpRequest() { super();
cvs commit: jakarta-tomcat-connectors/webapp/java WarpRequestHandler.java
pier01/07/19 19:33:52 Modified:webapp/java WarpRequestHandler.java Log: Fixed small bug with content type/length. Now the request and response objects are finished properly. Revision ChangesPath 1.10 +4 -3 jakarta-tomcat-connectors/webapp/java/WarpRequestHandler.java Index: WarpRequestHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpRequestHandler.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- WarpRequestHandler.java 2001/07/19 23:35:26 1.9 +++ WarpRequestHandler.java 2001/07/20 02:33:52 1.10 @@ -132,8 +132,8 @@ if (Constants.DEBUG) logger.debug(Request content type=+ctyp+ length=+ clen); -request.setContentType(ctyp); -request.setContentLength(clen); +if (ctyp.length()0) request.setContentType(ctyp); +if (clen0) request.setContentLength(clen); break; } @@ -172,7 +172,8 @@ } catch (Exception e) { logger.log(e); } -response.getStream().close(); +request.finishRequest(); +response.finishResponse(); if (Constants.DEBUG) logger.debug(Request has been processed); break;
cvs commit: jakarta-tomcat-connectors/webapp/java WarpResponse.java
pier01/07/19 19:34:42 Modified:webapp/java WarpResponse.java Log: Response handles the finishResponse() method correctly, now. The outputStream instance is recycled between requests. Revision ChangesPath 1.6 +97 -17jakarta-tomcat-connectors/webapp/java/WarpResponse.java Index: WarpResponse.java === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpResponse.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- WarpResponse.java 2001/07/19 23:35:56 1.5 +++ WarpResponse.java 2001/07/20 02:34:41 1.6 @@ -84,36 +84,75 @@ import org.apache.catalina.util.RequestUtil; public class WarpResponse extends HttpResponseBase { +/** The local stream */ +private Stream localstream; +/** The packet used for processing headers */ private WarpPacket packet; +/** The connection to which we are associated */ private WarpConnection connection; +/** + * Create a new instance of a codeWarpResponse/code. + */ public WarpResponse() { super(); -recycle(); +// A WarpResponse is _always_ associated with a Stream +this.localstream=new Stream(this); +this.setStream(localstream); } +/** + * Recycle this codeWarpResponse/code instance. + */ public void recycle() { +// Recycle our parent super.recycle(); -this.setStream(new Stream(this)); +// Recycle the stream +this.localstream.recycle(); +// Tell the parent that a stream is already in use. +this.setStream(localstream); } +/** + * Set the codeWarpPacket/code instance used to process headers. + */ public void setPacket(WarpPacket packet) { this.packet=packet; } +/** + * Return the codeWarpPacket/code instance used to process headers. + */ public WarpPacket getPacket() { return(this.packet); } - + +/** + * Associate this codeWarpResponse/code instance with a specific + * codeWarpConnection/code instance. + */ public void setConnection(WarpConnection connection) { this.connection=connection; } +/** + * Return the codeWarpConnection/code associated this instance of + * codeWarpResponse/code. + */ public WarpConnection getConnection() { return(this.connection); } /** + * Flush output and finish. + */ +public void finishResponse() +throws IOException { +super.finishResponse(); +this.localstream.finish(); +} + +/** * Send the HTTP response headers, if this has not already occurred. */ protected void sendHeaders() throws IOException { @@ -205,38 +244,79 @@ committed = true; } - -private class Stream extends OutputStream { -private WarpConnection connection; -private WarpPacket packet; - -private Stream(WarpResponse response) { + +/** + * The codeOutputStream/code that will handle all response body + * transmission. + */ +protected class Stream extends OutputStream { +/** The response associated with this stream instance. */ +private WarpResponse response=null; +/** The packet used by this stream instance. */ +private WarpPacket packet=null; +/** Wether codeclose()/code was called or not. */ +private boolean closed=false; + +/** + * Construct a new instance of a codeWarpResponse.Stream/code + * associated with a parent codeWarpResponse/code. + */ +protected Stream(WarpResponse response) { super(); -this.connection=response.getConnection(); +this.response=response; this.packet=new WarpPacket(); -packet.setType(Constants.TYPE_RES_BODY); } +/** + * Write one byte of data to the codeWarpPacket/code nested + * within this codeWarpResponse.Stream/code. All data is buffered + * until the codeflush()/code or codeclose()/code method is + * not called. + */ public void write(int b) throws IOException { +if (closed) throw new IOException(Stream closed); packet.buffer[packet.size++]=(byte)b; } +/** + * Flush the current packet to the WARP client. + */ public void flush() throws IOException { -this.connection.send(packet); -packet.reset(); +if (closed) throw new
cvs commit: jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes TroubleShooter.java
pier01/07/19 19:36:10 Modified:webapps/examples/WEB-INF/classes TroubleShooter.java Log: Fixed some NullPointerExceptions and display aesthetics. Revision ChangesPath 1.2 +21 -16 jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes/TroubleShooter.java Index: TroubleShooter.java === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes/TroubleShooter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TroubleShooter.java 2001/01/25 00:42:15 1.1 +++ TroubleShooter.java 2001/07/20 02:36:10 1.2 @@ -1,4 +1,4 @@ -/* $Id: TroubleShooter.java,v 1.1 2001/01/25 00:42:15 pier Exp $ +/* $Id: TroubleShooter.java,v 1.2 2001/07/20 02:36:10 pier Exp $ * */ @@ -21,6 +21,9 @@ } public void printValue(PrintWriter out, String key, String val) { +if (val!=null) { +if (val.length()255) val=val.substring(0,128)+ i(... more)/i; +} out.println( tr); out.println(td bgcolor=\#cc\+key+/td); out.println(td bgcolor=\#ff\+val+/td); @@ -160,7 +163,7 @@ printHeader(out,Cookies in this request:); Cookie[] cookies = request.getCookies(); -for (int i = 0; i cookies.length; i++) { +if (cookies!=null) for (int i = 0; i cookies.length; i++) { Cookie cookie = cookies[i]; printValue(out,cookie.getName(),cookie.getValue()); } @@ -181,21 +184,23 @@ printHeader(out,Session information:); SimpleDateFormat format = new SimpleDateFormat(/MM/dd hh:mm:ss.SSS z); -HttpSession session = request.getSession(); +HttpSession session = request.getSession(false); +if (session!=null) { printValue(out,Requested Session Id:, request.getRequestedSessionId()); -printValue(out,Current Session Id:, session.getId()); -printValue(out,Current Time:, format.format(new Date())); -printValue(out,Session Created Time:, format.format(new Date(session.getCreationTime(; -printValue(out,Session Last Accessed Time:, format.format(new Date(session.getLastAccessedTime(; -printValue(out,Session Max Inactive Interval Seconds:, Integer.toString(session.getMaxInactiveInterval())); -printVoid(out); - -printHeader(out,Session values:); -enum = session.getAttributeNames(); -while (enum.hasMoreElements()) { -String key = (String) enum.nextElement(); -Object val = session.getAttribute(key); -printValue(out,key,val.toString()); +printValue(out,Current Session Id:, session.getId()); +printValue(out,Current Time:, format.format(new Date())); +printValue(out,Session Created Time:, format.format(new Date(session.getCreationTime(; +printValue(out,Session Last Accessed Time:, format.format(new Date(session.getLastAccessedTime(; +printValue(out,Session Max Inactive Interval Seconds:, Integer.toString(session.getMaxInactiveInterval())); +printVoid(out); + +printHeader(out,Session values:); +enum = session.getAttributeNames(); +while (enum.hasMoreElements()) { +String key = (String) enum.nextElement(); +Object val = session.getAttribute(key); +printValue(out,key,val.toString()); +} } printVoid(out);
Re: cvs commit: jakarta-tomcat-connectors/webapp/javaWarpResponse.java
[EMAIL PROTECTED] at [EMAIL PROTECTED] wrote: Response handles the finishResponse() method correctly, now. Ok, I admit it, I'm an idiot... :( Pier
cvs commit: jakarta-tomcat/src/etc/jk mod_jk.conf
larryi 01/07/19 19:59:33 Modified:src/etc/jk mod_jk.conf Log: Fix invalid log level. Supported values are debug, info, error, and emerg. Revision ChangesPath 1.2 +1 -1 jakarta-tomcat/src/etc/jk/mod_jk.conf Index: mod_jk.conf === RCS file: /home/cvs/jakarta-tomcat/src/etc/jk/mod_jk.conf,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mod_jk.conf 2000/09/09 23:21:20 1.1 +++ mod_jk.conf 2001/07/20 02:59:33 1.2 @@ -5,7 +5,7 @@ JkWorkersFile fill-path-to/workers.properties JkLogFile logs/jk.log -JkLogLevel warn +JkLogLevel error JkMount /*.jsp ajp12 JkMount /servlet/* ajp12 JkMount /examples/* ajp12
cvs commit: jakarta-tomcat-site/xdocs index.xml
alex01/07/19 19:48:06 Modified:xdocsindex.xml Log: Finish replacing 3.2.1 with 3.2.3 Revision ChangesPath 1.4 +2 -2 jakarta-tomcat-site/xdocs/index.xml Index: index.xml === RCS file: /home/cvs/jakarta-tomcat-site/xdocs/index.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- index.xml 2001/07/17 18:25:09 1.3 +++ index.xml 2001/07/20 02:48:06 1.4 @@ -28,7 +28,7 @@ section name=Tomcat Versions pThere are several versions of Tomcat currently available for download. Version 3.1.1 -is a legacy release. Version 3.2.1 is the current production quality release. Tomcat 3.3 +is a legacy release. Version 3.2.3 is the current production quality release. Tomcat 3.3 is the latest continuation of the Tomcat 3.x architecture. All Tomcat 3.x releases trace their heritage back to the original Servlet and JSP implementations that Sun donated to the Apache Software Foundation. The 3.x versions all implement the @@ -50,7 +50,7 @@ There is no active development ongoing for Tomcat 3.1.x. Users of Tomcat 3.1 should update to 3.1.1 to close the security holes and they are strongly encouraged to migrate to the current production release, Tocmat -3.2.1./p +3.2.3./p pstrongTomcat 3.2.x/strong. Tomcat 3.2.3 is the current production quality release. Version 3.2 added few new features; the major effort was
cvs commit: jakarta-tomcat-site/xdocs index.xml
alex01/07/19 19:49:48 Modified:xdocsindex.xml Log: Tocmat - Tomcat Revision ChangesPath 1.5 +1 -1 jakarta-tomcat-site/xdocs/index.xml Index: index.xml === RCS file: /home/cvs/jakarta-tomcat-site/xdocs/index.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- index.xml 2001/07/20 02:48:06 1.4 +++ index.xml 2001/07/20 02:49:48 1.5 @@ -49,7 +49,7 @@ latest maintenance release, 3.1.1, contained fixes for security problems. There is no active development ongoing for Tomcat 3.1.x. Users of Tomcat 3.1 should update to 3.1.1 to close the security holes and they are -strongly encouraged to migrate to the current production release, Tocmat +strongly encouraged to migrate to the current production release, Tomcat 3.2.3./p pstrongTomcat 3.2.x/strong. Tomcat 3.2.3 is the current production
cvs commit: jakarta-tomcat-4.0/webapps/ROOT index.html
craigmcc01/07/19 20:20:09 Modified:catalina/src/share/org/apache/catalina Globals.java webapps/ROOT index.html Log: Updates for Tomcat 4.0-beta-6 release. Revision ChangesPath 1.29 +5 -5 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java Index: Globals.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- Globals.java 2001/07/17 04:21:12 1.28 +++ Globals.java 2001/07/20 03:20:08 1.29 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java,v 1.28 2001/07/17 04:21:12 craigmcc Exp $ - * $Revision: 1.28 $ - * $Date: 2001/07/17 04:21:12 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java,v 1.29 2001/07/20 03:20:08 craigmcc Exp $ + * $Revision: 1.29 $ + * $Date: 2001/07/20 03:20:08 $ * * * @@ -69,7 +69,7 @@ * Global constants that are applicable to multiple packages within Catalina. * * @author Craig R. McClanahan - * @version $Revision: 1.28 $ $Date: 2001/07/17 04:21:12 $ + * @version $Revision: 1.29 $ $Date: 2001/07/20 03:20:08 $ */ public final class Globals { @@ -210,7 +210,7 @@ /** * The descriptive information about this server and version. */ -public static final String SERVER_INFO = Apache Tomcat/4.0-b6-dev; +public static final String SERVER_INFO = Apache Tomcat/4.0-b6; /** 1.20 +2 -2 jakarta-tomcat-4.0/webapps/ROOT/index.html Index: index.html === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/ROOT/index.html,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- index.html2001/05/15 03:25:48 1.19 +++ index.html2001/07/20 03:20:09 1.20 @@ -4,13 +4,13 @@ meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 meta name=GENERATOR content=Mozilla/4.72 [en] (WinNT; U) [Netscape] meta name=Author content=Anil K. Vijendran -titleTomcat (v4.0-b6-dev)/title +titleTomcat (v4.0-b6)/title /head body bgcolor=#FF img SRC=tomcat.gif height=92 width=130 align=LEFTbfont face=Arial, Helvetica, sans-seriffont size=+3Tomcat/font/font/b br bfont face=Arial, Helvetica, sans-seriffont size=-1Version -4.0-b6-dev/font/font/b +4.0-b6/font/font/b pThis is the default Tomcat home page. This page serves as a quick reference guide to related resources and is located at: ul
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpConnection.java WarpRequest.java WarpRequestHandler.java WarpResponse.java
pier01/07/19 20:25:30 Modified:catalina/src/share/org/apache/catalina/connector/warp WarpConnection.java WarpRequest.java WarpRequestHandler.java WarpResponse.java Log: Reflect changes of JTC into JT4 for Tomcat B6 Revision ChangesPath 1.9 +4 -2 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnection.java Index: WarpConnection.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnection.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- WarpConnection.java 2001/07/20 00:00:53 1.8 +++ WarpConnection.java 2001/07/20 03:25:30 1.9 @@ -210,7 +210,8 @@ public void send(WarpPacket packet) throws IOException { if (Constants.DEBUG) { -logger.debug( TYPE=+packet.getType()+ LENGTH=+packet.size); +String typ=Integer.toHexString(packet.getType()); +logger.debug( TYPE=+typ+ LENGTH=+packet.size); logger.debug( +packet.dump()); } @@ -251,7 +252,8 @@ } if (Constants.DEBUG) { -logger.debug( TYPE=+packet.getType()+ LENGTH=+packet.size); +String typ=Integer.toHexString(packet.getType()); +logger.debug( TYPE=+typ+ LENGTH=+packet.size); logger.debug( +packet.dump()); } } 1.6 +0 -1 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequest.java Index: WarpRequest.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- WarpRequest.java 2001/07/20 00:01:26 1.5 +++ WarpRequest.java 2001/07/20 03:25:30 1.6 @@ -62,7 +62,6 @@ public class WarpRequest extends HttpRequestBase { private Host host=null; -private Context context=null; public WarpRequest() { super(); 1.9 +4 -3 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequestHandler.java Index: WarpRequestHandler.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequestHandler.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- WarpRequestHandler.java 2001/07/20 00:01:32 1.8 +++ WarpRequestHandler.java 2001/07/20 03:25:30 1.9 @@ -132,8 +132,8 @@ if (Constants.DEBUG) logger.debug(Request content type=+ctyp+ length=+ clen); -request.setContentType(ctyp); -request.setContentLength(clen); +if (ctyp.length()0) request.setContentType(ctyp); +if (clen0) request.setContentLength(clen); break; } @@ -172,7 +172,8 @@ } catch (Exception e) { logger.log(e); } -response.getStream().close(); +request.finishRequest(); +response.finishResponse(); if (Constants.DEBUG) logger.debug(Request has been processed); break; 1.5 +97 -17 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpResponse.java Index: WarpResponse.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpResponse.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- WarpResponse.java 2001/07/20 00:01:38 1.4 +++ WarpResponse.java 2001/07/20 03:25:30 1.5 @@ -84,36 +84,75 @@ import org.apache.catalina.util.RequestUtil; public class WarpResponse extends HttpResponseBase { +/** The local stream */ +private Stream localstream; +/** The packet used for processing headers */ private WarpPacket packet; +/** The connection to which we are associated */ private WarpConnection connection; +/** + * Create a new instance of a codeWarpResponse/code. + */ public WarpResponse() { super(); -recycle(); +// A WarpResponse is _always_ associated with a Stream +this.localstream=new Stream(this); +
Re: cvs commit:jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warpWarpConnection.java WarpRequest.java WarpRequestHandler.javaWarpResponse.java
I tagged the webapp portion of j-t-c with the tomcat_40_b6... Night... Pier
cvs commit: jakarta-tomcat/src/admin/WEB-INF/scripts run-test.bat
larryi 01/07/19 20:48:09 Modified:src/admin/WEB-INF/scripts run-test.bat Log: Forgot to remove rem. Call Ant so CLASSPATH setting is restored. Revision ChangesPath 1.2 +2 -2 jakarta-tomcat/src/admin/WEB-INF/scripts/run-test.bat Index: run-test.bat === RCS file: /home/cvs/jakarta-tomcat/src/admin/WEB-INF/scripts/run-test.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- run-test.bat 2001/07/17 13:46:00 1.1 +++ run-test.bat 2001/07/20 03:48:09 1.2 @@ -1,4 +1,4 @@ -rem @echo off +@echo off rem Batch file to run the tomcat sanity test suite rem Note: You may send the output to a file using run-tomcat -l file @@ -24,7 +24,7 @@ set CLASSPATH=%CLASSPATH%;%_OLDCP% :runant -ant -Dgdir=%TOMCAT_HOME%/webapps/test/Golden -f %TOMCAT_HOME%/webapps/test/WEB-INF/test-tomcat.xml %1 %2 %3 %4 %5 %6 %7 %8 %9 client +call ant -Dgdir=%TOMCAT_HOME%/webapps/test/Golden -f %TOMCAT_HOME%/webapps/test/WEB-INF/test-tomcat.xml %1 %2 %3 %4 %5 %6 %7 %8 %9 client set CLASSPATH=%_OLDCP%
cvs commit: jakarta-tomcat/src/tests/webpages/WEB-INF test-tomcat.xml
larryi 01/07/19 21:28:16 Modified:src/tests/webpages/WEB-INF test-tomcat.xml Log: Fix some descriptions Revision ChangesPath 1.38 +15 -15jakarta-tomcat/src/tests/webpages/WEB-INF/test-tomcat.xml Index: test-tomcat.xml === RCS file: /home/cvs/jakarta-tomcat/src/tests/webpages/WEB-INF/test-tomcat.xml,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- test-tomcat.xml 2001/07/18 21:20:06 1.37 +++ test-tomcat.xml 2001/07/20 04:28:16 1.38 @@ -16,7 +16,7 @@ early tests. -- - property name=revision value=$Revision: 1.37 $ / + property name=revision value=$Revision: 1.38 $ / property name=host value=127.0.0.1 / property name=port value=8080 / property name=outputType value=text / @@ -1220,12 +1220,12 @@ returnCode=${http.protocol} 404 / - gtest description=This URL should return 404 Not Found + gtest description=This URL should return 403 Forbidden request=GET /test/jsp/HelloWorld.jsp%2E HTTP/1.0 returnCode=${http.protocol} 403 / - gtest description=This URL should return 404 Not Found + gtest description=This URL should return 403 Forbidden request=GET /test/jsp/HelloWorld.jsp%252E HTTP/1.0 returnCode=${http.protocol} 403 / @@ -1235,12 +1235,12 @@ returnCode=${http.protocol} 404 / - gtest description=This URL should return 404 Not Found + gtest description=This URL should return 403 Forbidden request=GET /test/jsp/HelloWorld.jsp%5C HTTP/1.0 returnCode=${http.protocol} 403 / - gtest description=This URL should return 404 Not Found + gtest description=This URL should return 403 Forbidden request=GET /test/jsp/HelloWorld.jsp%255C HTTP/1.0 returnCode=${http.protocol} 403 / @@ -1250,7 +1250,7 @@ returnCode=${http.protocol} 404 / - gtest description=This URL should return 404 Not Found + gtest description=This URL should return 403 Forbidden request=GET /test/jsp/HelloWorld.jsp%2520 HTTP/1.0 returnCode=${http.protocol} 403 / @@ -1260,31 +1260,31 @@ returnCode=${http.protocol} 404 / - gtest description=This URL should return 404 Not Found + gtest description=This URL should return 403 Forbidden request=GET /%2e%2e/%2e%2e/%00.jsp HTTP/1.0 returnCode=${http.protocol} 403 / - gtest description=This URL should return 404 Not Found + gtest description=This URL should return 403 Forbidden request=GET /%252e%252e/%252e%252e/%00.jsp HTTP/1.0 returnCode=${http.protocol} 403 / - gtest description=This URL should return 404 Not Found + gtest description=This URL should return 403 Forbidden request=GET /%2e%2e/%2e%2e/%5cLICENSE%00.jsp HTTP/1.0 returnCode=${http.protocol} 403 / - gtest description=This URL should return 404 Not Found + gtest description=This URL should return 403 Forbidden request=GET /%2e%2e/%2e%2e/%5cLICENSE/%00.jsp HTTP/1.0 returnCode=${http.protocol} 403 / - gtest description=This URL should return 404 Not Found + gtest description=This URL should return 403 Forbidden request=GET /%252e%252e/%252e%252e/%5cLICENSE%00.jsp HTTP/1.0 returnCode=${http.protocol} 403 / - gtest description=This URL should return 404 Not Found + gtest description=This URL should return 403 Forbidden request=GET /%252e%252e/%252e%252e/%5cLICENSE/%00.jsp HTTP/1.0 returnCode=${http.protocol} 403 / @@ -1295,16 +1295,16 @@ goldenFile=${gdir}/HelloWorld.txt / - gtest description=This URL should return 404 Not Found + gtest description=This URL should return 403 Forbidden request=GET /test/jsp/HelloWorld.js%2570 HTTP/1.0 returnCode=${http.protocol} 403 / - gtest description=This URL should return HTML, not JSP source + gtest description=This URL should return 403 Forbidden request=GET /test/jsp/HelloWorld%2Ejsp HTTP/1.0 returnCode=${http.protocol} 403 / - gtest description=This URL should return 404 Not Found + gtest description=This URL should return 403 Forbidden request=GET /test/jsp/HelloWorld%252Ejsp HTTP/1.0 returnCode=${http.protocol} 403 /
Re: [TC4] jakarta-regexp.jar
on 7/19/01 7:08 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: P.S. I'd like to propose that jakarta-regexp project name all their jars jakarta-regexp.jar no matter what version they are. This doesn't affect the decision here. -1 Until we have a CJAN, I like version numbers on jar files. The problem you are having can be easily resolved by simply editing your local jakarta-turbine-4.0/build.properties or your ${user.home}/build.properties -jon
Re: [TC4] jakarta-regexp.jar
On Thu, 19 Jul 2001 [EMAIL PROTECTED] wrote: Do you have a position on including a jakarta-regexp.jar (or a jakarta-regexp-1.2.jar or a jakarta-regexp-1.3-dev.jar) directly in jakarta-tomcat-4.0/lib so we can build it without synching and building jakarta-regexp? I'm positive Jon will be +1 for this :-), but I'm very -1 for reasons that have been discussed at length on this and other lists in the past. Storing JAR files is evil, because it creates dependencies on those particular versions of the JAR files and you cannot reliably recreate a release purely from sources. Once I get the beta 6 release out (the release notes will tell you how busy we've been :-), I will focus on cleaning up the build processes and docs for jakarta-tomcat-4.0 and jakarta-servletapi-4, and initiating conversations about what to do with jakarta-tomcat-connectors code that is included in a Tomcat release. Likewise for servlet.jar / jakarta-servletapi-4. Note that the project already contains an ant.jar and a jaxp.jar and crimson.jar, and that works just fine :-) Tomcat 4 doesn't have an ant.jar. And the only reason it has jaxp.jar and crimson.jar is because the stupid actual release has sealed JARs, which *totally* screws up class loading. As soon as there's a JAXP release that removes this restriction, these files are gone. The problem you are having can be easily resolved by simply editing your local jakarta-turbine-4.0/build.properties or your ${user.home}/build.properties Yeah, mine and everyone else's in the world who wants to build it. One less step is one less step that can go wrong. Actually, Jon's suggestion is the right answer. Developers working from source should have *absolute* control over which versions of dependent software they build with. -- Alex Chaffee mailto:[EMAIL PROTECTED] Craig McClanahan
cvs commit: jakarta-tomcat-4.0 INSTALL.txt
craigmcc01/07/19 23:12:33 Added: .INSTALL.txt Log: Add Rob's installation instructions, tweaked just a little bit. Revision ChangesPath 1.1 jakarta-tomcat-4.0/INSTALL.txt Index: INSTALL.txt === Apache Tomcat Version 4.0 Beta 6 Install Guide = $Id: INSTALL.txt,v 1.1 2001/07/20 06:12:33 craigmcc Exp $ INTRODUCTION: Welcome! This document explains how to perform a stand-alone installation of the Tomcat 4.0 servlet container. Once you're up and running, you will have access to the more detailed documentation locally via Tomcat's default home page, as well as administrative and sample applications. As well, the documentation is available locally at: $CATALINA_HOME/webapps/docs/index.html where $CATALINA_HOME is the root of the directory you extracted the Tomcat files to. The absolute latest version of the documentation is always available online at the following URL: http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html Because the documentation released with each version of Tomcat is the latest as of that release, there is a good chance the online documentation will be slightly updated. NOTE: It is STRONGLY reccomended that you complete this minimal, stand-alone installation before continuing on to more advanced topics. === DOWNLOADING: === In the rare occasion that you find yourself reading this file without a copy of Tomcat 4 to install, you can obtain the latest version here http://jakarta.apache.org/site/binindex.html NEW FEATURE NOTE! Tomcat 4.0-beta-6 includes a new, experimental, installer for the Windows platform. Simply download and execute the jakarta-tomcat-4.0-b6.exe file from the release directory pointed at by the above link. As an alternative, you can install Tomcat 4.0-beta-6 manually from the ZIP file download, in the manner described below. == INSTALLING: == Fortunately, installing the Tomcat servlet container consists of a few, easy steps: extract the archive, and set environment variables. Of course, since Tomcat is written in Java, it is assumed that you have installed at least version 1.2 of the JDK. You can download the JDK from Sun at the following URL http://java.sun.com/j2se/ Version 1.3.1 (or later) of the JDK is recommended. 1) Unpack the files You've most likely completed this step already =) Lets say that for installation (A), you're on a Windows machine and you've unpacked the files to C:\jakarta-tomcat-4.0. You can use a tool like WinZip or pkunzip command-line version. Or for installation (B) on a *nix machine, you've unpacked it to /usr/local/jakarta-tomcat-4.0 cd /usr/local mv tomcat-download-file /usr/local tar xzvf jakarta-tomcat-4.0-br.tar.gz OR uncompress jakarta-tomcat-4.0-br.tar.Z tar xvf jakarta-tomcat-4.0-br.tar 2) Set your environment variables Tomcat 4 requires 2 environment variables: CATALINA_HOME and JAVA_HOME. CATALINA_HOME should be set to the root of your Tomcat installation, and JAVA_HOME should be set to the root of your JDK installation. For the Win9X-series of operating systems, add the following lines to your C:\AUTOEXEC.BAT file: SET CATALINA_HOME=C:\jakarta-tomcat-4.0 SET JAVA_HOME=C:\jdk1.3.1 In WinNT-based systems, you modify environment variables by first right- clicking on the My Computer icon, and then Properties. You can either add these as System or User Environment variables. For *nix systems, export CATALINA_HOME=/usr/local/jakarta-tomcat-4.0 export JAVA_HOME=/usr/local/jdk1.3 This should either be done in a startup script or /etc/profile to make it system-wide. Preferably a startup script so the variables are available on Tomcat so it can start on boot if required. 3) Start it To start the container, execute the script appropriate to your operating system. The startup and shutdown scripts are named appropriately, and found in $CATALINA_HOME/bin. For *nix, that will be the scripts ending with the sh extension, and for Windows, bat. For Win9X, cd %CATALINA_HOME%\bin startup.bat For *nix, cd $CATALINA_HOME/bin ./startup.sh 4) Test it Fire up your web browser, and request http://localhost:8080/ ...and you should be presented
Re: [TC4] jakarta-regexp.jar
On Thu, Jul 19, 2001 at 10:58:21PM -0700, Craig R. McClanahan wrote: On Thu, 19 Jul 2001 [EMAIL PROTECTED] wrote: Do you have a position on including a jakarta-regexp.jar (or a jakarta-regexp-1.2.jar or a jakarta-regexp-1.3-dev.jar) directly in jakarta-tomcat-4.0/lib so we can build it without synching and building jakarta-regexp? I'm positive Jon will be +1 for this :-), but I'm very -1 for reasons that have been discussed at length on this and other lists in the past. Storing JAR files is evil, because it creates dependencies on those particular versions of the JAR files and you cannot reliably recreate a release purely from sources. The dependencies are already there, and always will be. The only difference is that at present, the actual jars can slip out from under you at any time (which actually just happened to me -- while you weren't looking, jakarta-regexp changed the name of their jar file which broke your build). As for building from pure source, that argument is a lot less compelling when your object code is platform-independent Java. Sure, it made sense not to depend on statically linked OS-specific object code, but I can't think of a good reason not to depend on a JAR. It's no worse than depending on a GIF. Likewise for servlet.jar / jakarta-servletapi-4. Note that the project already contains an ant.jar and a jaxp.jar and crimson.jar, and that works just fine :-) Tomcat 4 doesn't have an ant.jar. My mistake. And the only reason it has jaxp.jar and crimson.jar is because the stupid actual release has sealed JARs, which *totally* screws up class loading. As soon as there's a JAXP release that removes this restriction, these files are gone. And as soon as someone screws up JAXP again, it'll break again, and require a bugfix release of the *source* of Catalina just to allow it to build. Or what about the developer who's installed an incompatible JAXP wasting his time and the list's bandwidth when it could have been averted by shipping the version of JAXP on which Catalina is dependent... (That's until JAXP is core and stable and works, none of which are actually true yet, AFAIK.) The problem you are having can be easily resolved by simply editing your local jakarta-turbine-4.0/build.properties or your ${user.home}/build.properties Yeah, mine and everyone else's in the world who wants to build it. One less step is one less step that can go wrong. Actually, Jon's suggestion is the right answer. Developers working from source should have *absolute* control over which versions of dependent software they build with. My solution doesn't prevent you from overriding the checked-in version with one of your own. I was thinking more that out of the box, it would work, but that if you have your own jar you can edit build.properties and retain *absolute* control. But until you need to do that, there's less to set up before running build. That is... One less step is one less step that can go wrong. :-) -- Alex Chaffee mailto:[EMAIL PROTECTED] jGuru - Java News and FAQs http://www.jguru.com/alex/ Creator of Gamelan http://www.gamelan.com/ Founder of Purple Technology http://www.purpletech.com/ Curator of Stinky Art Collective http://www.stinky.com/
cvs commit: jakarta-tomcat-4.0 RELEASE-NOTES-4.0-B6.txt
craigmcc01/07/19 23:13:49 Modified:.RELEASE-NOTES-4.0-B6.txt Log: Remove redundant note from the release notes. Revision ChangesPath 1.3 +372 -18 jakarta-tomcat-4.0/RELEASE-NOTES-4.0-B6.txt Index: RELEASE-NOTES-4.0-B6.txt === RCS file: /home/cvs/jakarta-tomcat-4.0/RELEASE-NOTES-4.0-B6.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- RELEASE-NOTES-4.0-B6.txt 2001/06/22 20:31:25 1.2 +++ RELEASE-NOTES-4.0-B6.txt 2001/07/20 06:13:49 1.3 @@ -3,7 +3,7 @@ Release Notes = -$Id: RELEASE-NOTES-4.0-B6.txt,v 1.2 2001/06/22 20:31:25 glenn Exp $ +$Id: RELEASE-NOTES-4.0-B6.txt,v 1.3 2001/07/20 06:13:49 craigmcc Exp $ @@ -22,6 +22,13 @@ Please report bugs and feature requests under product name Tomcat 4. + SECURITY NOTE: This version of Tomcat fixes a security vulnerability + that was first reported on July 16, 2001, related to unnormalized request + URI paths bypassing security constraints defined in the web application + deployment descriptor. Users who rely on container managed security are + *strongly* urged to update to this release of Tomcat 4.0. + + UPCOMING CHANGE NOTICE: In a future beta release of Tomcat 4.0, it is likely that the default operational mode will be to run Tomcat under a security manager (rather than the current default of not @@ -40,23 +47,118 @@ + +General New Features: + + +Tomcat 4.0-beta-6 includes a new, experimental, installer for the Windows +platform. This installer operates in a manner similar to installers for other +applications on Windows, and also lets you install support for executing +Tomcat as a Service under Windows NT. This version of the download is packaged +as a .exe file, and contains the same contents as a standard Tomcat binary +distribution. Please try this new installer out and give us your feedback. +-- NOTE: A known issue with this capability is that stopping Tomcat +-- service can take so long that it fails and logs an error in the +-- NT event log. The solution to this problem will be to make the +-- server shutdown time shorter so that the timeout is not exceeded. + +Tomcat 4.0-beta-6 now includes an updated version of the Java side of the +MOD_WEBAPP connector, used to run Tomcat behind Apache. Binary versions of +the MOD_WEBAPP connector for various platforms will be published (in the same +directory where you downloaded Tomcat-4.0-beta-6 shortly). + +Catalina and Jasper now utilize copies of the web application deployment +descriptor and tag library descriptor from the servlet.jar file that is +included (generated from the jakarta-servletapi-4 repository) instead of +including their own copies. This avoids the risk of having Tomcat use versions +of the DTDs that are out of synchronization with the servlet API classes. + +Updated the build process to make it easier to build Tomcat 4.0 from the +source distribution. Rather than requiring environment variables to be +created, the new scheme allows the use of build.properties files (in either +the Tomcat source directory or the user home directory) to define property +values. You can use all standard Ant property replacement expressions in +these definitions. As a result, the build.bat and build.sh scripts are +no longer necessary; simply run the ant command directly. See the install +instructions for more information. + +The build scripts have been enhanced to support the compilation and execution +of unit tests for the JUnit unit testing framework http://www.junit.org. +A small set of initial tests have been checked in to illustrate the use of +this new feature. + + - Catalina New Features: - +Catalina is now in conformance to the requirements of the Servlet 2.3 +Proposed Final Draft 3 Specification, available at: + http://java.sun.com/products/servlet/download.html + Created a new Java SecurityManager permission called JndiPermission for use in setting security policy for file based JNDI named resources. +Started creating developer-oriented documentation for Catalina in an XML +format that should be compatible with whatever presentation technology +that we select. Initial effort is to create functional specification +documents that capture the functionality of the default file-serving +servlet, the invoker servlet that handles anonymous servlet requests +(/servlet/*), JDBCRealm, and JNDIRealm. + +You can now optionally specify that DNS lookups should be performed when an +application servlet calls request.getRemoteHost(). To