Re: HOWTO disable Tomcat from caching dynamic picture
Tomcat does not cache output of a servlet. By definition the output of a servlet is dynamic and as such has no reason to be cached. The image is probably cached somewhere else... John Mok a écrit : Hi, I am using Tomcat 5.5.17 with Sun JDK 5.0 Update 7 on CentOS 4.3. I have a servlet, namely BMPImageViewer, which retrieves a BMP image from database with conversion into PNG format via JAI. The servlet is referenced in XSL-FO for PDF generation. My problem was that the image did not change even the image in database updated. I checked that the servlet BMPImageViewer worked correctly and loaded the correct image every time. The servlet outputs the image with header set to no-cache :- response.setHeader(Pragma, no-cache); response.setHeader(Expires, -1); How to force Tomcat not to cache the dynamic image? and load a new one every time? I hope someone could help me out and advise how to configure Tomcat not to cache dynamic image. Thanks a lot. John Mok - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HOWTO disable Tomcat from caching dynamic picture
left out setDateHeader response.setDateHeader(Expires, 1); response.setHeader(Pragma, no-cache); response.setHeader(Cache-Control, no-cache); Not much to recommend until we see the code which does the conversion (assuming JPG to PNG) Anyone else ? Martin -- * This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: david.delbecq [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Sunday, October 01, 2006 5:47 AM Subject: Re: HOWTO disable Tomcat from caching dynamic picture Tomcat does not cache output of a servlet. By definition the output of a servlet is dynamic and as such has no reason to be cached. The image is probably cached somewhere else... John Mok a écrit : Hi, I am using Tomcat 5.5.17 with Sun JDK 5.0 Update 7 on CentOS 4.3. I have a servlet, namely BMPImageViewer, which retrieves a BMP image from database with conversion into PNG format via JAI. The servlet is referenced in XSL-FO for PDF generation. My problem was that the image did not change even the image in database updated. I checked that the servlet BMPImageViewer worked correctly and loaded the correct image every time. The servlet outputs the image with header set to no-cache :- response.setHeader(Pragma, no-cache); response.setHeader(Expires, -1); How to force Tomcat not to cache the dynamic image? and load a new one every time? I hope someone could help me out and advise how to configure Tomcat not to cache dynamic image. Thanks a lot. John Mok - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HOWTO disable Tomcat from caching dynamic picture
Hey John, Tomcat does not do any caching. Try adding these HTTP headers: response.addHeader(Pragma,no-cache); // HTTP/1.0 response.addHeader(Cache-control,no-cache, no-store); // HTTP/1.1 That's the official way. However, due to an IE4-IE6 bug, you might want to replace the second one by: response.setHeader(Cache-control,max-age=0); // HTTP/1.1 More info see: http://forum.java.sun.com/thread.jspa?threadID=233446start=0 Worked fine for me! Regards, Paul Hamer management development [EMAIL PROTECTED] toHAVE websolutions www.tohave.nl [EMAIL PROTECTED] -Original Message- From: John Mok [mailto:[EMAIL PROTECTED] Sent: Sunday, 01 October 2006 02:46 To: users@tomcat.apache.org Subject: HOWTO disable Tomcat from caching dynamic picture Hi, I am using Tomcat 5.5.17 with Sun JDK 5.0 Update 7 on CentOS 4.3. I have a servlet, namely BMPImageViewer, which retrieves a BMP image from database with conversion into PNG format via JAI. The servlet is referenced in XSL-FO for PDF generation. My problem was that the image did not change even the image in database updated. I checked that the servlet BMPImageViewer worked correctly and loaded the correct image every time. The servlet outputs the image with header set to no-cache :- response.setHeader(Pragma, no-cache); response.setHeader(Expires, -1); How to force Tomcat not to cache the dynamic image? and load a new one every time? I hope someone could help me out and advise how to configure Tomcat not to cache dynamic image. Thanks a lot. John Mok - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HOWTO disable Tomcat from caching dynamic picture
Hi If all else fails, try to add a timestamp variable to the link. By dynamically adding a unique timestamp like http://foo.com/document.jsp?time=[timestamp] the page will not be cached. Regards Roland Rabben -Original Message- From: Paul Hamer [mailto:[EMAIL PROTECTED] Sent: 1. oktober 2006 16:16 To: 'Tomcat Users List' Subject: RE: HOWTO disable Tomcat from caching dynamic picture Hey John, Tomcat does not do any caching. Try adding these HTTP headers: response.addHeader(Pragma,no-cache); // HTTP/1.0 response.addHeader(Cache-control,no-cache, no-store); // HTTP/1.1 That's the official way. However, due to an IE4-IE6 bug, you might want to replace the second one by: response.setHeader(Cache-control,max-age=0); // HTTP/1.1 More info see: http://forum.java.sun.com/thread.jspa?threadID=233446start=0 Worked fine for me! Regards, Paul Hamer management development [EMAIL PROTECTED] toHAVE websolutions www.tohave.nl [EMAIL PROTECTED] -Original Message- From: John Mok [mailto:[EMAIL PROTECTED] Sent: Sunday, 01 October 2006 02:46 To: users@tomcat.apache.org Subject: HOWTO disable Tomcat from caching dynamic picture Hi, I am using Tomcat 5.5.17 with Sun JDK 5.0 Update 7 on CentOS 4.3. I have a servlet, namely BMPImageViewer, which retrieves a BMP image from database with conversion into PNG format via JAI. The servlet is referenced in XSL-FO for PDF generation. My problem was that the image did not change even the image in database updated. I checked that the servlet BMPImageViewer worked correctly and loaded the correct image every time. The servlet outputs the image with header set to no-cache :- response.setHeader(Pragma, no-cache); response.setHeader(Expires, -1); How to force Tomcat not to cache the dynamic image? and load a new one every time? I hope someone could help me out and advise how to configure Tomcat not to cache dynamic image. Thanks a lot. John Mok - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struggling with basic database connection
Alan, Did you ever resolve this? I don't have enough information here to help you. Thanks, John Najarian --- Alan Chandler [EMAIL PROTECTED] wrote: On Saturday 23 September 2006 15:23, David Smith wrote: Correction: context.xml belongs in META-INF of the war archive. I have just conducted experiments with Tomcat 5.0 putting a context.xml file in META-INF doesn't appear to work I have not been having success with putting in conf/server.xml - but I have had success with putting the context in conf/Catalina/localhost/akcmoney.xml -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struggling with basic database connection
On Sunday 01 October 2006 17:27, John Najarian wrote: Alan, Did you ever resolve this? I don't have enough information here to help you. ... Sort of ... The WTP plugin for eclipse copies what is in META-INF/context.xml and writes it into CATALINA_BASE/conf/server.xml. So for tomcat5.0, I have relied on testing/debuging like that so far, and achieving the same manually when I come to deploy on the production server. At some stage soon, I will be changing to tomcat 5.5 but I am not sure where to go to make things work then, as I am still not sure there is any definitive guide to where these things go and how tomcat deals with a META-INF/context.xml --- Alan Chandler [EMAIL PROTECTED] wrote: On Saturday 23 September 2006 15:23, David Smith wrote: Correction: context.xml belongs in META-INF of the war archive. I have just conducted experiments with Tomcat 5.0 putting a context.xml file in META-INF doesn't appear to work I have not been having success with putting in conf/server.xml - but I have had success with putting the context in conf/Catalina/localhost/akcmoney.xml -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struggling with basic database connection
Alan- context.xml identified Naming and Session management items more info available at http://tomcat.apache.org/tomcat-5.0-doc/deployer-howto.html HTH Martin -- * This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: Alan Chandler [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Sunday, October 01, 2006 1:42 PM Subject: Re: Struggling with basic database connection On Sunday 01 October 2006 17:27, John Najarian wrote: Alan, Did you ever resolve this? I don't have enough information here to help you. ... Sort of ... The WTP plugin for eclipse copies what is in META-INF/context.xml and writes it into CATALINA_BASE/conf/server.xml. So for tomcat5.0, I have relied on testing/debuging like that so far, and achieving the same manually when I come to deploy on the production server. At some stage soon, I will be changing to tomcat 5.5 but I am not sure where to go to make things work then, as I am still not sure there is any definitive guide to where these things go and how tomcat deals with a META-INF/context.xml --- Alan Chandler [EMAIL PROTECTED] wrote: On Saturday 23 September 2006 15:23, David Smith wrote: Correction: context.xml belongs in META-INF of the war archive. I have just conducted experiments with Tomcat 5.0 putting a context.xml file in META-INF doesn't appear to work I have not been having success with putting in conf/server.xml - but I have had success with putting the context in conf/Catalina/localhost/akcmoney.xml -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
IIS 6.0 with JK 1.2.19
I have followed the instructions at http://reynir.net/java/greinar/nr/52/ath but have managed to not get it right. My ISAPI Filter does not show any arrow in the status column, red or green. The Priority is * Unknown * and the Enable button is grayed. Are there any special instructions for 1.2.19? I did create the Web Services Extension, called it jakarta, and have rebooted numerous times. The ISAPI filter is defined against the Default Web Site. I saw the message from Mladen about 1.2.18 needing a rewrite_rule_file, does that still need to be done for 1.2.19? Mitchell Fisher - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Apache Tomcat\Windows XP\page not found
It happens when I attempt to acess the Apache Tomcat page http://localhost:8080. The browser is IE 6.0, running under Windows XP. I checked Control Panel - Administrative Tools - Services, and lists ApaAche Tomcat as neither Started nor Stopped. After I manually start it and try accessing the Apache Tomcat page, the same thing happens, either the browser displays a blank page or gives me the page not found error. Yes, I did try accessing through http://localhost:8080 and not 808; again, error msg or a blank page. Any assistance is appreciated. Thanks. fjm What is giving you this error? Is this from the browser, or something from a startup script? Check your services (Control Panel-Administrative tools-Services), and make sure the Tomcat service has started. If it hasn't go ahead and start it from the Services control panel. You shouldn't need to run anything from the command line to start or use Tomcat. If it's failing to start, check the Catalina and Jakarta_service log files under $INSTALLDIR\logs. You're trying to connect to http://localhost:8080/;, right? I remember spending a good ten minutes once after I fumble-fingered the URL to port 808, trying to figure out why Tomcat wasn't responding. ;) --- Tracy Nelson / Nelnet Business Solutions 402 / 617-9449 | -Original Message- | From: Frank J Murray [mailto:[EMAIL PROTECTED] | Sent: Thursday, 28 September, 2006 22:30 | To: Tomcat Users List | Subject: Apache Tomcat\Windows XP\page not found error | | Hello, | |This is a new post, and I am a newbie (at least to Apache Tomcat on | Windows). | | I went to the Apache.org website and downloaded and installed the | Windows executable under Core distributions, i.e., | | Core: | a.. zip (pgp, md5) | b.. tar.gz (pgp, md5) | c.. Windows Executable (pgp, md5) | The install went fine, but when I try to start Apache Tomcat, it just | gives me the standard error message, unable to connect. | | This happens even after I start the Apache service known as | Configure Tomcat within the Apache Tomcat folder (or directory). | | I'm guessing I need to install one or two other important files or apps, | as well as do some configuring, similar to setting JAVA_HOME, and | executing (./ in Unix) the startup file (or .bat) in Windows. | | Any information is appreciated. Thanks. | | fjm
threads, performance, and exceptions
I have an application that links users so they can chat. My client operates within a browser. To be firewall friendly and avoid client server sockets listening for incoming requests, I implemented the client so that it makes http requests and sits and waits (maybe for minutes on end) until it gets a response. And each client has 2 threads that are constantly waiting for an http response from 2 different urls (which ties up 2 servlet threads). I knew full well that this would be thread heavy on the tomcat server side but thought I'd try it out. The server is tomcat 5.5.20 running on Windows XP Pro with 1GB of RAM. After some preliminary load testing, I find I'm able to handle about 500 simulated users (each sending a message every 30 seconds) concurrently communicating before getting connection refused messages. I would like to improve that. So with each client having 2 threads constantly waiting on servlet requests, that's 2 servlet threads per client or 1000 threads on the server, which seems like a lot to me. With 500 clients communicating every 30 seconds, fairly evenly distributed, that's about 16 requests per second. It seems like I should be able to do better than that. Initially when running my load test, I ran into OutOfMemoryErrors: unable to create new native thread. Lowering the thread stack size in Tomcat's configuration dialog seemed to help. Now the limiting issue is that my clients receive connection timed out and read timed out messages. On the client I see the following stacks: java.net.ConnectException: Connection timed out: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at sun.net.NetworkClient.doConnect(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.init(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) at com.seekspeak.applet.URLTalker.initConnection(URLTalker.java:44) at com.seekspeak.applet.URLTalker.send(URLTalker.java:50) at com.seekspeak.test.load.RecipientTest$RefreshThread.run(RecipientTest.java:206) java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(Unknown Source) at java.io.BufferedInputStream.fill(Unknown Source) at java.io.BufferedInputStream.read1(Unknown Source) at java.io.BufferedInputStream.read(Unknown Source) at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source) at sun.net.www.http.HttpClient.parseHTTP(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So urce) at java.net.HttpURLConnection.getResponseCode(Unknown Source) at com.seekspeak.applet.URLTalker.send(URLTalker.java:54) at com.seekspeak.test.load.Communicator$ListenThread.run(Communicator.ja va:217) In the catalina log, the only problem I see is this stack: Oct 1, 2006 7:59:01 PM org.apache.catalina.core.StandardWrapperValve invoke WARNING: Servlet.service() for servlet invoker threw exception java.net.SocketException: Connection reset at java.net.SocketInputStream.read(Unknown Source) at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:747) at org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:777) at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:115) at org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:712) at org.apache.coyote.Request.doRead(Request.java:418) ... CPU-wise the server never breaks a sweat, rarely rising above 5% cpu. My load test client is running on a separate machine from the server. My question is: how can I best improve the performance? Is the server really refusing client connections or is the load test bogging down and reporting spurious messages (the load test uses many threads as well)? Is the high # of threads on the server a problem? Would running on Linux or another OS help? Is there a way for me to minimize the # of servlet threads required? Since my servlet threads don't really do anything but sit around blocking until being notified to complete the client's request, it seems like I could just have a small number of threads and keep