Long Startup Time
Hi, I'm running Tomcat 5.0.28 with JDK 1.5.0_01 on Fedora Core 3. The problem that I'm having is pretty odd. It's taking Tomcat about 30 minutes to fully start up and start accepting connections. Here's where it's getting hung up at from the startup logs: Mar 30, 2005 10:52:10 AM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Mar 30, 2005 11:21:03 AM org.apache.catalina.core.StandardHost getDeployer You can see that it's about 29 minutes between those two log entries. So, my question is, what is happening there that could take so long? There are no errors in the logs and once Tomcat does complete its startup stuff our application works just fine. Thanks, Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Weird Red Hat Enterprise Startup
Hi Everyone, Well, I finally solved this problem. OS patches didn't do the trick, still had segmentation faults and unexplained crashes on startup and shutdown, no core dumps, no error messages, and -server band-aid didn't work for me either (I was running out of options!). The solution was to use the IBM JDK instead of the Sun JDK. If you're having the same problem and you don't need Java 1.5/5.0 for a while, give the IBM JDK a shot, it worked for me. Have a nice day ... Sincerely, Mike Cherichetti -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Shankar Unni Sent: Monday, October 11, 2004 5:08 PM To: [EMAIL PROTECTED] Subject: Re: Weird Red Hat Enterprise Startup Shapira, Yoav wrote: Any JVM switch to make an internal JVM crash disappear is cruising for a bruising. Fully understood. Most likely, it's missing OS-level patches for your system. True, except that for the Linux case, we are running on one of the supported OSes (RH EL 3.0WS, stock), and there's no mention of any required patches for Linux. Still get the crash. In our case, it was readily triggered by a particularly large output from a JSP - a table with ~1500 rows, which was a pathological case - and we have workarounds for this particular symptom. But there have been other unexplained crashes, too, and we have found open bugs in the Sun JDC bug database referring to crashes like this on Linux.. So yes, once again: -server is a band-aid (just one of many), it's not guaranteed to fix anything at all (could even make things worse) - it just shifts the problem around under the blanket. It's just one thing to try, and *if it works in your case*, use it as a temporary workaround. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Weird Red Hat Enterprise Startup
Hi, I'm getting this strange error in catalina.out on Red Hat Enterprise Linux AS and CentOS: Another exception has been detected while we were handling last error. Dumping information about last error: ERROR REPORT FILE = (N/A) PC= 0x SIGNAL= 11 FUNCTION NAME = (N/A) OFFSET= 0x LIBRARY NAME = (N/A) Please check ERROR REPORT FILE for further information, if there is any. Good bye. When this happens, Tomcat just fails to start. However, if I try to start Tomcat again it will work. Sometimes it takes 2 or 3 retries. As this error message doesn't really provide any help at all in figuring this out, I'm wondering if anyone has any tips to try and figure out what's happening? I don't think this is a problem with Tomcat, but I think it may be something in the startup.sh/catalina.sh/shutdown.sh scripts. Oh yeah, sometimes this happens with the shutdown call too. Also, I've tried this with Sun JDK 1.4.1/1.4.2, Apache 1.3/2.0, mod_jk/mod_jk2, and Tomcat 4.1/5.0. No problems with Red Hat 7, 8, or 9. Have a nice day ... Sincerely, Mike Cherichetti - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Weird Red Hat Enterprise Startup
Thanks for the info. I just want to make sure, are you saying that I should put -server in JAVA_OPTS and CATALINA_OPTS? Because I already have it set in CATALINA_OPTS right now. I think maybe I'll only need it in JAVA_OPTS, because if I recall those get passed to Tomcat too along with CATALINA_OPTS. Have a nice day ... Sincerely, Mike Cherichetti -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Shankar Unni Sent: Thursday, October 07, 2004 4:24 PM To: [EMAIL PROTECTED] Subject: Re: Weird Red Hat Enterprise Startup Mike Cherichetti (Renegade Internet) wrote: Another exception has been detected while we were handling last error. Dumping information about last error: ERROR REPORT FILE = (N/A) PC= 0x This is the Java VM aborting. You'll probably find core.* files littered in the Tomcat directory from java. I've been running into this same problem with Java 1.4.2_0x (including _05) on Red Hat EL 3.0. One (not guaranteed or foolproof) workaround is to run java with the -server option (you'll have to pass it in via the JAVA_OPTS env variable or something). This made the crash go away in our setup. You can also play with the heap params and see if that helps. The crash is in some GC processing that kicks in at the wrong moment.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Java Virtual Machines on Linux
Ryan, I've had good luck with the IBM JVM on Linux. The Sun JVM is slower, uses more memory, and isn't as stable. At least that's been my experience with it. I'd narrow your options down to IBM and BEA. Mike -Original Message- From: Ryan Lissack [mailto:[EMAIL PROTECTED] Sent: Monday, September 08, 2003 12:36 PM To: [EMAIL PROTECTED] Subject: Java Virtual Machines on Linux Hi, I am interested to hear if others have used anything other than the Sun VM for a production Tomcat system, running on Linux, and what their experiences were. From what I can see, there are four main options at the moment: Sun JRE 1.4.2 Blackdown JRE 1.4.1 IBM JRE 1.4.1 BEA JRockit 8.1 (J2SE 1.4 compatible) Any comments/suggestions on any of the above? We are using Tomcat 4.1 (with CoyoteConnector) running on x86 based dual CPU machines using Red Hat Linux 9 (kernel 2.4.20-8smp). Thanks for you attention. Ryan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Bug in ErrorDispatcherValue?
I've had this happen twice in the past two days on two rather busy servers. Both are running RedHat Linux 7.3, IBM JDK 1.4.1, and Tomcat 4.1 (one is 4.1.24 and the other is 4.1.27). After these exceptions hit the error log, Tomcat stops responding: 2003-09-05 06:33:06 ErrorDispatcherValve[www.mysite.com]: Exception Processing ErrorPage[errorCode=500, location=/error/500.jsp] java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java(Compiled Code)) at java.net.SocketOutputStream.write(SocketOutputStream.java(Compiled Code)) at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWri te(InternalOutputBuffer.java(Compiled Code)) at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFi lter.java(Compiled Code)) at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.j ava(Compiled Code)) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java(Compiled Code)) at org.apache.coyote.tomcat4.OutputBuffer.flush(OutputBuffer.java(Compiled Code)) at org.apache.coyote.tomcat4.CoyoteResponse.flushBuffer(CoyoteResponse.java:555 ) at org.apache.coyote.tomcat4.CoyoteResponseFacade.flushBuffer(CoyoteResponseFac ade.java:227) at org.apache.catalina.valves.ErrorDispatcherValve.status(ErrorDispatcherValve. java(Compiled Code)) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java(Compiled Code)) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java(Com piled Code)) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compi led Code)) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled Code)) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java (Compiled Code)) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compi led Code)) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled Code)) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java(Compiled Code)) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java(Compil ed Code)) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java(Compiled Code)) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java(Compil ed Code)) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a(Compiled Code)) at java.lang.Thread.run(Thread.java(Compiled Code)) 2003-09-04 15:42:54 ErrorDispatcherValve[localhost]: Exception Processing ErrorPage[errorCode=500, location=/error/500.jsp] java.lang.IllegalStateException: Cannot reset after response has been committed at org.apache.catalina.connector.ResponseBase.reset(ResponseBase.java:789) at org.apache.catalina.connector.HttpResponseBase.reset(HttpResponseBase.java:8 12) at org.apache.catalina.connector.HttpResponseBase.reset(HttpResponseBase.java:3 73) at org.apache.catalina.valves.ErrorDispatcherValve.custom(ErrorDispatcherValve. java:413) at org.apache.catalina.valves.ErrorDispatcherValve.status(ErrorDispatcherValve. java(Compiled Code)) at org.apache.catalina.valves.ErrorDispatcherValve.throwable(ErrorDispatcherVal ve.java:277) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java(Compiled Code)) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java(Com piled Code)) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compi led Code)) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled Code)) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java (Compiled Code)) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compi led Code)) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled Code)) at
RE: Bug in ErrorDispatcherValue?
After debugging this further, I've figured out what's going on here. I was calling two methods after committing the response that process some optional logging to a backend database and submit a record to a queue that later gets processed by a background thread in batches. Both of those methods access the HttpSession to get various peices of information out of it, which appears to be a problem when using the PersistentManager to store sessions in a database. I noticed some errors like this spawing from one of those methods: java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.jav a(Compiled Code)) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi onFacade.java(Compiled Code)) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi onFacade.java(Compiled Code)) ... snip ... I'm guessing the session was swapped out of memory right after the request occurred? Doesn't seem to make sense because I have the swap out set to happen after 1 minute of inactivity. This is the best possible explanation I could come up with for the exceptions though. Maybe a problem with the PersistentManager swapping out a session when processing hasn't left the service() method? Still, I think there may be a problem with the ErrorDispatcherValve. It shouldn't be trying to process an error response after the response has already been committed should it? Maybe I'm only seeing this because I've disabled keep alive connections. Anyone have any input? Should I submit something as a bug here? Thanks, Mike -Original Message- From: Mike Cherichetti (Renegade Internet) [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 10:06 AM To: Tomcat Users Subject: Bug in ErrorDispatcherValue? I've had this happen twice in the past two days on two rather busy servers. Both are running RedHat Linux 7.3, IBM JDK 1.4.1, and Tomcat 4.1 (one is 4.1.24 and the other is 4.1.27). After these exceptions hit the error log, Tomcat stops responding: 2003-09-05 06:33:06 ErrorDispatcherValve[www.mysite.com]: Exception Processing ErrorPage[errorCode=500, location=/error/500.jsp] java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java(Compiled Code)) at java.net.SocketOutputStream.write(SocketOutputStream.java(Compiled Code)) at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWri te(InternalOutputBuffer.java(Compiled Code)) at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFi lter.java(Compiled Code)) at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.j ava(Compiled Code)) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java(Compiled Code)) at org.apache.coyote.tomcat4.OutputBuffer.flush(OutputBuffer.java(Compiled Code)) at org.apache.coyote.tomcat4.CoyoteResponse.flushBuffer(CoyoteResponse.java:555 ) at org.apache.coyote.tomcat4.CoyoteResponseFacade.flushBuffer(CoyoteResponseFac ade.java:227) at org.apache.catalina.valves.ErrorDispatcherValve.status(ErrorDispatcherValve. java(Compiled Code)) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java(Compiled Code)) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java(Com piled Code)) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compi led Code)) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled Code)) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java (Compiled Code)) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compi led Code)) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled Code)) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java(Compiled Code)) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java(Compil ed Code)) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java(Compiled Code)) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java(Compil ed Code)) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a(Compiled
RE: Servlet mappings?
I don't think this can be done with mappings. You can put an index.jsp file with only a forward/redirect call in it to transfer control to your servlet. I've done this before, seems to work quite well. Mike -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 03, 2003 8:55 PM To: [EMAIL PROTECTED] Subject: Servlet mappings? I have a web app with multiple servlets. I would like one of those servlets to handle all requests to http://mywebserver/. Basically I want it to do the same thing as the welcome-file in the web.xml. How can I do this? Thank You, Justin A. Stanczak Web Manager Shake Learning Resource Center Vincennes University (812)888-5813 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: maxProcessors problem
The server has 2 GB physical memory and 4 GB swap file. During peak times I'm hitting between 60 and 75 requests per second and it is using pretty close to all of the memory. I've seen the JVM using ~ 830 MB watching top. Thanks, Mike -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 9:24 PM To: Tomcat Users List Subject: Re: maxProcessors problem If I may ask how much physical memory do you have in the first place ? Do you really have that much to give to the for the max heap size ? Mike Cherichetti (Renegade Internet) wrote: I've set CATALINA_OPTS to use -Xmx896m and -Xms384m. That works fine with maxProcessors set to 384. Problem is, if I set -Xmx higher or maxProcessors higher, I get he OutOfMemoryError. Thanks, Mike -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 9:12 AM To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: maxProcessors problem Howdy, What's your -Xmx setting to the JVM? Yoav Shapira Millennium ChemInformatics -Original Message- From: Mike Cherichetti (Renegade Internet) [mailto:[EMAIL PROTECTED] Sent: Monday, August 18, 2003 4:42 PM To: Tomcat Users Subject: maxProcessors problem First off, I'm using RedHat Linux 7.3, IBM JDK 1.4.1, and Tomcat 4.1.24 on an IBM xSeries with Dual Xeon 2 GHz processors, 2 GB RAM, and SCSI disks. I'm trying to get Tomcat to handle a lot of traffic (4-5 million hits per day) and bumping up against a problem I for life of me can't figure out. So, I'm hoping someone else on this list has run into this problem and can help me out! Basically, I can't set maxProcessors higher than 384. If I do, Tomcat ends up choking (it doesn't crash, it just stops creating more request processors) and I get the following in catalina.out: Aug 18, 2003 5:05:02 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 80 Aug 18, 2003 5:05:05 AM org.apache.tomcat.util.threads.ThreadPool$ControlRunnable run SEVERE: Caught exception executing [EMAIL PROTECTED], terminating thread java.lang.OutOfMemoryError: JVMCI015:OutOfMemoryError, cannot create anymore threads due to memory or resource constraints at java.lang.Thread.start(Native Method) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.init(Thread Pool . java:582) at org.apache.tomcat.util.threads.ThreadPool.openThreads(ThreadPool.java:4 60) at org.apache.tomcat.util.threads.ThreadPool.runIt(ThreadPool.java:293) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:5 36) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPoo l.ja v a:619) at java.lang.Thread.run(Thread.java:568) Now, I know that the JVM has plenty of memory left that it can be allocated and the system has plenty of free memory, so I'm not sure it's really a memory issue. As I said, Tomcat still runs and the memory allocated to the JVM increases, it just doesn't have nearly enough request processors created at the point this error happens to deal with all of the traffic. I've tried playing around with ulimit settings, but those didn't have any impact. I've also tried the Sun JVM and it did the same thing. Has anyone run into this problem or something like it before? Any help would be greatly appreciated! Thanks, Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to send back data without to wait for the complete page.
Stefano, You would probably be better off creating a thread to run this lengthy process in the background and have your Servlet send back a please wait response and refresh automatically after several seconds to check the status until it completes and you can display all of the results. If you're set on doing it though, look for a way to manually flush output from a JSP. I'm not sure how to do that or if you can (I'm sure you probably can, I just haven't ever had the need to do it). But, be careful if you're displaying these rows in a table. Netscape (I'm not sure if this holds true for newer Gecko powered versions) for example won't render a table until it's received the whole thing. Hope that helps, Mike -Original Message- From: Unternaehrer Stefano [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 20, 2003 1:42 AM To: [EMAIL PROTECTED] Subject: How to send back data without to wait for the complete page. Hello all. Hope the subject explains what I mean. I even don't know how to call that, so cannot search it in archives, and don't know if this behaviour can be setted for a specific jsp page or at tomcat configuration level. I have a page wich requires some time to be executed, you can imagine to receive a table with different rows, where every row require some time to be prepared. I would like that the used doesn't need to wait for the last row to be ready before to see something, but instead that it will see the first rows as soon as possible, than others following when ready. Is this possible with tomcat? I'm using version 3.2.1 but can upgrade when required. Thank you and best regards, Stefano --- Stefano Unternaehrer IT System Administrator Sistema bibliotecario ticinese Bellinzona Ticino Switzerland [EMAIL PROTECTED] www.sbt.ti.ch (091 814 1513) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: maxProcessors problem
Have you verified that at the time of the Out of Memory errors that the JVM is somewhere near 896M RAM? How about when it starts up and there is little or no traffic? Is it at or above (probably above) 384M? It usually has 160 MB to 220 MB of memory allocated (these figures are from top, so room for some error). The system is under pretty heavy traffic when it starts up. I have maxProcessors set to 384 and minProcessors set to 50. Since you have free system RAM left, then it sounds like your 896M is too small for the load. Problem is, if I increase -Xmx and don't touch anything else, I get this OutOfMemoryError too. The system has 1.2 GB to 1.4 GB of memory free when this error occurs. Do you load balance Tomcats across machines? Or are you running all these users against one Tomcat? Just one Tomcat and MySQL on the server. Thanks, Mike -Original Message- From: Ben Ricker [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 20, 2003 10:18 AM To: [EMAIL PROTECTED] Subject: RE: maxProcessors problem On Tue, 2003-08-19 at 16:59, Mike Cherichetti (Renegade Internet) wrote: Doh! My mistake...I am thinking of the variable name *I* use in a script that passes this to CATALINA_OPTS. I am really sorry for that confusion. Have you verified that at the time of the Out of Memory errors that the JVM is somewhere near 896M RAM? How about when it starts up and there is little or no traffic? Is it at or above (probably above) 384M? Since you have free system RAM left, then it sounds like your 896M is too small for the load. Do you load balance Tomcats across machines? Or are you running all these users against one Tomcat? If you could spell out the setup in a bit more detail, I might be able to help you figure it out and possibly how to fix it. Ben Ricker Wellinx, Inc. Are you saying that I should use JAVA_OPTS instead of CATALINA_OPTS? I've set CATALINA_OPTS to use -Xmx896m and -Xms384m already. Problem is, if I raise -Xmx or maxProcessors, I get the OutOfMemoryError and Tomcat stops creating request processors. Thanks, Mike -Original Message- From: Ben Ricker [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 11:18 AM To: Tomcat Users Subject: Re: maxProcessors problem On Mon, 2003-08-18 at 15:42, Mike Cherichetti (Renegade Internet) wrote: java.lang.OutOfMemoryError: JVMCI015:OutOfMemoryError, cannot create anymore threads due to memory or resource constraints There is the cheese right there. You need to WAY up your Java System memory heap using JAVA_OPTS. See this post on the archives: http://mikal.org/interests/java/tomcat/archive/view?mesg=53417. All the available options are in the Java docs. Ben Ricker at java.lang.Thread.start(Native Method) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.init(ThreadPool. java:582) at org.apache.tomcat.util.threads.ThreadPool.openThreads(ThreadPool.java:460) at org.apache.tomcat.util.threads.ThreadPool.runIt(ThreadPool.java:293) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:536) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:619) at java.lang.Thread.run(Thread.java:568) Now, I know that the JVM has plenty of memory left that it can be allocated and the system has plenty of free memory, so I'm not sure it's really a memory issue. As I said, Tomcat still runs and the memory allocated to the JVM increases, it just doesn't have nearly enough request processors created at the point this error happens to deal with all of the traffic. I've tried playing around with ulimit settings, but those didn't have any impact. I've also tried the Sun JVM and it did the same thing. Has anyone run into this problem or something like it before? Any help would be greatly appreciated! Thanks, Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Installing Tomcat as a Service
I use the following script on RedHat 7.3 (I save this as /etc/rc.d/init.d/tomcat): #!/bin/bash # # Startup script for the Tomcat Web Server # # chkconfig: 345 84 16 # description: Tomcat is a World Wide Web server. It is used to serve \ # HTML, JSP, and servlets, and CGI if needed. # processname: java case $1 in start) $CATALINA_HOME/bin/startup.sh ;; stop) $CATALINA_HOME/bin/shutdown.sh ;; *) echo $Usage: tomcat {start|stop} exit 1 esac exit 0 I then do the following with chkconfig: chkconfig --add tomcat chkconfig --level 345 tomcat on chkconfig --list tomcat If that still doesn't work, ensure that you've set CATALINA_HOME and JAVA_HOME in /etc/profile. Hope that helps, Mike -Original Message- From: Stuart Stephen [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 20, 2003 10:57 AM To: Tomcat Users List Subject: RE: Installing Tomcat as a Service Thanks for the reply, I've tried creating a script in the /etc/init.d directory and then running the chkconfig --add script-name and this hasn't worked for me. I'm getting an error saying that: service service-name does not support chkconfig I must still be doing something wrong? The script has the same permissions showing in the ls -l list? -Original Message- From: Paul Yunusov [mailto:[EMAIL PROTECTED] Sent: 20 August 2003 13:24 To: Tomcat Users List Subject: Re: Installing Tomcat as a Service On August 20, 2003 04:19 am, Stuart Stephen wrote: Hi all, How might I go about installing Tomcat as a service in RedHat 9.0. I've never installed a service under linux manually before and I'm not sure what to do. I can't find the appropriate documentation in the manuals for either Tomcat or RedHat. I must be looking in the wrong places :O( UNRELATED: Also, If I wanted to install a java program as a service, how might I do this? Is this a similar process? Regards, Stuart man chkconfig man serviceconf man init For a Java program, write a wrapper shell script like Tomcat authors did with catalina.sh. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: maxProcessors problem
I've set CATALINA_OPTS to use -Xmx896m and -Xms384m. That works fine with maxProcessors set to 384. Problem is, if I set -Xmx higher or maxProcessors higher, I get he OutOfMemoryError. Thanks, Mike -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 9:12 AM To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: maxProcessors problem Howdy, What's your -Xmx setting to the JVM? Yoav Shapira Millennium ChemInformatics -Original Message- From: Mike Cherichetti (Renegade Internet) [mailto:[EMAIL PROTECTED] Sent: Monday, August 18, 2003 4:42 PM To: Tomcat Users Subject: maxProcessors problem First off, I'm using RedHat Linux 7.3, IBM JDK 1.4.1, and Tomcat 4.1.24 on an IBM xSeries with Dual Xeon 2 GHz processors, 2 GB RAM, and SCSI disks. I'm trying to get Tomcat to handle a lot of traffic (4-5 million hits per day) and bumping up against a problem I for life of me can't figure out. So, I'm hoping someone else on this list has run into this problem and can help me out! Basically, I can't set maxProcessors higher than 384. If I do, Tomcat ends up choking (it doesn't crash, it just stops creating more request processors) and I get the following in catalina.out: Aug 18, 2003 5:05:02 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 80 Aug 18, 2003 5:05:05 AM org.apache.tomcat.util.threads.ThreadPool$ControlRunnable run SEVERE: Caught exception executing [EMAIL PROTECTED], terminating thread java.lang.OutOfMemoryError: JVMCI015:OutOfMemoryError, cannot create anymore threads due to memory or resource constraints at java.lang.Thread.start(Native Method) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.init(Thread Pool . java:582) at org.apache.tomcat.util.threads.ThreadPool.openThreads(ThreadPool.java:4 60) at org.apache.tomcat.util.threads.ThreadPool.runIt(ThreadPool.java:293) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:5 36) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPoo l.ja v a:619) at java.lang.Thread.run(Thread.java:568) Now, I know that the JVM has plenty of memory left that it can be allocated and the system has plenty of free memory, so I'm not sure it's really a memory issue. As I said, Tomcat still runs and the memory allocated to the JVM increases, it just doesn't have nearly enough request processors created at the point this error happens to deal with all of the traffic. I've tried playing around with ulimit settings, but those didn't have any impact. I've also tried the Sun JVM and it did the same thing. Has anyone run into this problem or something like it before? Any help would be greatly appreciated! Thanks, Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: maxProcessors problem
Are you saying that I should use JAVA_OPTS instead of CATALINA_OPTS? I've set CATALINA_OPTS to use -Xmx896m and -Xms384m already. Problem is, if I raise -Xmx or maxProcessors, I get the OutOfMemoryError and Tomcat stops creating request processors. Thanks, Mike -Original Message- From: Ben Ricker [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 11:18 AM To: Tomcat Users Subject: Re: maxProcessors problem On Mon, 2003-08-18 at 15:42, Mike Cherichetti (Renegade Internet) wrote: java.lang.OutOfMemoryError: JVMCI015:OutOfMemoryError, cannot create anymore threads due to memory or resource constraints There is the cheese right there. You need to WAY up your Java System memory heap using JAVA_OPTS. See this post on the archives: http://mikal.org/interests/java/tomcat/archive/view?mesg=53417. All the available options are in the Java docs. Ben Ricker at java.lang.Thread.start(Native Method) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.init(ThreadPool. java:582) at org.apache.tomcat.util.threads.ThreadPool.openThreads(ThreadPool.java:460) at org.apache.tomcat.util.threads.ThreadPool.runIt(ThreadPool.java:293) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:536) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:619) at java.lang.Thread.run(Thread.java:568) Now, I know that the JVM has plenty of memory left that it can be allocated and the system has plenty of free memory, so I'm not sure it's really a memory issue. As I said, Tomcat still runs and the memory allocated to the JVM increases, it just doesn't have nearly enough request processors created at the point this error happens to deal with all of the traffic. I've tried playing around with ulimit settings, but those didn't have any impact. I've also tried the Sun JVM and it did the same thing. Has anyone run into this problem or something like it before? Any help would be greatly appreciated! Thanks, Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
maxProcessors problem
First off, I'm using RedHat Linux 7.3, IBM JDK 1.4.1, and Tomcat 4.1.24 on an IBM xSeries with Dual Xeon 2 GHz processors, 2 GB RAM, and SCSI disks. I'm trying to get Tomcat to handle a lot of traffic (4-5 million hits per day) and bumping up against a problem I for life of me can't figure out. So, I'm hoping someone else on this list has run into this problem and can help me out! Basically, I can't set maxProcessors higher than 384. If I do, Tomcat ends up choking (it doesn't crash, it just stops creating more request processors) and I get the following in catalina.out: Aug 18, 2003 5:05:02 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 80 Aug 18, 2003 5:05:05 AM org.apache.tomcat.util.threads.ThreadPool$ControlRunnable run SEVERE: Caught exception executing [EMAIL PROTECTED], terminating thread java.lang.OutOfMemoryError: JVMCI015:OutOfMemoryError, cannot create anymore threads due to memory or resource constraints at java.lang.Thread.start(Native Method) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.init(ThreadPool. java:582) at org.apache.tomcat.util.threads.ThreadPool.openThreads(ThreadPool.java:460) at org.apache.tomcat.util.threads.ThreadPool.runIt(ThreadPool.java:293) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:536) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:619) at java.lang.Thread.run(Thread.java:568) Now, I know that the JVM has plenty of memory left that it can be allocated and the system has plenty of free memory, so I'm not sure it's really a memory issue. As I said, Tomcat still runs and the memory allocated to the JVM increases, it just doesn't have nearly enough request processors created at the point this error happens to deal with all of the traffic. I've tried playing around with ulimit settings, but those didn't have any impact. I've also tried the Sun JVM and it did the same thing. Has anyone run into this problem or something like it before? Any help would be greatly appreciated! Thanks, Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session Security
Todd, Putting the IP address of the user in the session won't work too well. An AOL user for example may have a different IP address every time they send in a request. And, it's obviously possible for someone to spoof an IP address. The best solution I've found to prevent sessions from being stolen is to use a one time access token. The token, which I usually create by doing MD5(ip + timestamp + random #), gets stored in a cookie and in the session itself. So, say a user logs in, they get a token and when they come back with their next request they send in that token. Your authentication logic checks the token in the cookie against the token in the session and handles accepting or denying the request. When the response is processed, you give them a new token and continue this cycle for all requests to follow. Now, lets say someone manages to steal the session. That person is going to get a different token than the legitimate user that's logged in currently has. So, when the legitimate user sends in their next request with a wrong token, you should catch that the session has been compromised and invalidate it immediately. This will result in the malicious user being kicked out. Still, this isn't a perfect solution because most users forget to logout. Using a low timeout value for the session is the only way I know of to deal with this scenario. You could run your application under HTTPS instead of HTTP too if that's an option :) Hope that helps, Mike -Original Message- From: Todd O'Bryan [mailto:[EMAIL PROTECTED] Sent: Sunday, August 17, 2003 2:45 PM To: [EMAIL PROTECTED] Subject: Session Security Is there any block against someone stealing someone else's session id and using it for nefarious purposes? In other words, if I write a grade book program, could a sharp student write down the session id from a web address (if cookies are off) or look in the teacher's cookie file, and then go to a computer in the library and use the same session id to connect to the grade book page before the teacher logs out? Does the session id check itself against the issuing computer's IP address or anything to prevent such a thing from happening? I realize it's a stretch that someone might leave their computer unattended long enough for such a thing to happen, but I just want to be sure. Also, could someone listening in to the net traffic grab the session id and then use it? Thanks, Todd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tuning KeepAlive Connections?
That didn't work. Got the following in logs/catalina.out when I tried that: Aug 7, 2003 11:40:45 PM org.apache.coyote.http11.Http11Processor process WARNING: Error parsing HTTP request java.lang.IllegalArgumentException: timeout can't be negative at java.net.Socket.setSoTimeout(Socket.java:920) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:572) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:619) at java.lang.Thread.run(Thread.java:568) Have a nice day ... Sincerely, Mike Cherichetti Renegade Internet Internet Advertising Delivery Solutions www.renegadeinternet.com Phone (724) 658-6346 Fax (724) 658-6346 -Original Message- From: Venkata Srinivasa Rao, Yerra [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 10:21 PM To: Tomcat Users List Subject: Re: Tuning KeepAlive Connections? To disable connection timeouts, set connectionTimeout value to -1 At 02:09 PM 8/7/2003 -0400, you wrote: RedHat Linux 7.3 IBM JDK 1.4.1 Tomcat 4.1.24 Is it possible to disable KeepAlive connections with the Coyote HTTP/1.1 connector? If it's not possible to turn them off, is it possible to lower the request limit and timeout period for them? Have a nice day ... Sincerely, Mike Cherichetti Renegade Internet www.renegadeinternet.com Phone (724) 658-6346 Fax (724) 658-6346 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Custom Tag Lib
Shawn, I ran into this problem as well when switching from 4.0 to 4.1. I think it has something to do with 4.1 pooling and re-using tag objects. What I did in all of my doStartTag(), doAfterBody(), etc... methods was manually call release() to reset the data in the tags like so: public int doStartTag() throws JspException { try { ... } catch (Exception exception) { throw new JspException(exception); } finally { release(); } return SKIP_BODY; } Have a nice day ... Sincerely, Mike Cherichetti Renegade Internet Internet Advertising Delivery Solutions www.renegadeinternet.com Phone (724) 658-6346 Fax (724) 658-6346 -Original Message- From: Shawn Zernik [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 10:56 PM To: [EMAIL PROTECTED] Subject: Custom Tag Lib Tomcat Users: I've been fighting with some version differences in tom cat wondering why my app acts severly different on Tomcat 4.1.27 then 4.0.6. It appears that 4.1.27 is not working from my perspective, and have been fighting with it since monday. None of the books I have touch this subject or ellude to the problem, and I've seached high and low for solutions. I'm having a problem working with my custom tag library. The stange part to this is it appears to work on tomcat 4.0.6 but not on 4.1.27. The library has a tage called site that extends a base tag, and those tags use other classes in my data namespace to hit a database. The tags are returning the proper data in both versions, but in 4.1.27, I have to reload the contect in the manager for it to register the changes from the database. I have added some printlns to std out to track what's going on. In tomcat 4.0.6 they are going through all the code as I would exspect it to. I have included each of the class files that are called. I have also included the printouts from both versions of tomcat to clierify how each version is handling the calls. The object hiarchey goes as follows: jPublish.Tags site extends inc_tag. jPublish.Data.site_manager extends jPublish.Data.manager, managers contain, load, and fill datas. jPublish.Data.site_data extends jPublish.Data.data, used for storing data and tracking updates. --- INDEX.JSP --- %@ page contentType=text/html % %@ taglib prefix=inc uri=inc % inc:site site=1 action=none/ html headtitleinc:site action=title //title/head body h1Welcome to inc:site action=title/!/h1 copy; inc:site action=copyright/ /body /html --- TOMCAT 4.0.6 STDOUT --- Starting service Tomcat-Standalone Apache Tomcat/4.0.6 Starting service Tomcat-Apache Apache Tomcat/4.0.6 jPublish.Data.manager() jPublish.Tags.site() jPublish.Tags.site.setSite() jPublish.Data.manager() jPublish.Tags.site.doEndTag(): Begin jPublish.Tags.site.doEndTag(): End jPublish.Data.manager() jPublish.Tags.site() jPublish.Tags.site.doEndTag(): Begin jPublish.Tags.inc_tag.loaded() jPublish.Tags.inc_tag.loaded(): not instance jPublish.Data.manager.load() jPublish.Tags.inc_tag.loaded(): load ok jPublish.Tags.inc_tag.loaded(): next ok jPublish.Tags.inc_tag.loaded(): reached fill. jPublish.Tags.site.loaded() Internetwork Consulting jPublish.Tags.site.doEndTag(): End jPublish.Data.manager() jPublish.Tags.site() jPublish.Tags.site.doEndTag(): Begin jPublish.Tags.inc_tag.loaded() jPublish.Tags.inc_tag.loaded(): not instance jPublish.Data.manager.load() jPublish.Tags.inc_tag.loaded(): load ok jPublish.Tags.inc_tag.loaded(): next ok jPublish.Tags.inc_tag.loaded(): reached fill. jPublish.Tags.site.loaded() Internetwork Consulting jPublish.Tags.site.doEndTag(): End jPublish.Data.manager() jPublish.Tags.site() jPublish.Tags.site.doEndTag(): Begin jPublish.Tags.inc_tag.loaded() jPublish.Tags.inc_tag.loaded(): not instance jPublish.Data.manager.load() jPublish.Tags.inc_tag.loaded(): load ok jPublish.Tags.inc_tag.loaded(): next ok jPublish.Tags.inc_tag.loaded(): reached fill. jPublish.Tags.site.loaded() Shawn jPublish.Tags.site.doEndTag(): End jPublish.Data.manager() jPublish.Tags.site() jPublish.Tags.site.setSite() jPublish.Data.manager() jPublish.Tags.site.doEndTag(): Begin jPublish.Tags.site.doEndTag(): End jPublish.Data.manager() jPublish.Tags.site() jPublish.Tags.site.doEndTag(): Begin jPublish.Tags.inc_tag.loaded() jPublish.Tags.inc_tag.loaded(): not instance jPublish.Data.manager.load() jPublish.Tags.inc_tag.loaded(): load ok jPublish.Tags.inc_tag.loaded(): next ok jPublish.Tags.inc_tag.loaded(): reached fill. jPublish.Tags.site.loaded() Internetwork Consulting jPublish.Tags.site.doEndTag(): End jPublish.Data.manager() jPublish.Tags.site() jPublish.Tags.site.doEndTag(): Begin jPublish.Tags.inc_tag.loaded() jPublish.Tags.inc_tag.loaded(): not instance jPublish.Data.manager.load() jPublish.Tags.inc_tag.loaded(): load ok jPublish.Tags.inc_tag.loaded(): next ok jPublish.Tags.inc_tag.loaded(): reached fill. jPublish.Tags.site.loaded() Internetwork Consulting jPublish.Tags.site.doEndTag(): End
RE: Forwarding control
James, Use response.sendRedirect() instead of the RequestDispatcher. That will change the URL in the browser. If you want to stick with the RequestDispatcher, you'll have to add some logic to catch a resubmission of the same data (possibly use a hidden field in your forms with a unique identifier, random number, timestamp, etc... and record those in the user session or a backend database) and skip over processing and go straight to the result.jsp. Hope that helps. Mike -Original Message- From: James Michelich [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 4:50 PM To: [EMAIL PROTECTED] Subject: Forwarding control Hello, any help would be much appreciated. The basic scenario is as follows - I have a form page called form.jsp (http://localhost/webapp/form.jsp). Upon submission, the form data is processed by a servlet mapped to the url '/process' (http://localhost/webapp/process). Once the servlet has completed processing the form data, it forwards control to a results page (http://localhost/webapp/result.jsp) via RequestDispatcher dispatch = request.getRequestDispatcher (forwardPath); dispatch.forward(request, response); My question is this - although control has been forwarded to the results page, the browser's url is still http://localhost/webapp/process, which is ok with me; however, if the page is refreshed, the browser prompts for the form data to be resubmitted and the processing is repeated (which for my application happens to be quite substantial), rather than refreshing the contents of the results page. I suppose this is a minor annoyance that could be worked around by displaying a link to the results page rather than forwarding directly to it, but I'd rather implement the latter. Does anyone know of a solution or workaround for this problem? Thanks in advance, James - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Custom Tag Lib
Hi Shawn, Actually, I wasn't aware that there was an option to disable it. When I figured out what was happening, I went ahead and handled it in my code. No telling how other application servers might handle it. If you're only going to be deploying on Tomcat, disabling pooling would probably save you some time, but you still might want to handle it in your code to get better performance. Mike -Original Message- From: Shawn Zernik [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 11:41 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: Custom Tag Lib Mike: Thanks so very much... I saw their is a config option in the Jasper to turn off tag pooling. do you thing that would work too, of shouldI impliment it in my source code. I'm gonna take a look at it right now. Shawn -Original Message- From: Mike Cherichetti (Renegade Internet) [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 10:28 PM To: Tomcat Users List Subject: RE: Custom Tag Lib Shawn, I ran into this problem as well when switching from 4.0 to 4.1. I think it has something to do with 4.1 pooling and re-using tag objects. What I did in all of my doStartTag(), doAfterBody(), etc... methods was manually call release() to reset the data in the tags like so: public int doStartTag() throws JspException { try { ... } catch (Exception exception) { throw new JspException(exception); } finally { release(); } return SKIP_BODY; } Have a nice day ... Sincerely, Mike Cherichetti Renegade Internet Internet Advertising Delivery Solutions www.renegadeinternet.com Phone (724) 658-6346 Fax (724) 658-6346 -Original Message- From: Shawn Zernik [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 10:56 PM To: [EMAIL PROTECTED] Subject: Custom Tag Lib Tomcat Users: I've been fighting with some version differences in tom cat wondering why my app acts severly different on Tomcat 4.1.27 then 4.0.6. It appears that 4.1.27 is not working from my perspective, and have been fighting with it since monday. None of the books I have touch this subject or ellude to the problem, and I've seached high and low for solutions. I'm having a problem working with my custom tag library. The stange part to this is it appears to work on tomcat 4.0.6 but not on 4.1.27. The library has a tage called site that extends a base tag, and those tags use other classes in my data namespace to hit a database. The tags are returning the proper data in both versions, but in 4.1.27, I have to reload the contect in the manager for it to register the changes from the database. I have added some printlns to std out to track what's going on. In tomcat 4.0.6 they are going through all the code as I would exspect it to. I have included each of the class files that are called. I have also included the printouts from both versions of tomcat to clierify how each version is handling the calls. The object hiarchey goes as follows: jPublish.Tags site extends inc_tag. jPublish.Data.site_manager extends jPublish.Data.manager, managers contain, load, and fill datas. jPublish.Data.site_data extends jPublish.Data.data, used for storing data and tracking updates. --- INDEX.JSP --- %@ page contentType=text/html % %@ taglib prefix=inc uri=inc % inc:site site=1 action=none/ html headtitleinc:site action=title //title/head body h1Welcome to inc:site action=title/!/h1 copy; inc:site action=copyright/ /body /html --- TOMCAT 4.0.6 STDOUT --- Starting service Tomcat-Standalone Apache Tomcat/4.0.6 Starting service Tomcat-Apache Apache Tomcat/4.0.6 jPublish.Data.manager() jPublish.Tags.site() jPublish.Tags.site.setSite() jPublish.Data.manager() jPublish.Tags.site.doEndTag(): Begin jPublish.Tags.site.doEndTag(): End jPublish.Data.manager() jPublish.Tags.site() jPublish.Tags.site.doEndTag(): Begin jPublish.Tags.inc_tag.loaded() jPublish.Tags.inc_tag.loaded(): not instance jPublish.Data.manager.load() jPublish.Tags.inc_tag.loaded(): load ok jPublish.Tags.inc_tag.loaded(): next ok jPublish.Tags.inc_tag.loaded(): reached fill. jPublish.Tags.site.loaded() Internetwork Consulting jPublish.Tags.site.doEndTag(): End jPublish.Data.manager() jPublish.Tags.site() jPublish.Tags.site.doEndTag(): Begin jPublish.Tags.inc_tag.loaded() jPublish.Tags.inc_tag.loaded(): not instance jPublish.Data.manager.load() jPublish.Tags.inc_tag.loaded(): load ok jPublish.Tags.inc_tag.loaded(): next ok jPublish.Tags.inc_tag.loaded(): reached fill. jPublish.Tags.site.loaded() Internetwork Consulting jPublish.Tags.site.doEndTag(): End jPublish.Data.manager() jPublish.Tags.site() jPublish.Tags.site.doEndTag(): Begin jPublish.Tags.inc_tag.loaded() jPublish.Tags.inc_tag.loaded(): not instance jPublish.Data.manager.load() jPublish.Tags.inc_tag.loaded(): load ok jPublish.Tags.inc_tag.loaded(): next ok jPublish.Tags.inc_tag.loaded(): reached fill. jPublish.Tags.site.loaded() Shawn
RE: Custom Tag Lib
I should have been more clear. If you have tags without body content, call release() at the end of doStartTag(). If you have tags with body content, call release() at the end of doAfterBody(). This has worked rather well for me. Perhaps implement TryCatchFinally would be a little cleaner. Mike -Original Message- From: Jon Wingfield [mailto:[EMAIL PROTECTED] Sent: Friday, August 08, 2003 5:08 AM To: Tomcat Users List Subject: Re: Custom Tag Lib Yikes, calling release() in doStartTag() stops any state being accessible to child (body) tags. That would kill our custom iterator tags. You could have your tags implement the TryCatchFinally interface, instead. That way you'll have a chance to reset state before reuse: http://jakarta.apache.org/taglibs/guidelines.html I've seen posts on this list saying that tag pooling has either made their site a dog or has given a huge positive performance gain. For our site, which has many tags per page, it is the latter case :) If you're thinking about turning pooling off you'll need to test the effects on performance. Jon PS We had to go through this process on the upgrade. I share your pain Mike Cherichetti (Renegade Internet) wrote: Shawn, I ran into this problem as well when switching from 4.0 to 4.1. I think it has something to do with 4.1 pooling and re-using tag objects. What I did in all of my doStartTag(), doAfterBody(), etc... methods was manually call release() to reset the data in the tags like so: public int doStartTag() throws JspException { try { ... } catch (Exception exception) { throw new JspException(exception); } finally { release(); } return SKIP_BODY; } Have a nice day ... Sincerely, Mike Cherichetti Renegade Internet Internet Advertising Delivery Solutions www.renegadeinternet.com Phone (724) 658-6346 Fax (724) 658-6346 -Original Message- From: Shawn Zernik [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 10:56 PM To: [EMAIL PROTECTED] Subject: Custom Tag Lib Tomcat Users: I've been fighting with some version differences in tom cat wondering why my app acts severly different on Tomcat 4.1.27 then 4.0.6. It appears that 4.1.27 is not working from my perspective, and have been fighting with it since monday. None of the books I have touch this subject or ellude to the problem, and I've seached high and low for solutions. I'm having a problem working with my custom tag library. The stange part to this is it appears to work on tomcat 4.0.6 but not on 4.1.27. The library has a tage called site that extends a base tag, and those tags use other classes in my data namespace to hit a database. The tags are returning the proper data in both versions, but in 4.1.27, I have to reload the contect in the manager for it to register the changes from the database. I have added some printlns to std out to track what's going on. In tomcat 4.0.6 they are going through all the code as I would exspect it to. I have included each of the class files that are called. I have also included the printouts from both versions of tomcat to clierify how each version is handling the calls. The object hiarchey goes as follows: jPublish.Tags site extends inc_tag. jPublish.Data.site_manager extends jPublish.Data.manager, managers contain, load, and fill datas. jPublish.Data.site_data extends jPublish.Data.data, used for storing data and tracking updates. --- INDEX.JSP --- %@ page contentType=text/html % %@ taglib prefix=inc uri=inc % inc:site site=1 action=none/ html headtitleinc:site action=title //title/head body h1Welcome to inc:site action=title/!/h1 copy; inc:site action=copyright/ /body /html --- TOMCAT 4.0.6 STDOUT --- Starting service Tomcat-Standalone Apache Tomcat/4.0.6 Starting service Tomcat-Apache Apache Tomcat/4.0.6 jPublish.Data.manager() jPublish.Tags.site() jPublish.Tags.site.setSite() jPublish.Data.manager() jPublish.Tags.site.doEndTag(): Begin jPublish.Tags.site.doEndTag(): End jPublish.Data.manager() jPublish.Tags.site() jPublish.Tags.site.doEndTag(): Begin jPublish.Tags.inc_tag.loaded() jPublish.Tags.inc_tag.loaded(): not instance jPublish.Data.manager.load() jPublish.Tags.inc_tag.loaded(): load ok jPublish.Tags.inc_tag.loaded(): next ok jPublish.Tags.inc_tag.loaded(): reached fill. jPublish.Tags.site.loaded() Internetwork Consulting jPublish.Tags.site.doEndTag(): End jPublish.Data.manager() jPublish.Tags.site() jPublish.Tags.site.doEndTag(): Begin jPublish.Tags.inc_tag.loaded() jPublish.Tags.inc_tag.loaded(): not instance jPublish.Data.manager.load() jPublish.Tags.inc_tag.loaded(): load ok jPublish.Tags.inc_tag.loaded(): next ok jPublish.Tags.inc_tag.loaded(): reached fill. jPublish.Tags.site.loaded() Internetwork Consulting jPublish.Tags.site.doEndTag(): End jPublish.Data.manager() jPublish.Tags.site
Tuning KeepAlive Connections?
RedHat Linux 7.3 IBM JDK 1.4.1 Tomcat 4.1.24 Is it possible to disable KeepAlive connections with the Coyote HTTP/1.1 connector? If it's not possible to turn them off, is it possible to lower the request limit and timeout period for them? Have a nice day ... Sincerely, Mike Cherichetti Renegade Internet www.renegadeinternet.com Phone (724) 658-6346 Fax (724) 658-6346 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tuning KeepAlive Connections?
Hi Bill, Thanks for the info! Looks like that helped, but I can't tell for sure because the server isn't loaded too much right now. Will have to wait until morning to find out. Did I miss something or is that not in the docs? Might be good to add this to the docs :) Thanks again, Mike -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Bill Barker Sent: Friday, August 08, 2003 12:00 AM To: [EMAIL PROTECTED] Subject: Re: Tuning KeepAlive Connections? You can (effectively) disable KeepAlive connections by setting the 'maxKeepAliveRequests=1' attribute on the Connector. Tomcat 5 has a more intuitive option, but it works the same way. If you have the maxKeepAliveRequests 1, then the 'connectionTimeout' attribute on the Connector determines how long it will wait for the next request. Mike Cherichetti (Renegade Internet) [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] RedHat Linux 7.3 IBM JDK 1.4.1 Tomcat 4.1.24 Is it possible to disable KeepAlive connections with the Coyote HTTP/1.1 connector? If it's not possible to turn them off, is it possible to lower the request limit and timeout period for them? Have a nice day ... Sincerely, Mike Cherichetti Renegade Internet www.renegadeinternet.com Phone (724) 658-6346 Fax (724) 658-6346 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]