Re: Catalina and log4j
At 23:04 21.04.2001 -0500, you wrote: Ceki Glc wrote: One important point to remember is that each webapp classloader could load a fresh copy of log4j so that each webapp has its own logging universe. This would significantly increase the memory footprint required for logging in the JVM. I would prefer that log4j be global. Right, but it is not our choice to make. The user (i.e. the servlet developer) *can* choose to load a fresh copy per webapp although this is not at all mandatory. It is the users prerogative, a bit like the XML parser I guess. Cheers, Ceki
RE: 3.2.2b3 mod_jk gets stuck in readFully
After quite a bit of struggle, I think I found out what is going on. The problem is that the default configuration of Tomcat does not have enough threads in its thread pool for the default configuration of Apache. This issue would only be apparent if many Apache children were in use. The result was that any Apache children over the number of Tomcat threads would hang waiting for Tomcat to respond to requests. Tomcat would not respond until threads became available, which could be quite a long time if Apache children were not dying off (ie, because load was increasing during the day). I was wrong about the threads being stuck in readFully. The real problem is that not enough threads existed at all (ie, the thread handling socket accept would be blocked). The simplest workaround is to change the AJP13 connector to SimpleTcpConnector rather than PoolTcpConnector in server.xml. I strongly suggest that thread pool exhaustion emit a log message, since this was quite difficult to track down. Additionally, it would be better for the default configuration to be more robust. Bill --- Marc Saegesser [EMAIL PROTECTED] wrote: I finally got some time to look at this and I think I can duplicate the problem your seeing. Hopefully, its the problem your seeing, or else we have two serious problems. __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Re: Catalina and log4j
My two cents as a Log4J User. I use Log4J in my servlets and I think it great. Logging has never been so easy. One issue though, the Configurator class holds it data in a Static variable so two servlets inside the same JVM will each over write the others config. Even since I implemented Log4J I was worried that my servlets may not play well with others when trying to deploy at an ISP. Also will you be able to support one Servlet using a PropertyConfigurastion as opposed to a XMLConfigurator. A word to the wise, one of our biggest hurdles was where or when to use each level. i.e. Debug,Info,warn.. It is easy to always use Info or Debug which defeats the purpose of separate levels. We had to create a standards document that defined where to implement each. It was surprising how often I need to look at the document to make the right choice. Regards John G Ceki Glc wrote: Hello, I am toying with the idea of migrating catalina logging to log4j. Let me begin by saying that I am far from being familiar with catalina internals but I am getting there slowly. After a short initial study and some experimentation, here are some tentative conclusions: 1) The way logging is done currently in catalina is not optimal or, in plain English, sucks. Like most project using their own logging API, there are real benefits in using a more specialized package like log4j instead of the home-brewed solution. More on this below. 2) Since catalina uses its own class loader, it would be possible to have catalina use log4j for logging without affecting other parts of Tomcat. This is probably not entirely true since Tomcat uses a logging hierarchy. I'll ignore this issue for the time being until I understand the implications. More importantly, existing servelets using log4j will be unaffected because they will be using a classloader in a different branch of the cl-tree. Benefits of the move to log4j would be: - No more need to do if(debug 1) log("Some message"); instead one would write log.debug("Some message"); where log is an instance of org.apache.log4j.Category. - No more need to have a log() method in each catelina class, as in private static void log(String message) { System.out.print("Bootstrap: "); System.out.println(message); } in Bootstrap.java. Log4j would use the category name to identify the source of the log statement. - Instead of try { } catch (IOException e) { System.out.println("Cannot create URL for " + filenames[i]); e.printStackTrace(System.out); } one would write try { } catch (IOException e) { log.error("Cannot create URL for " + filenames[i], e); } One advantage is that the code becomes shorter. More importantly, the error can be reported to any defined log4j appender attached to "log" category instance not just to System.out. - The user would configure logging in Tomcat using a separate configuration file, simplifying the actual Tomcat configuration. I am assuming that the DTD for sevlet.xml is not part of the Servlet spec so it can be modified without fear of contradicting the spec. Anyway, I am still studying the problem but it looks pretty encouraging for the moment. Your comments are welcome. Ceki -- Ceki Glc -- -- John Gentilin Eye Catching Solutions Inc. 18314 Carlwyn Drive Castro Valley CA 94546 Contact Info [EMAIL PROTECTED] Phone 1-510-881-4821 --
Re: Catalina and log4j
At 21:40 21.04.2001 -0700, you wrote: On Sat, 21 Apr 2001, Glenn Nielsen wrote: Ceki Glc wrote: One important point to remember is that each webapp classloader could load a fresh copy of log4j so that each webapp has its own logging universe. This would significantly increase the memory footprint required for logging in the JVM. I would prefer that log4j be global. Log4J is nothing compared to having multiple XML parsers in memory :-) Actually, it is technically feasible to do this either way -- if you put the Log4J JAR file in common/lib instead of server/lib it becomes available to the webapps as well. The disadvantage is that the static variables really are global instead of once per web app (which they would be if each webapp installed its own copy), so they would share the same set of Log4J categories, appenders, and so on. One of the reasons for adding multiple-hierarchy support to log4j was to allow each webapp or virtual host to support logging independently of other webapps or virtual hosts. Given that each webapp has its own classloader AFAIK there is no need to use a custom hierarchy which is significantly more difficult to manage than the default hierarchy. So the support for multiple hierarchies is there but perhaps not needed, at least not for the logging done by the webapps. Ceki
Re: Catalina and log4j
At 20:02 21.04.2001 -0700, you wrote: Since I had so shamelessly copied Craig's Services model out of Catalina to use it in another project that never made it, I actually have some experience with this. I had really appreciated the logging in the Catalina framework, because it was always there, and it was configurable per component. My cohort converted the whole thing to use Log4J in two days, and I was even happier after that. We had started with the retrofitting solution, but it was easier in the end to define a standard way to get the Category, and then cut and paste that code everywhere we needed it. So, I would say go for the whole hog, as it is not very hard ;-) I'd even offer to help ;-) Excellent.
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util/threads Reaper.java
costin 01/04/21 22:39:54 Modified:src/share/org/apache/tomcat/util/threads Reaper.java Log: Small fix - use interrupt to stop the reaper from sleeping. Revision ChangesPath 1.4 +5 -2 jakarta-tomcat/src/share/org/apache/tomcat/util/threads/Reaper.java Index: Reaper.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/threads/Reaper.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Reaper.java 2000/10/27 02:44:58 1.3 +++ Reaper.java 2001/04/22 05:39:53 1.4 @@ -122,18 +122,20 @@ public synchronized void stopReaper() { running=false; - this.notify(); + System.out.println("Stop reaper "); + this.interrupt(); // notify() doesn't stop sleep } public void run() { while (running) { + if( !running) break; try { this.sleep(interval); } catch (InterruptedException ie) { // sometimes will happen } - if( !running) return; + if( !running) break; for( int i=0; i count; i++ ) { ThreadPoolRunnable callB=cbacks[i]; // it may be null if a callback is removed. @@ -141,6 +143,7 @@ if( callB!= null ) { callB.runIt( tdata[i] ); } + if( !running) break; } } }
Re: Catalina and log4j
On Sat, 21 Apr 2001, Glenn Nielsen wrote: Ceki, This is welcome news! It isn't clear to me whether the standard servlet API logging methods could use log4j behind the scense to do logging. This would be very nice, especially if you could configure log4j logging for each scope (Engine, Host, DefaultContext, Context) in server.xml. And even configure different destinations for different types of message levels. Whatever logging mechanism is used by org.apache.catalina.core.ApplicationContext *is* the implementation of the servlet API logging methods. Right now, it defers to the Logger of the corresponding Context, but that would be easy to change if we wanted to forcibly separate application-generated messages from Catalina-generated messages. On the other hand, I've found that having the two message streams be intermixed can be useful as well - it would be nice to have it either way. Regards, Glenn Craig
Re: Catalina and log4j
At 17:45 21.04.2001 -0700, you wrote: My two cents as a Log4J User. I use Log4J in my servlets and I think it great. Logging has never been so easy. One issue though, the Configurator class holds it data in a Static variable so two servlets inside the same JVM will each over write the others config. Even since I implemented Log4J I was worried that my servlets may not play well with others when trying to deploy at an ISP. John, As far as I know, the PropertyConfigurator and the DOMConfigurator do not hold any static info. You are free to use them as many times as you want. By default, the log4j configurators act on the default hierarchy although it is possible to specify a custom hierarchy. Having said that, if you configure the same hierarchy multiple times, then each reconfiguration will be merged with the existing configuration. This is known to confuse people but it offers real advantages. If that is not the behavior that you desire, then you can call h.resetConfiguration(), for some hierarchy object h, before reconfiguring. Similarly, use Category.getDefaultHierarchy().resetConfiguration() for resetting the default hierarchy before reconfiguring. Also will you be able to support one Servlet using a PropertyConfigurastion as opposed to a XMLConfigurator. Mixing configurators is not a problem. A word to the wise, one of our biggest hurdles was where or when to use each level. i.e. Debug,Info,warn.. It is easy to always use Info or Debug which defeats the purpose of separate levels. We had to create a standards document that defined where to implement each. It was surprising how often I need to look at the document to make the right choice. Log4j has a rather limited set of priorities specifically to avoid the sort confusion you describe. One of the most important lessons I learned during my formal engineering education was to avoid functionality that could not be clearly understood by a competent audience. My hereto assumption was that DEBUG, INFO, WARN, ERROR and FATAL was the largest set of priorities with no possible confusion. You seem to think otherwise. I would be very interested in peeking at your standards document and perhaps include it in the log4j distribution with your permission of course. TIA, Ceki
cvs commit: jakarta-tomcat/src/shell tomcat.sh
costin 01/04/22 08:52:12 Modified:src/shell tomcat.sh Log: Fix for #232, thanks [EMAIL PROTECTED] (Mark Norman) for the report and fix. Submitted by: [EMAIL PROTECTED] (Mark Norman) Revision ChangesPath 1.23 +10 -2 jakarta-tomcat/src/shell/tomcat.sh Index: tomcat.sh === RCS file: /home/cvs/jakarta-tomcat/src/shell/tomcat.sh,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- tomcat.sh 2001/03/21 06:41:36 1.22 +++ tomcat.sh 2001/04/22 15:52:11 1.23 @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: tomcat.sh,v 1.22 2001/03/21 06:41:36 costin Exp $ +# $Id: tomcat.sh,v 1.23 2001/04/22 15:52:11 costin Exp $ # Shell script to start and stop the server @@ -123,7 +123,15 @@ # We start the server up in the background for a couple of reasons: # 1) It frees up your command window # 2) You should use `stop` option instead of ^C to bring down the server -if [ "$1" = "start" ] ; then +if [ "$1" = "start_msg" ]; then + shift + echo "Starting Tomcat Servlet Engine" + +elif [ "$1" = "stop_msg" ]; then + shift + echo "Stopping Tomcat Servlet Engine" + +elif [ "$1" = "start" ] ; then shift #Old code for -security: -Djava.security.manager -Djava.security.policy==${TOMCAT_HOME}/conf/tomcat.policy
Re: [VOTE] New Committer: Bip Thelin
- Original Message - From: "Kief Morris" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, April 22, 2001 2:22 AM Subject: [VOTE] New Committer: Bip Thelin I would like to propose Bip Thelin as a new committer. He has made a number of contributions of patches over the past several months, including SSI and JDBCRealm, and most recently, is doing solid work on session persistence. +1. Remy
Re: Access log files in the style of Apache
Hi Jochen, Thank you for this patch - it is something very needed. I don't think this can make it for 3.2.2 release ( but it can be made available for people to compile as a separate module), but it'll be available for 3.3 ( I hope in the default distribution - but we do have the option of making it a module ). Please send the source file - you attached a .class :-) 1.) I did not find support for something similar in TomCat 3.2.1. I may be wrong, though. Did I miss something? Or is there something comparable in later versions? No, there isn't ( but 4.0 has a very similar thing ). ( we expect tc3 to be used with apache - and use apache logging facility. Standalone use as a server is not the main target for TC3 ) 2.) Is a RequestInterceptor the appropriate place to implement request logs? Any other suggestions? Yes. In 3.3 there is only one class - BaseInterceptor - that combines all server hooks. 3.) Apache httpd access logs contain an part "first line of the request", typically something like GET /index.html HTTP/1.0 I did rebuild this functionality using getMethod(), getRequestURI(), getQueryString() and getProtocol() from the HttpServletRequest interface. IMO it should be done in another way. Any suggestions? I'll take a look. 4.) If the answer to 1.) is no: Would this file be accepted as a submission, after whatever changes, of course? +1 for 3.3, +1 for checking the code in for 3.2 ( but not enable it be default ) - it can't hurt in any way code stability. ( but it's Marc's call ) Costin
Bugs 500
Hi, I finished reviewing bugs marked as LATER with ID500. There are 5 bugs that we should fix for 3.3: 345 - Date header 348 - Security roles 375 - // security checking - revert to paranoid path checks 454 - mod_jk spawning (hunged ) apache processes when tomcat is down ( maybe later - tomcat should be running or be restart ) 486 - rusian in jsp @include There are 8 jasper bugs I think we should leave open, I wouldn't change jasper before refactoring: 75 - translation time attrs 105 - custom tag attrs 143 - tag handlers 360 - jsp:include expressions 366 - doAfterBody if no body 376 - Jsp error messages in some cases ( no setter ) 387 - special tokens in tag name ( extend to jsp files ) 412 - JSPC and \ paths ( it may be easy to fix ) 4 bugs are fixed in 3.3, we should close them: 149 - log, fixed 295 - config generation, fixed 296 - "can't happen", fixed 485 - cookies, fixed Also, 4 bugs I don't think we'll cover in 3.3: 166 - spaces on nt ( has workarounds ) 962 - redirect sys out, err; config in server.xml, rotate ( RFE ) 471 - mod_jk and spaces in dir name on windows ( has workarounds ) 112 - BAT script on windows - bin/ as default Costin
RE: 3.2.2b3 mod_jk gets stuck in readFully
If 100 is a constraint for the pool size, it should be stated in the Tomcat User's manual, since there it is explained how to increase the pool, but no max is given. I observed Exceptions when using more than 100 threads in the pool, coming from one or two arrays which have fixed size 100 in the tomcat code. I could not reproduce these errors after I updated from 3.2 to 3.2.2 and to 3.3. Is there a reason, why I could stably use a bigger pool with these version? I put 240 concurrent requests on apache. Which was the apache version you used, when the hang problem occured? At 16:47 22.04.01 , you wrote: Two things. First, the other problem that I was seeing turned out to be an Apache problem. I switched to Apache 1.3.19 and my thread hang problems went away. That problem seemed to be a synchronization thing that occurred if requests showed up too close together. As for the thread pool stuff. By default, Tomcat 3.2.x thread pools create 10 threads. This can be changed using the min_spare_threads parameter. The pools will grow as needed up to the maximum number of threads allowed (100, by default). You can increase the maximum number of allowed threads using the max_threads parameter. See if this fixes your problem better than using SimpleTcpConnector. -Original Message- From: Pogo Com [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 21, 2001 5:39 PM To: Marc Saegesser; [EMAIL PROTECTED] Subject: RE: 3.2.2b3 mod_jk gets stuck in readFully After quite a bit of struggle, I think I found out what is going on. The problem is that the default configuration of Tomcat does not have enough threads in its thread pool for the default configuration of Apache. This issue would only be apparent if many Apache children were in use. The result was that any Apache children over the number of Tomcat threads would hang waiting for Tomcat to respond to requests. Tomcat would not respond until threads became available, which could be quite a long time if Apache children were not dying off (ie, because load was increasing during the day). I was wrong about the threads being stuck in readFully. The real problem is that not enough threads existed at all (ie, the thread handling socket accept would be blocked). The simplest workaround is to change the AJP13 connector to SimpleTcpConnector rather than PoolTcpConnector in server.xml. I strongly suggest that thread pool exhaustion emit a log message, since this was quite difficult to track down. Additionally, it would be better for the default configuration to be more robust. Bill --- Marc Saegesser [EMAIL PROTECTED] wrote: I finally got some time to look at this and I think I can duplicate the problem your seeing. Hopefully, its the problem your seeing, or else we have two serious problems. __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Re: Slashdot article
on 4/22/01 1:09 AM, "Kief Morris" [EMAIL PROTECTED] wrote: There's an article on Slashdot about Tomcat. The reader comments show that we've got a PR hill to climb. http://slashdot.org/article.pl?sid=01/04/21/1433254 The number of dissatisfied users is astounding. I especially thought this one was funny: http://slashdot.org/comments.pl?sid=01/04/21/1433254cid=57 LOL! -jon
what is the deal with tomcat 4 and web server connectors??
Title: what is the deal with tomcat 4 and web server connectors?? i want to move from tomcat 3.x to tomcat 4. i absolutely must be able to use tomcat 4 with netscape/iplanet and microsoft (iis) web servers. as near as i can tell, the only connector that will be available in the foreseeable future is for apache 1.3. is this true? i have come across very little (almost no) information regarding this new webapp lib (which appears to be undergoing some significant change recently) and the warp thing... does *anybody* have anything to share?? i'm willing to help out with connector development, or even write my own connectors... if i could only figure out where to start...
cvs commit: jakarta-tomcat-4.0/tester/web/ssidir includeme.txt
amyroh 01/04/22 14:03:47 Modified:tester/web includeme.txt tester/web/golden SSIConfig03.txt SSIFsize02.txt SSIInclude02.txt tester/web/ssidir includeme.txt Log: Remove newline at end of file. Revision ChangesPath 1.2 +1 -1 jakarta-tomcat-4.0/tester/web/includeme.txt Index: includeme.txt === RCS file: /home/cvs/jakarta-tomcat-4.0/tester/web/includeme.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- includeme.txt 2001/04/18 03:02:43 1.1 +++ includeme.txt 2001/04/22 21:03:47 1.2 @@ -1 +1 @@ -This is Content of "includeme.txt" +This is Content of "includeme.txt" \ No newline at end of file 1.2 +2 -2 jakarta-tomcat-4.0/tester/web/golden/SSIConfig03.txt Index: SSIConfig03.txt === RCS file: /home/cvs/jakarta-tomcat-4.0/tester/web/golden/SSIConfig03.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SSIConfig03.txt 2001/04/20 04:37:47 1.1 +++ SSIConfig03.txt 2001/04/22 21:03:47 1.2 @@ -1,4 +1,4 @@ -3,941 +4,080 -3.84 KB +3.98 KB 1.2 +1 -1 jakarta-tomcat-4.0/tester/web/golden/SSIFsize02.txt Index: SSIFsize02.txt === RCS file: /home/cvs/jakarta-tomcat-4.0/tester/web/golden/SSIFsize02.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SSIFsize02.txt2001/04/20 04:37:47 1.1 +++ SSIFsize02.txt2001/04/22 21:03:47 1.2 @@ -1 +1 @@ -35 bytes +34 bytes 1.2 +0 -1 jakarta-tomcat-4.0/tester/web/golden/SSIInclude02.txt Index: SSIInclude02.txt === RCS file: /home/cvs/jakarta-tomcat-4.0/tester/web/golden/SSIInclude02.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SSIInclude02.txt 2001/04/18 03:02:15 1.1 +++ SSIInclude02.txt 2001/04/22 21:03:47 1.2 @@ -1,2 +1 @@ This is Content of "includeme.txt" - 1.2 +1 -1 jakarta-tomcat-4.0/tester/web/ssidir/includeme.txt Index: includeme.txt === RCS file: /home/cvs/jakarta-tomcat-4.0/tester/web/ssidir/includeme.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- includeme.txt 2001/04/18 03:02:15 1.1 +++ includeme.txt 2001/04/22 21:03:47 1.2 @@ -1 +1 @@ -This is Content of "includeme.txt" +This is Content of "includeme.txt" \ No newline at end of file
URL mapping and infinite loop problem
Hello: I have following servlet mapping defined in the web.xml file: servlet-mapping servlet-namesecureAction/servlet-name url-pattern/secure/*/url-pattern /servlet-mapping The objective is to activate the secureAction servlet when anyfile in secure directory is accessed. The secureAction servlet performs common processing and then supposed to forward the request the resource. The problem is, when secureAction servlet uses forward( ) or sendRedirect( ) method to the desired resource, the message activates the secureAction servlet again since the forwarded message has /secure in its URL thus causing an infinite loop. Shouldn't the forward call bypass the servlet mapping policy? ~ Tushar Kale
RE: 3.2.2b3 mod_jk gets stuck in readFully
Thanks for your help, Marc. Would it be possible to log a message to tomcat.log if the thread pool gets exhausted? I believe the default Apache installation calls for 256 children, so busy sites are going to run into this. A log message suggesting to increase max_threads could save a lot of aggravation! Bill --- Marc Saegesser [EMAIL PROTECTED] wrote: As for the thread pool stuff. By default, Tomcat 3.2.x thread pools create 10 threads. This can be changed using the min_spare_threads parameter. The pools will grow as needed up to the maximum number of threads allowed (100, by default). You can increase the maximum number of allowed threads using the max_threads parameter. See if this fixes your problem better than using SimpleTcpConnector. __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
[PATCH] mod_jk timestamp and process id logging
2) I suggest adding a timestamp to mod_jk-logging in jk_util.c. Logging without a timestamp is not very useful. (change 1 line, add 2 lines) Yes, this is a must-have... the other thing that is really useful is the Apache child process id. That way if one process gets stuck, you can get the id from the Apache mod_status, and grep the mod_jk.log for that pid to see where it is. Attached is another version of the patch that adds both, relative to 3.3-m2. This was the only way that I could figure out that Tomcat didn't have enough threads in its thread pool for my Apache config! Bill __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ diff.out
tomcat 4 and warp/mod_webapp/connectors
first of all, let me apologize... i had sent a couple of emails to this list that were formatted in html (by my lovely exchange server) and i didn't even know it... oops. anyways... is there any documentation on warp, mod_webapp and connectors beyond what comes with the distributions? is there any work ongoing for connectors for iis/netscape/iplanet? any info on these things would be greatly appreciated. thanks.
tomcat 4 and warp/mod_webapp/connectors
first of all, let me apologize... i had sent a couple of emails to this list that were formatted in html (by my lovely exchange server) and i didn't even know it... oops anyways... is there any documentation on warp, mod_webapp and connectors beyond what comes with the distributions? is there any work ongoing for connectors for iis/netscape/iplanet? any info on these things would be greatly appreciated. thanks.
Re: [VOTE] New Committer: Bip Thelin
On Sun, 22 Apr 2001, Kief Morris wrote: I would like to propose Bip Thelin as a new committer. He has made a number of contributions of patches over the past several months, including SSI and JDBCRealm, and most recently, is doing solid work on session persistence. Kief +1 Craig
Re: Session expiration vs. passivation
On Sun, 22 Apr 2001, Kief Morris wrote: I'm fixing a problem with PersistentManager which affects how sessions are removed from memory. This will require making a change to StandardSession, which I'd like to get some feedback on. Looking at this issue makes me think that StandardManager is also doing the wrong thing when unloading sessions, namely sending sessionDestroyed() events to listeners. You are correct - it should send sessionPassivated() to interested listeners, but not sessionDestroyed(). I thought this was fixed quite a while ago (and the tester series checks for this). Perhaps the call to expire got regressed somehow during the refactoring? The PersistentManager issue is how sessions are unloaded to the Store, which currently copies StandardManager's algorithm of calling session.expire(). The expire() method is really intended for sessions which are being destroyed, either through invalidation or timeout. PersistentManager needs to be modified so it will remove sessions from its Store when expire() is called, which can be done by overriding the remove method: public void remove(Session session) { super.remove(session); if (store != null) try { store.remove(session.getId()); } catch (IOException e) { log("IOException removing session from Store: " + e.getMessage()); e.printStackTrace(); } } No problem, except that this method is also triggered from the swapOut() method by a call to StandardSession.expire(), which neuters swapOut(). So I'm thinking the thing to do is break out StandardSession.expire() functionality so there are two public methods, one for expiring/destroying a session, one to simply release/recycle the session (perhaps release()?) This should be straightforward, but looking at this makes me wonder whether StandardManager's behaviour on unload() is correct: it is sending events to any listeners which indicate the session is being destroyed. My reading of the spec suggests it should just send passivation-related events. I'm not sure about the unbinding of attributes. Comments? Kief Are you sure it is really doing that? The tester logic (Session02 - reload - Session03) should be catching it. Craig
Accesing MySQL database through Applets
I am using Tomcat version 3.2.1. I am trying to connect to a data base from an applet and I am getting the following error: 2001-04-22 05:41:00 - Ctx( /examples ): 404 R( /examples + /jsp/student/org/gjt/ mm/mysql/Driver.class + null) null My driver is in: C:\tomcat\jakarta-tomcat-3.2.1\lib My applet is in: C:\tomcat\jakarta-tomcat-3.2.1\webapps\examples\jsp\student What can I do to connect the database from the applet? Should I give some permissions? Thanks, Dana __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Re: [VOTE] New Committer: Bip Thelin
- Original Message - From: "Kief Morris" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, April 22, 2001 2:22 AM Subject: [VOTE] New Committer: Bip Thelin I would like to propose Bip Thelin as a new committer. He has made a number of contributions of patches over the past several months, including SSI and JDBCRealm, and most recently, is doing solid work on session persistence. Kief +1 Amy
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/generators ErrorHandler.java
costin 01/04/22 18:21:59 Modified:src/share/org/apache/tomcat/modules/generators ErrorHandler.java Log: Fix for #939 - error in error handling, double "/". Thanks to Ingo Luetkebohle for finding and sending the patch. Submitted by: [EMAIL PROTECTED] (Ingo Luetkebohle) Revision ChangesPath 1.10 +21 -5 jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/ErrorHandler.java Index: ErrorHandler.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/ErrorHandler.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ErrorHandler.java 2001/03/19 21:09:06 1.9 +++ ErrorHandler.java 2001/04/23 01:21:58 1.10 @@ -172,9 +172,17 @@ if( errorPath != null ) { errorServlet=getHandlerForPath( cm, ctx, errorPath ); + String cpath=ctx.getPath(); + if( cpath="/") cpath=""; + // Make sure Jsps will work - needed if the error page is a jsp - req.setAttribute( "javax.servlet.include.request_uri", - ctx.getPath() + "/" + errorPath ); + if ( null!=errorPath errorPath.startsWith("/") ) { + req.setAttribute( "javax.servlet.include.request_uri", + cpath + errorPath ); + } else { + req.setAttribute( "javax.servlet.include.request_uri", + cpath + "/" + errorPath ); + } req.setAttribute( "javax.servlet.include.servlet_path", errorPath ); } @@ -281,9 +289,17 @@ if( errorPath != null ) { errorServlet=getHandlerForPath( cm, ctx, errorPath ); - // Make sure Jsps will work - req.setAttribute( "javax.servlet.include.request_uri", - ctx.getPath() + "/" + errorPath ); + String cpath=ctx.getPath(); + if( cpath="/") cpath=""; + + // Make sure Jsps will work - needed if the error page is a jsp + if ( null!=errorPath errorPath.startsWith("/") ) { + req.setAttribute( "javax.servlet.include.request_uri", + cpath + errorPath ); + } else { + req.setAttribute( "javax.servlet.include.request_uri", + cpath + "/" + errorPath ); + } req.setAttribute( "javax.servlet.include.servlet_path", errorPath ); }
RE: [VOTE] New Committer: Bip Thelin
+1 -Original Message- From: Kief Morris [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 22, 2001 4:22 AM To: [EMAIL PROTECTED] Subject: [VOTE] New Committer: Bip Thelin I would like to propose Bip Thelin as a new committer. He has made a number of contributions of patches over the past several months, including SSI and JDBCRealm, and most recently, is doing solid work on session persistence. Kief
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util ThreadPool.java
marcsaeg01/04/22 19:16:03 Modified:src/share/org/apache/tomcat/util Tag: tomcat_32 ThreadPool.java Log: Added a log message to indicate that the thread pool has been exhausted. The log message will only show up in log levels of INFORMATION and higher. Exhuasting the pool is not an error condition, but if it happens often enough it probably indicates that the server configuration needs to be changed. Revision ChangesPath No revision No revision 1.9.2.2 +6 -3 jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/ThreadPool.java Index: ThreadPool.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/ThreadPool.java,v retrieving revision 1.9.2.1 retrieving revision 1.9.2.2 diff -u -r1.9.2.1 -r1.9.2.2 --- ThreadPool.java 2000/07/06 22:20:17 1.9.2.1 +++ ThreadPool.java 2001/04/23 02:16:03 1.9.2.2 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/ThreadPool.java,v 1.9.2.1 2000/07/06 22:20:17 alex Exp $ - * $Revision: 1.9.2.1 $ - * $Date: 2000/07/06 22:20:17 $ + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/ThreadPool.java,v 1.9.2.2 2001/04/23 02:16:03 marcsaeg Exp $ + * $Revision: 1.9.2.2 $ + * $Date: 2001/04/23 02:16:03 $ * * * @@ -205,6 +205,9 @@ int toOpen = currentThreadCount + minSpareThreads; openThreads(toOpen); } else { +// XXX There really should be a way to log which pool is exhuasted +loghelper.log("Pool exhausted with " + currentThreadCount + " threads."); + // Wait for a thread to become idel. while(currentThreadsBusy == currentThreadCount) { try {
Re: Catalina and log4j
Craig R. McClanahan wrote: On Sat, 21 Apr 2001, Glenn Nielsen wrote: Ceki Gülcü wrote: One important point to remember is that each webapp classloader could load a fresh copy of log4j so that each webapp has its own logging universe. This would significantly increase the memory footprint required for logging in the JVM. I would prefer that log4j be global. Log4J is nothing compared to having multiple XML parsers in memory :-) Actually, it is technically feasible to do this either way -- if you put the Log4J JAR file in common/lib instead of server/lib it becomes available to the webapps as well. The disadvantage is that the static variables really are global instead of once per web app (which they would be if each webapp installed its own copy), so they would share the same set of Log4J categories, appenders, and so on. Comments about per webapp vs global installation of jar's: Tomcat 4 defers to the web application ClassLoader first before loading classes from the parent classloaders, as suggested by the Servlet 2.3 spec. Bloating of JVM memory usage due to alot of web applications all having WEB-INF/lib/foo.jar installed could cause a problem with scaling if there are 100's of web applications installed. In our use of Tomcat 4 we will be installing all of the most commonly used taglib jar files and API's in $CATALINA_HOME/lib so they can be shared by multiple web applications. Of course the customer can always override this by installing the jar file locally in WEB-INF/lib, but we will try to encourage them to use the globally installed versions if they can. Ideas for log4j: log4j itself could be installed for Tomcat in $CATALINA_HOME/server/lib. Logging categories, priorities, and destinations could be configured in server.xml scoped at the Engine, Host, DefaultContext, and Context levels. The normal servletAPI log methods would use log4j under the hood. The Tomcat 4 global log4j instance would not be visible to individual web applications. In addition, create a JNDI Factory for log4j so that a logging category for a web application can be exported to it using a JNDI logging resource named something like jndi:/comp/env/log. That resource would only make available to the web application the few methods needed to determine if a logging priority was enabled and to log a message at a priority. This would allow a web application to use log4j without making log4j internals visible to the web application. A manager servlet could even be written to allow changing of log priorities for the web application. And a tag library provided for use in JSP pages. Regards, Glenn -- Glenn Nielsen [EMAIL PROTECTED] | /* Spelin donut madder| MOREnet System Programming | * if iz ina coment. | Missouri Research and Education Network | */ | --