Re: tomcat caching issue
Based on everything written so far - there is no evidence tomcat would be chaching anything. I'd suggest placing as much debug code in your code as possible via a logging pacakge such as log4j/commons-logging so the log information can be turned on via configuration directives. -Tim Santosh Asbe wrote: Hi All, I need your help for this problem very urgently. I have tomcat 4.1.30 on Linux. It servers as a web server and contains only JSP Servlets. We make a remote call to Websphere Application Server ( on AIX) using corbaloc like 'corbaloc::ip1:2809:ip2:2809'. Now when i one of my App server fails, the other App Server server should take over. This work when i use a simple java client on the Linux machine, the failover occurs. But when i use my application in tomcat, this does not work. I am using a Service locator ( singleton) which makes the initial call to App Server and stores in the ip cache. initially we that the issue was with the Service locator, but then even if i don't use this Service Locator, the problem persists. We have talked to IBM and they say that the tomcat does some caching and the problem is not with the App Server. Has anyone faced this issue? Can anyone help regarding this and how can i know how and where the caching is done? Can this issue be resolved. If any other information is required, i will be glad to provide with the same. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat caching issue
Hi All, I need your help for this problem very urgently. I have tomcat 4.1.30 on Linux. It servers as a web server and contains only JSP Servlets. We make a remote call to Websphere Application Server ( on AIX) using corbaloc like 'corbaloc::ip1:2809:ip2:2809'. Now when i one of my App server fails, the other App Server server should take over. This work when i use a simple java client on the Linux machine, the failover occurs. But when i use my application in tomcat, this does not work. I am using a Service locator ( singleton) which makes the initial call to App Server and stores in the ip cache. initially we that the issue was with the Service locator, but then even if i don't use this Service Locator, the problem persists. We have talked to IBM and they say that the tomcat does some caching and the problem is not with the App Server. Has anyone faced this issue? Can anyone help regarding this and how can i know how and where the caching is done? Can this issue be resolved. If any other information is required, i will be glad to provide with the same. regards, Santosh Asbe *** This message is for the named addressees' use only. It may contain NSDL confidential, proprietary or legally privileged information. If you receive this message in error, please immediately delete it. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient.Unless otherwise stated, any commercial information given in this message does not constitute an offer to deal on any terms quoted. Any reference to the terms of executed transactions should be treated as preliminary only and subject to our formal written confirmation. ***
Image caching how to
how to enable image caching in tomcat? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Caching static content - Bug in Filter implementation?
Hello I do some further analysis in this problem and got following result: Precondition: The filter manipulates the HTTP header when returning a static resource (e.g. image). HTTP 200 In case of a HTTP 200 (OK) result the header is not added when the doFilter method is like following: filterChain.doFilter(request, response); response.setHeader(name, value); In contrast to it works when the code is like following: response.setHeader(name, value); filterChain.doFilter(request, response); In other words: When returning a HTTP 200 (OK) I must set the header before forwarding the request to the next filter. HTTP 304 In this case it doesn't mention whether setting the header is before or after forwarding the request. Any comments? Jürgen Dufner - Diese E-Mail enthaelt vertrauliche oder rechtlich geschuetzte Informationen. Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte sofort den Absender und loeschen Sie diese E-Mail. Das unbefugte Kopieren dieser E-Mail oder die unbefugte Weitergabe der enthaltenen Informationen ist nicht gestattet. The information contained in this message is confidential or protected by law. If you are not the intended recipient, please contact the sender and delete this message. Any unauthorised copying of this message or unauthorised distribution of the information contained herein is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Caching static content - Bug in Filter implementation?
I think that's expected behaviour: You can't set headers after the response has been committed (more body data has been written to the outputstream than the buffer size). In the case of the 200 response code the call to filterChain.doFilter(...) actually serves the content. Setting of the header after this is too late. Jon [EMAIL PROTECTED] wrote: Hello I do some further analysis in this problem and got following result: Precondition: The filter manipulates the HTTP header when returning a static resource (e.g. image). HTTP 200 In case of a HTTP 200 (OK) result the header is not added when the doFilter method is like following: filterChain.doFilter(request, response); response.setHeader(name, value); In contrast to it works when the code is like following: response.setHeader(name, value); filterChain.doFilter(request, response); In other words: When returning a HTTP 200 (OK) I must set the header before forwarding the request to the next filter. HTTP 304 In this case it doesn't mention whether setting the header is before or after forwarding the request. Any comments? Jürgen Dufner - Diese E-Mail enthaelt vertrauliche oder rechtlich geschuetzte Informationen. Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte sofort den Absender und loeschen Sie diese E-Mail. Das unbefugte Kopieren dieser E-Mail oder die unbefugte Weitergabe der enthaltenen Informationen ist nicht gestattet. The information contained in this message is confidential or protected by law. If you are not the intended recipient, please contact the sender and delete this message. Any unauthorised copying of this message or unauthorised distribution of the information contained herein is prohibited. - 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]
Caching static content
Hello How to set the HTTP-Header Cache-Control:max-age=3600 in the Response of an image file? Here I will describe what I did: I implemented a Filter that added the header response.setHeader(Cache-Control, max-age=3600); This works, but not in every case. The first request for an image, that return HTTP Code 200 (OK) and the image itself, the header is NOT set. The second or third request for the same image return Code 304 (Not modified), the header contains Cache-Control:max-age=3600. Is there a dependency to the HTTP return code? How to supress the second and third requests? Regards, Jürgen Dufner - Diese E-Mail enthaelt vertrauliche oder rechtlich geschuetzte Informationen. Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte sofort den Absender und loeschen Sie diese E-Mail. Das unbefugte Kopieren dieser E-Mail oder die unbefugte Weitergabe der enthaltenen Informationen ist nicht gestattet. The information contained in this message is confidential or protected by law. If you are not the intended recipient, please contact the sender and delete this message. Any unauthorised copying of this message or unauthorised distribution of the information contained herein is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat and Internet Explorers caching
Hello! Our web-application uses a combination of JSP-pages and a controller servlet. When viewing these pages with Internet Explorer weird things tend to happen. I found out that if Internet Explorers caching is set to automatic checking for newer versions on the server everything goes wrong. Instead of sending requests to the servlet, IE just simply takes an answer from its cache, and thus presenting the wrong results. When changing the setting to always the problem disappears. Now, telling every user to change this setting would require almost as much work as convincing them that Firefox and/or Opera are much better. So, are there any ways to tell IE that it shouldn't cache my servlet/jsp-pages? Regards, Øyvind Johansen ElectricTimeCar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat and Internet Explorers caching
Hi, Not an answer as such, but all our dev machines (and we do LOTS of changes per 5 minutes) have Automatically switched on, and we don't experience this problem. Like I say, not a solution, but perhaps you are looking in the wrong direction. Cheers, Allistair. -Original Message- From: Øyvind Johansen [mailto:[EMAIL PROTECTED] Sent: 22 June 2005 11:11 To: 'Tomcat Users List' Subject: Tomcat and Internet Explorers caching Hello! Our web-application uses a combination of JSP-pages and a controller servlet. When viewing these pages with Internet Explorer weird things tend to happen. I found out that if Internet Explorers caching is set to automatic checking for newer versions on the server everything goes wrong. Instead of sending requests to the servlet, IE just simply takes an answer from its cache, and thus presenting the wrong results. When changing the setting to always the problem disappears. Now, telling every user to change this setting would require almost as much work as convincing them that Firefox and/or Opera are much better. So, are there any ways to tell IE that it shouldn't cache my servlet/jsp-pages? Regards, Øyvind Johansen ElectricTimeCar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat and Internet Explorers caching
You may be right, but I think it's just our weird way of combining jsp/servlets with a magnet card reader that takes IE off guard. Heres a typical example: User uses his user card on our magnet card reader. The reader tells our client (which implements IE through an ActiveX control, dont ask why). The reader creates an URL which sends the card information to a servlet as a parameter. Ie /Servler?paramname=paramval. The servlet handles the request and determines where the users should go (1 page for normal users, another for admins etc). When Automaticly is set, this makes IE return the page of the last user that was successfully using the server (in which IE saved these pages in the cache). This means that user A may get the admin interface even though he isn't an administrator. In the web-application log, nothing happens when this behaviour shows itself. The web-app always logs all user-logins, and the lack of this proves that IE simply isn't sending the request to the server... Did it become clearer? -Opprinnelig melding- Fra: Allistair Crossley [mailto:[EMAIL PROTECTED] Sendt: 22. juni 2005 12:09 Til: Tomcat Users List Emne: RE: Tomcat and Internet Explorers caching Hi, Not an answer as such, but all our dev machines (and we do LOTS of changes per 5 minutes) have Automatically switched on, and we don't experience this problem. Like I say, not a solution, but perhaps you are looking in the wrong direction. Cheers, Allistair. -Original Message- From: Øyvind Johansen [mailto:[EMAIL PROTECTED] Sent: 22 June 2005 11:11 To: 'Tomcat Users List' Subject: Tomcat and Internet Explorers caching Hello! Our web-application uses a combination of JSP-pages and a controller servlet. When viewing these pages with Internet Explorer weird things tend to happen. I found out that if Internet Explorers caching is set to automatic checking for newer versions on the server everything goes wrong. Instead of sending requests to the servlet, IE just simply takes an answer from its cache, and thus presenting the wrong results. When changing the setting to always the problem disappears. Now, telling every user to change this setting would require almost as much work as convincing them that Firefox and/or Opera are much better. So, are there any ways to tell IE that it shouldn't cache my servlet/jsp-pages? Regards, Øyvind Johansen ElectricTimeCar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - 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: Tomcat and Internet Explorers caching
hi, A solution is after submit clear a User object from the session, than identifies the user and put a User object in a session and always check on every page and action if User object exists in the session. regards, Maarten -Oorspronkelijk bericht- Van: Øyvind Johansen [mailto:[EMAIL PROTECTED] Verzonden: woensdag 22 juni 2005 12:39 Aan: 'Tomcat Users List' Onderwerp: RE: Tomcat and Internet Explorers caching You may be right, but I think it's just our weird way of combining jsp/servlets with a magnet card reader that takes IE off guard. Heres a typical example: User uses his user card on our magnet card reader. The reader tells our client (which implements IE through an ActiveX control, dont ask why). The reader creates an URL which sends the card information to a servlet as a parameter. Ie /Servler?paramname=paramval. The servlet handles the request and determines where the users should go (1 page for normal users, another for admins etc). When Automaticly is set, this makes IE return the page of the last user that was successfully using the server (in which IE saved these pages in the cache). This means that user A may get the admin interface even though he isn't an administrator. In the web-application log, nothing happens when this behaviour shows itself. The web-app always logs all user-logins, and the lack of this proves that IE simply isn't sending the request to the server... Did it become clearer? -Opprinnelig melding- Fra: Allistair Crossley [mailto:[EMAIL PROTECTED] Sendt: 22. juni 2005 12:09 Til: Tomcat Users List Emne: RE: Tomcat and Internet Explorers caching Hi, Not an answer as such, but all our dev machines (and we do LOTS of changes per 5 minutes) have Automatically switched on, and we don't experience this problem. Like I say, not a solution, but perhaps you are looking in the wrong direction. Cheers, Allistair. -Original Message- From: Øyvind Johansen [mailto:[EMAIL PROTECTED] Sent: 22 June 2005 11:11 To: 'Tomcat Users List' Subject: Tomcat and Internet Explorers caching Hello! Our web-application uses a combination of JSP-pages and a controller servlet. When viewing these pages with Internet Explorer weird things tend to happen. I found out that if Internet Explorers caching is set to automatic checking for newer versions on the server everything goes wrong. Instead of sending requests to the servlet, IE just simply takes an answer from its cache, and thus presenting the wrong results. When changing the setting to always the problem disappears. Now, telling every user to change this setting would require almost as much work as convincing them that Firefox and/or Opera are much better. So, are there any ways to tell IE that it shouldn't cache my servlet/jsp-pages? Regards, Øyvind Johansen ElectricTimeCar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - 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] -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.323 / Virus Database: 267.7.10/25 - Release Date: 21-6-2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.323 / Virus Database: 267.7.10/25 - Release Date: 21-6-2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat and Internet Explorers caching
Hi Øyvind, This works quite well for me. Place the following magic incantation at the *end* of your JSP. Specifically, place it after the closing body tag, but before the closing html tag. In context it looks like this: /body !-- Hack to disable IE caching -- head meta HTTP-EQUIV=PRAGMA CONTENT=NO-CACHE /head !-- end no-cache hack -- /html Why at the end? I dunno. Maybe someone on the list who has the answer on tap would chime in? Hope this helps. ~PST On 6/22/05, Øyvind Johansen [EMAIL PROTECTED] wrote: Hello! Our web-application uses a combination of JSP-pages and a controller servlet. When viewing these pages with Internet Explorer weird things tend to happen. I found out that if Internet Explorers caching is set to automatic checking for newer versions on the server everything goes wrong. Instead of sending requests to the servlet, IE just simply takes an answer from its cache, and thus presenting the wrong results. When changing the setting to always the problem disappears. Now, telling every user to change this setting would require almost as much work as convincing them that Firefox and/or Opera are much better. So, are there any ways to tell IE that it shouldn't cache my servlet/jsp-pages? Regards, Øyvind Johansen ElectricTimeCar - 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: caching pattern
A listing of some names, and some static content, the content is pulled from the database, but is infrequently changed From: QM [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: Tomcat Users List tomcat-user@jakarta.apache.org Subject: Re: caching pattern Date: Mon, 28 Mar 2005 18:19:28 -0600 On Mon, Mar 28, 2005 at 04:47:30PM +, Didier McGillis wrote: : Im looking for an idea of how to setup a caching pattern? That's awful vague ;) What sort of caching? Content, data, other? Depending on what you're trying to do, and your desire/willingness to use third-party tools, you may not have to write it yourself from scratch. -QM -- software -- http://www.brandxdev.net/ tech news -- http://www.RoarNetworX.com/ code scan -- http://www.JxRef.org/ - 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: caching pattern
If you are caching content, e.g. pages I would recommend using XSL to transform the data into html, or jsp if you need. At startup and then whenever it is changed. For data, implement a persistence pattern (Data extends BaseData class, Persistence extends BasePersistence class). Then for any data you want to cache extend the BaseData to override the CRUD methods to hold data in a Hashtable by key lookup (Assuming your data can be looked up using a single key). Implement a time to live Timer (Say an hour) and then every time your data is read, update its time stamp for the timer to ignore. -Original Message- From: Didier McGillis [mailto:[EMAIL PROTECTED] Sent: 29 March 2005 14:17 To: tomcat-user@jakarta.apache.org Subject: Re: caching pattern A listing of some names, and some static content, the content is pulled from the database, but is infrequently changed From: QM [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: Tomcat Users List tomcat-user@jakarta.apache.org Subject: Re: caching pattern Date: Mon, 28 Mar 2005 18:19:28 -0600 On Mon, Mar 28, 2005 at 04:47:30PM +, Didier McGillis wrote: : Im looking for an idea of how to setup a caching pattern? That's awful vague ;) What sort of caching? Content, data, other? Depending on what you're trying to do, and your desire/willingness to use third-party tools, you may not have to write it yourself from scratch. -QM -- software -- http://www.brandxdev.net/ tech news -- http://www.RoarNetworX.com/ code scan -- http://www.JxRef.org/ - 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: caching pattern
Are there any good examples of this? From: Mark Benussi [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Subject: RE: caching pattern Date: Tue, 29 Mar 2005 14:54:24 +0100 If you are caching content, e.g. pages I would recommend using XSL to transform the data into html, or jsp if you need. At startup and then whenever it is changed. For data, implement a persistence pattern (Data extends BaseData class, Persistence extends BasePersistence class). Then for any data you want to cache extend the BaseData to override the CRUD methods to hold data in a Hashtable by key lookup (Assuming your data can be looked up using a single key). Implement a time to live Timer (Say an hour) and then every time your data is read, update its time stamp for the timer to ignore. -Original Message- From: Didier McGillis [mailto:[EMAIL PROTECTED] Sent: 29 March 2005 14:17 To: tomcat-user@jakarta.apache.org Subject: Re: caching pattern A listing of some names, and some static content, the content is pulled from the database, but is infrequently changed From: QM [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: Tomcat Users List tomcat-user@jakarta.apache.org Subject: Re: caching pattern Date: Mon, 28 Mar 2005 18:19:28 -0600 On Mon, Mar 28, 2005 at 04:47:30PM +, Didier McGillis wrote: : Im looking for an idea of how to setup a caching pattern? That's awful vague ;) What sort of caching? Content, data, other? Depending on what you're trying to do, and your desire/willingness to use third-party tools, you may not have to write it yourself from scratch. -QM -- software -- http://www.brandxdev.net/ tech news -- http://www.RoarNetworX.com/ code scan -- http://www.JxRef.org/ - 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: caching pattern
The content or the data? -Original Message- From: Didier McGillis [mailto:[EMAIL PROTECTED] Sent: 29 March 2005 15:59 To: tomcat-user@jakarta.apache.org Subject: RE: caching pattern Are there any good examples of this? From: Mark Benussi [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Subject: RE: caching pattern Date: Tue, 29 Mar 2005 14:54:24 +0100 If you are caching content, e.g. pages I would recommend using XSL to transform the data into html, or jsp if you need. At startup and then whenever it is changed. For data, implement a persistence pattern (Data extends BaseData class, Persistence extends BasePersistence class). Then for any data you want to cache extend the BaseData to override the CRUD methods to hold data in a Hashtable by key lookup (Assuming your data can be looked up using a single key). Implement a time to live Timer (Say an hour) and then every time your data is read, update its time stamp for the timer to ignore. -Original Message- From: Didier McGillis [mailto:[EMAIL PROTECTED] Sent: 29 March 2005 14:17 To: tomcat-user@jakarta.apache.org Subject: Re: caching pattern A listing of some names, and some static content, the content is pulled from the database, but is infrequently changed From: QM [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: Tomcat Users List tomcat-user@jakarta.apache.org Subject: Re: caching pattern Date: Mon, 28 Mar 2005 18:19:28 -0600 On Mon, Mar 28, 2005 at 04:47:30PM +, Didier McGillis wrote: : Im looking for an idea of how to setup a caching pattern? That's awful vague ;) What sort of caching? Content, data, other? Depending on what you're trying to do, and your desire/willingness to use third-party tools, you may not have to write it yourself from scratch. -QM -- software -- http://www.brandxdev.net/ tech news -- http://www.RoarNetworX.com/ code scan -- http://www.JxRef.org/ - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: caching pattern
data, or as they say in new england datur From: Mark Benussi [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Subject: RE: caching pattern Date: Tue, 29 Mar 2005 16:01:08 +0100 The content or the data? -Original Message- From: Didier McGillis [mailto:[EMAIL PROTECTED] Sent: 29 March 2005 15:59 To: tomcat-user@jakarta.apache.org Subject: RE: caching pattern Are there any good examples of this? From: Mark Benussi [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Subject: RE: caching pattern Date: Tue, 29 Mar 2005 14:54:24 +0100 If you are caching content, e.g. pages I would recommend using XSL to transform the data into html, or jsp if you need. At startup and then whenever it is changed. For data, implement a persistence pattern (Data extends BaseData class, Persistence extends BasePersistence class). Then for any data you want to cache extend the BaseData to override the CRUD methods to hold data in a Hashtable by key lookup (Assuming your data can be looked up using a single key). Implement a time to live Timer (Say an hour) and then every time your data is read, update its time stamp for the timer to ignore. -Original Message- From: Didier McGillis [mailto:[EMAIL PROTECTED] Sent: 29 March 2005 14:17 To: tomcat-user@jakarta.apache.org Subject: Re: caching pattern A listing of some names, and some static content, the content is pulled from the database, but is infrequently changed From: QM [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: Tomcat Users List tomcat-user@jakarta.apache.org Subject: Re: caching pattern Date: Mon, 28 Mar 2005 18:19:28 -0600 On Mon, Mar 28, 2005 at 04:47:30PM +, Didier McGillis wrote: : Im looking for an idea of how to setup a caching pattern? That's awful vague ;) What sort of caching? Content, data, other? Depending on what you're trying to do, and your desire/willingness to use third-party tools, you may not have to write it yourself from scratch. -QM -- software -- http://www.brandxdev.net/ tech news -- http://www.RoarNetworX.com/ code scan -- http://www.JxRef.org/ - 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] - 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: caching pattern
Ill put something together and send it to you, not the list as I think people mind large files being posted. Will try and get it out by 5pm BST -Original Message- From: Didier McGillis [mailto:[EMAIL PROTECTED] Sent: 29 March 2005 18:12 To: tomcat-user@jakarta.apache.org Subject: RE: caching pattern data, or as they say in new england datur From: Mark Benussi [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Subject: RE: caching pattern Date: Tue, 29 Mar 2005 16:01:08 +0100 The content or the data? -Original Message- From: Didier McGillis [mailto:[EMAIL PROTECTED] Sent: 29 March 2005 15:59 To: tomcat-user@jakarta.apache.org Subject: RE: caching pattern Are there any good examples of this? From: Mark Benussi [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Subject: RE: caching pattern Date: Tue, 29 Mar 2005 14:54:24 +0100 If you are caching content, e.g. pages I would recommend using XSL to transform the data into html, or jsp if you need. At startup and then whenever it is changed. For data, implement a persistence pattern (Data extends BaseData class, Persistence extends BasePersistence class). Then for any data you want to cache extend the BaseData to override the CRUD methods to hold data in a Hashtable by key lookup (Assuming your data can be looked up using a single key). Implement a time to live Timer (Say an hour) and then every time your data is read, update its time stamp for the timer to ignore. -Original Message- From: Didier McGillis [mailto:[EMAIL PROTECTED] Sent: 29 March 2005 14:17 To: tomcat-user@jakarta.apache.org Subject: Re: caching pattern A listing of some names, and some static content, the content is pulled from the database, but is infrequently changed From: QM [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: Tomcat Users List tomcat-user@jakarta.apache.org Subject: Re: caching pattern Date: Mon, 28 Mar 2005 18:19:28 -0600 On Mon, Mar 28, 2005 at 04:47:30PM +, Didier McGillis wrote: : Im looking for an idea of how to setup a caching pattern? That's awful vague ;) What sort of caching? Content, data, other? Depending on what you're trying to do, and your desire/willingness to use third-party tools, you may not have to write it yourself from scratch. -QM -- software -- http://www.brandxdev.net/ tech news -- http://www.RoarNetworX.com/ code scan -- http://www.JxRef.org/ - 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] - 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]
caching pattern
Im looking for an idea of how to setup a caching pattern? I left my tomcat book elsewhere and feel lost. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AutoReply: caching pattern
Hello Tomcat Users List tomcat-user@jakarta.apache.org, This refers to your mail with subject as caching pattern. Thank you for sending your CV and registering with A.S. Consultancy Services. Our team will review your CV and match it against current requirements. If your profile matches with any ongoing opening, we will contact you by telephone / email. We recommend that you update your profile and send us an updated CV whenever your contact details or your career path changes, so that your record is up-to-date with us. Please be assured that your CV will remain confidential with us and we will submit your profile to our clients only after due consultation with you. In case you require any further information please do contact us. with warm regards, Staffing Team A.S. Consultancy Services #1205, 2nd Main, 2nd Cross, Vijayanagar, Bangalore - 560040, India Tele - 91 80 2310 9012, Telefax - 91 80 2330 5364, Email - [EMAIL PROTECTED] URL: www.asconsultancy.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: caching pattern
On Mon, Mar 28, 2005 at 04:47:30PM +, Didier McGillis wrote: : Im looking for an idea of how to setup a caching pattern? That's awful vague ;) What sort of caching? Content, data, other? Depending on what you're trying to do, and your desire/willingness to use third-party tools, you may not have to write it yourself from scratch. -QM -- software -- http://www.brandxdev.net/ tech news -- http://www.RoarNetworX.com/ code scan -- http://www.JxRef.org/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with Tomcat caching old pages that it shouldn't
Hi, Basically here's my problem: I make a jsp page that works correctly. OK. Then, I make a fault in it that shows a compile error page - also fine. The problem is, when I reload it a second time, Tomcat serves me the old compiled JSP scriptlet, instead of giving me the compile error message again! I have to wait 5 seconds for the correct error page to be displayed. If I click on refresh in less than 5 seconds after the previous refresh, it gives me the old compiled page without the errors in it. Note its not a web browser cache problem, or a proxy problem - that much is certain. Here's a thread at the Sun forums I have already posted to about this issue: http://forum.java.sun.com/thread.jspa?threadID=607293tstart=0 Please peruse it, as the people there went through many stages with me that I'm sure will help save you time in solving my problem. Thanks, Asfand Yar Send instant messages to your online friends http://uk.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with Tomcat caching old pages that it shouldn't
On Wed, 16 Mar 2005 14:45:07 + (GMT), Asfand Qazi [EMAIL PROTECTED] wrote: Hi, Basically here's my problem: I make a jsp page that works correctly. OK. Then, I make a fault in it that shows a compile error page - also fine. The problem is, when I reload it a second time, Tomcat serves me the old compiled JSP scriptlet, instead of giving me the compile error message again! I have to wait 5 seconds for the correct error page to be displayed. If I click on refresh in less than 5 seconds after the previous refresh, it gives me the old compiled page without the errors in it. Try adding: init-param param-namemodificationTestInterval/param-name param-value0/param-value /init-param to your definition of the JSP servlet in %TOMCAT_HOM#%\conf\web.xml By default it is 4 seconds but I'm not sure why the compile would fail once and then start working again... Regards, -- Jason Bainbridge http://kde.org - [EMAIL PROTECTED] Personal Site - http://jasonbainbridge.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with Tomcat caching old pages that it shouldn't
From: Asfand Qazi [mailto:[EMAIL PROTECTED] Subject: Problem with Tomcat caching old pages that it shouldn't The problem is, when I reload it a second time, Tomcat serves me the old compiled JSP scriptlet, instead of giving me the compile error message again! Please include the exact Tomcat level in problem descriptions, so people will have some idea of which documentation pages to tell you to read. Here's some to look at that may have some bearing on the issue, and specific parameters on each: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html cacheTTL http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/loader.html checkInterval Also look at the various parameters for the jsp servlet in conf/web.xml, since that controls how compilations are done. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with Tomcat caching old pages that it shouldn't
Try adding: init-param param-namemodificationTestInterval/param-name param-value0/param-value /init-param to your definition of the JSP servlet in %TOMCAT_HOM#%\conf\web.xml By default it is 4 seconds but I'm not sure why the compile would fail once and then start working again... It didn't start working again it simply used the old compiled page. I'll try the above - thanks. Send instant messages to your online friends http://uk.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with Tomcat caching old pages that it shouldn't
Please include the exact Tomcat level in problem descriptions, so people will have some idea of which documentation pages to tell you to read. 5.7 Here's some to look at that may have some bearing on the issue, and specific parameters on each: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html cacheTTL http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/loader.html checkInterval Thanks Also look at the various parameters for the jsp servlet in conf/web.xml, since that controls how compilations are done. - Chuck Its just that this problem seems like a bug to me - I mean, if a page is updated and compiles badly, what design features would load a version of the page from a previous compilation? Thanks for the pointers, I'm checking them out. THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. This seems a bit unnecessary since we're posting on a public mailing list, but company policy I suppose :-) Send instant messages to your online friends http://uk.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with Tomcat caching old pages that it shouldn't
--- Asfand Qazi [EMAIL PROTECTED] wrote: Try adding: init-param param-namemodificationTestInterval/param-name param-value0/param-value /init-param to your definition of the JSP servlet in %TOMCAT_HOM#%\conf\web.xml By default it is 4 seconds but I'm not sure why the compile would fail once and then start working again... It didn't start working again it simply used the old compiled page. I'll try the above - thanks. Still no luck, I'm afraid... the same behaviour is exhibited. And yes, I did restart it :-) Send instant messages to your online friends http://uk.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with Tomcat caching old pages that it shouldn't
Asfand Qazi wrote: Basically here's my problem: I make a jsp page that works correctly. OK. Then, I make a fault in it that shows a compile error page - also fine. The problem is, when I reload it a second time, Tomcat serves me the old compiled JSP scriptlet, instead of giving me the compile error message again! Yep, I've seen this too, on 5.5.7 -- hadn't spent any real time on it, but... http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html cacheTTL ..the above sounds like a likely candidate, since it's obviously not related to initial *loading* of changed classes. Please post back the results of your testing :-) -- Hassan Schroeder - [EMAIL PROTECTED] Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com dream. code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with Tomcat caching old pages that it shouldn't
All the compiled JSP servlet classes are stored under jakarta-tomcat-5.5.4\work\Catalina\localhost\yourwebcontext. Please check the timestamp of the compiled file. If you think that it's a old file then I would delete the context directory under jakarta-tomcat-5.5.4\work\Catalina\localhost\ as this directory structure will be recreated during page compilation phase. I agree that it should refresh automatically. But, if it's not working you may wish to try this. Vinod -Original Message- From: Hassan Schroeder [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 16, 2005 11:11 AM To: Tomcat Users List Subject: Re: Problem with Tomcat caching old pages that it shouldn't Asfand Qazi wrote: Basically here's my problem: I make a jsp page that works correctly. OK. Then, I make a fault in it that shows a compile error page - also fine. The problem is, when I reload it a second time, Tomcat serves me the old compiled JSP scriptlet, instead of giving me the compile error message again! Yep, I've seen this too, on 5.5.7 -- hadn't spent any real time on it, but... http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html cacheTTL ..the above sounds like a likely candidate, since it's obviously not related to initial *loading* of changed classes. Please post back the results of your testing :-) -- Hassan Schroeder - [EMAIL PROTECTED] Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com dream. code. - 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: Problem with Tomcat caching old pages that it shouldn't
--- Hassan Schroeder [EMAIL PROTECTED] wrote: Asfand Qazi wrote: Basically here's my problem: I make a jsp page that works correctly. OK. Then, I make a fault in it that shows a compile error page - also fine. The problem is, when I reload it a second time, Tomcat serves me the old compiled JSP scriptlet, instead of giving me the compile error message again! Yep, I've seen this too, on 5.5.7 -- hadn't spent any real time on it, but... http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html cacheTTL ..the above sounds like a likely candidate, since it's obviously not related to initial *loading* of changed classes. Please post back the results of your testing :-) I tried placing it within the context tag both in TOMCAT_HOME/conf/context.html as well as in MY_WEB_APP/META-INF/context.xml. Neither had any effect whatsoever. I've also tried setting cachingAllowed to false, again in both locations, but no luck. I'm stuck. I'll just work around this bug, but I have spent a whole day chasing it down. Thanks for the info, you'res is the first reply I've had that lets me know I'm not an idiot who can't understand configuration directives properly :-) Asfand Yar Send instant messages to your online friends http://uk.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat caching servlet conf directory?
I am working on writing some junit tests for a project and am running into some rather odd behavior... it seems that tomcat is caching the servlets configuration data somewhere between tests. Here's what I'm doing... Presently I have one TestCase class with two methods, let's call them testA() and testB(). Each method first copies a config directory into place inside the servlet's webapps folder. It then creates a new Embedded object, configures it with a custom connector I created, and starts up Tomcat. I then pass in a fabricated HTTP request and check the result against the expected response. These two particular tests happen to use the same servlet configuration, so to verify that things are acting weird, I changed testA() to copy in a non-working configuration. If I run testA() first, then it fails as expected. However, if I run testB() first and then testA() then both tests pass, verifying that testA is in fact using the leftover configuration from testB. I've additionally printed out the contents of the servlet's configuration directory AFTER copying the contents over, but BEFORE starting up tomcat to ensure the new configuration data is actually being copied over... which it is. Finally, I tried deleting the entire work/ directory between tests to ensure nothing was being cached in there. At this point, I'm somewhat at a loss. There appear to be no caches on the filesystem, and because I'm starting with a new Embedded object for each method, there shouldn't be any caches in memory. Any help would be greatly appreciated. -- Will Norris Shibboleth Project The University of Memphis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat caching servlet conf directory?
okay... so disregard this. It turns out the servlet was parsing the configuration document into a static variable that was not being reset between tests. All is well with the world again. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat caching problem
Hi all I geerate in a Struts Action servlet a file that I want to open directly in a new browser. I give tomcat the right url and the file is properly generated. But tomcat does not see it. after shoutdown and restart Tomcat start to see the file.That's for sure not what I want. Actually I've done this kind of code in my action servlet response.setContentType(text/richtext); response.setHeader(Cache-Control,no-cache); //HTTP 1.1 response.setHeader(Pragma,no-cache); //HTTP 1.0 response.setDateHeader (Expires, 0); //prevents caching at the proxy server Nothing change! Help! 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero! Scaricalo su INTERNET GRATIS 6X http://www.libero.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat caching problem
Hi all I geerate in a Struts Action servlet a file that I want to open directly in a new browser. I give tomcat the right url and the file is properly generated. But tomcat does not see it. after shoutdown and restart Tomcat start to see the file.That's for sure not what I want. Actually I've done this kind of code in my action servlet response.setContentType(text/richtext); response.setHeader(Cache-Control,no-cache); //HTTP 1.1 response.setHeader(Pragma,no-cache); //HTTP 1.0 response.setDateHeader (Expires, 0); //prevents caching at the proxy server Nothing change! Help! 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero! Scaricalo su INTERNET GRATIS 6X http://www.libero.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache returning different sizes for same request [was Re: Controlling caching / session collision]
Ouch. ;) That was it. We searched through all the JSPs and fixed that in several places. The problems are greatly reduced now. Thank you very much! Is there any analog to this in Servlets? Is there a clearly incorrect way variables could be scoped in the a Servlet that could lead to the same thing? The developer, within the JSPs, has a couple lines like: jsp:useBean id=statehsaBean class=postgres.PostgreSQLBean scope=page / And since we are still experiencing the problem (though much less), I wonder if the Servlets now have some similar global variable problem. Thanks again! On Mon, 10 Jan 2005, Tim Funk wrote: The code below is a disaster. It creates a variable called result at the servlet instance level. This means that 2 concurrent requests to that JSP page will cause the page to fail. I didn't read the reast of the code - because that line is so evil - that ... well I'm speechless. Change it to: % ResultSet result; % -Tim Brian McEntire wrote: Looking at one of the problematic JSP pages, I see (snippets): %! ResultSet result; % - 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: Apache returning different sizes for same request [was Re: Controlling caching / session collision]
%! String myVar =;% creates an instance myVar in the servlet. Only 1 instance of a given servlet is loaded at a time and many requests all execute the service() method concurrently. %String myVar=;% would create a variable in the scope of the _jspService() method. Which is thread safe. jsp:useBean is thread safe. (Unless the variable is pulled from application or session scope) -Tim Brian McEntire wrote: Ouch. ;) That was it. We searched through all the JSPs and fixed that in several places. The problems are greatly reduced now. Thank you very much! Is there any analog to this in Servlets? Is there a clearly incorrect way variables could be scoped in the a Servlet that could lead to the same thing? The developer, within the JSPs, has a couple lines like: jsp:useBean id=statehsaBean class=postgres.PostgreSQLBean scope=page / And since we are still experiencing the problem (though much less), I wonder if the Servlets now have some similar global variable problem. Thanks again! On Mon, 10 Jan 2005, Tim Funk wrote: The code below is a disaster. It creates a variable called result at the servlet instance level. This means that 2 concurrent requests to that JSP page will cause the page to fail. I didn't read the reast of the code - because that line is so evil - that ... well I'm speechless. Change it to: % ResultSet result; % -Tim Brian McEntire wrote: Looking at one of the problematic JSP pages, I see (snippets): %! ResultSet result; % - 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: Apache returning different sizes for same request [was Re: Controlling caching / session collision]
On Fri, 7 Jan 2005, Caldarale, Charles R wrote: My browser requested listByOwner.jsp but received decodedDataChartContents.jsp. I expected listByOwner but saw decodedDataChartContents. One of the more common causes of this is inadvertent data sharing due to applications that aren't thread-safe. Examine the app code for unprotected static fields, request-specific data stored in a session object, etc. You should also try running the requests through Tomcat only (usually port 8080 unless you've disabled the normal http connector) to see if the problem stays with Tomcat or disappears when mod_jk is out of the picture. I'm the (poor :) sys admin and I don't know much Java but I can read it at a beginner level. I'm working with the developer of this application. He doesn't know threads well but doesn't think his application uses any. He also says the application does not make use of sessions. Looking at one of the problematic JSP pages, I see (snippets): jsp:useBean id=state class=postgres.PostgreSQLBean scope=page / %! ResultSet result; % and try { state.connectToDB(db.server.sanitized.gov); if (state.isConnected()) result = state.executeQuery(SELECT owner_code FROM owner ORDER BY owner_code); while (result.next()) { % option value=%= result.getString(1) %%= result.getString(1) % % } state.closeStatement(); result.close(); state.closeConnection(); } catch (SQLException e) { } catch (Exception e) { } - - - That's all the Java / tags on the whole page. Do you see anything wrong with the scope of the variables, threads, or sessions? * The other question I have: Does anyone know of a simple way to make Tomcat log accesses in a format like Apache's Combined Log format? I wrote test plans in JMeter and a PERL script which can monitor the Apache access log in real time and show the success and failure of each request-response through Apache and mod_jk (based on the results of served JSPs having known sizes.) I left the default Tomcat port open (for internal use) on port 8080 and I can access the JSPs that are having problems directly though Tomcat. This eliminates mod_jk and Apache for troubleshooting. The only problem is, this is an intermittent problem so it very difficult to judge improvement with out JMeter and the test script which needs a combined access log as input. I'd be happy to share the PERL script with anyone interested. Contact me if you want it. Thanks! Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache returning different sizes for same request [was Re: Controlling caching / session collision]
The code below is a disaster. It creates a variable called result at the servlet instance level. This means that 2 concurrent requests to that JSP page will cause the page to fail. I didn't read the reast of the code - because that line is so evil - that ... well I'm speechless. Change it to: % ResultSet result; % -Tim Brian McEntire wrote: Looking at one of the problematic JSP pages, I see (snippets): %! ResultSet result; % - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Controlling caching / session collision
I am running Tomcat 5.0.28, mod_jk 1.2.8, and Apache/2.0.46 on Redhat Enterprise Linux WS 3.0. We have an HTML page that is a frame: top (banner), left hand (menu), and right hand (main content). There are 6 hyperlinks in the LH pane that point to *.jsp pages that load in the RH pane via a BASE TARGET=displayContents tag. Usually, these links work. But occasionally when clicking one link, content that belongs to another link appears in the main/RH pane. This problem seems to get worse the longer Tomcat is up. The JSPs that we are using don't make use of sessions as far as I can tell. Logins are not required. The JSPs are only used to generate dynamic content and forms for submission. I have tried setting the following in workers.properties: worker.workerHADS.socket_keepalive=FALSE worker.workerHADS.cache_timeout=60 worker.workerHADS.cachesize=1 worker.workerHADS.reclycle_timeout=30 I added this within the head/head section of each JSP: META HTTP-EQUIV=Pragma CONTENT=no-cache META HTTP-EQUIV=Expires CONTENT=-1 But the problem still presents occasionally. It happens on Mozilla and IE browsers, and probably others. It looks like a server side issue. It is not 100% reproducible. It cannot be reproduced immediately after Tomcat is started. But after several hours (or possibly some number of visitors to the page) it starts to happen and gets more frequent over time. Any suggestions would be greatly appreciated! Thanks, Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Apache returning different sizes for same request [was Re: Controlling caching / session collision]
This is a follow-up to my question. I hope someone might have seen this before. I don't know if this is a Tomcat, or mod_jk, or Apache issue, but since I've only seen it with JSPs, I think Tomcat or mod_jk factor in. Here are entries from Apache's combined access log when the problem occurs: 192.168.1.1 - - [07/Jan/2005:18:01:36 -0500] GET /jsp/dipper/listByOwner.jsp HTTP/1.1 200 5601 - Java/1.4.2_06 192.168.1.1 - - [07/Jan/2005:18:01:36 -0500] GET /jsp/dipper/decodedDataChartContents.jsp HTTP/1.1 200 8503 - Java/1.4.2_06 192.168.1.1 - - [07/Jan/2005:18:02:09 -0500] GET /jsp/dipper/listByOwner.jsp HTTP/1.1 200 8503 http://server-obscurred.gov/dipper/contents.html; Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Debian/1.7.3-5 Those entries are slightly sanitized. The point is, in the first entry, the size of the response sent by Apache back to the client for listByOwner.jsp is correct at 5601. The correct size is sent back for decodedDataChartContents.jsp in the second entry at 8503. The problem presented with the third request: Apache sent back the wrong response. My browser requested listByOwner.jsp but received decodedDataChartContents.jsp. I expected listByOwner but saw decodedDataChartContents. Apache's log shows that the response it served was the same size as decodedDataChartContents.jsp even though the request was for listByOwner.jsp. Has anyone seen this before? Any ideas what would cause that or how to prevent it? Thanks! Brian On Fri, 7 Jan 2005, Brian McEntire wrote: I am running Tomcat 5.0.28, mod_jk 1.2.8, and Apache/2.0.46 on Redhat Enterprise Linux WS 3.0. We have an HTML page that is a frame: top (banner), left hand (menu), and right hand (main content). There are 6 hyperlinks in the LH pane that point to *.jsp pages that load in the RH pane via a BASE TARGET=displayContents tag. Usually, these links work. But occasionally when clicking one link, content that belongs to another link appears in the main/RH pane. This problem seems to get worse the longer Tomcat is up. The JSPs that we are using don't make use of sessions as far as I can tell. Logins are not required. The JSPs are only used to generate dynamic content and forms for submission. I have tried setting the following in workers.properties: worker.workerHADS.socket_keepalive=FALSE worker.workerHADS.cache_timeout=60 worker.workerHADS.cachesize=1 worker.workerHADS.reclycle_timeout=30 I added this within the head/head section of each JSP: META HTTP-EQUIV=Pragma CONTENT=no-cache META HTTP-EQUIV=Expires CONTENT=-1 But the problem still presents occasionally. It happens on Mozilla and IE browsers, and probably others. It looks like a server side issue. It is not 100% reproducible. It cannot be reproduced immediately after Tomcat is started. But after several hours (or possibly some number of visitors to the page) it starts to happen and gets more frequent over time. Any suggestions would be greatly appreciated! Thanks, Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Apache returning different sizes for same request [was Re: Controlling caching / session collision]
From: Brian McEntire [mailto:[EMAIL PROTECTED] Subject: Apache returning different sizes for same request [was Re: Controlling caching / session collision] My browser requested listByOwner.jsp but received decodedDataChartContents.jsp. I expected listByOwner but saw decodedDataChartContents. One of the more common causes of this is inadvertent data sharing due to applications that aren't thread-safe. Examine the app code for unprotected static fields, request-specific data stored in a session object, etc. You should also try running the requests through Tomcat only (usually port 8080 unless you've disabled the normal http connector) to see if the problem stays with Tomcat or disappears when mod_jk is out of the picture. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mysterious (I think caching) Problem with IE 6 and Form Authentication under SSL (Tomcat 5.0.x)
I have same problem and i don't find any answer to resolved. :( SOS!! :( Did you resolved this problem? How? El mar, 19-10-2004 a las 12:15 +0200, Martin Grüneberg escribió: Hello, I have a real strange Problem with Tomcat and IE When I get forwarded to the login page of my application and enter my account data I always get the following message: HTTP Status 408 - The time allowed for the login process has been exceeded. If you wish to continue you must either click back twice and re-click the link you requested or close and re-open your browser But following the instructions does always result in the same errormessage. With every other browser even InternetExplores on other Machines (same version) I can login without any Problem. I think IE caches the error page somewhere because in the logfile the login is logged as success I tried everthing delete temporary internetfiles /cookies nothing worked! Funny is, when I copy the installation to an other machine (other hostname/ip) I can login with my IE without any Problem. If someone knows something about this problem, please give me a hint! greetings Martin Grüneberg Virus checked by G DATA AntiVirusKit Version: AVK 15.0.551 from 19.10.2004 Virus news: www.antiviruslab.com - 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: Servlet caching?
Hi Steffen, Thank you for your response. I found that there is indeed a bug fro this problem reported for the SUN JDK. You can view it at: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4744405 It also seems that this bug has not yet been solved. Its status is in progress This is a short version of the bug report: Bug ID: 4744405 Votes 17 Synopsis RFE: lookupPrintServices() to refresh the printers list dynamically Category java:classes_2d Reported Against 1.4 , 1.4.1 Release Fixed State In progress, request for enhancement Related Bugs 5028849 , 5033703 Submit Date 10-SEP-2002 Description *This also happened on Windows platform. java version 1.4.1-rc Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b19) Java HotSpot(TM) Client VM (build 1.4.1-rc-b19, mixed mode) When invoke method lookupPrintServices() on class PrinterJob or PrintServiceLookup, the printers list can not refreshed when adding or deleting printers dynamically. Steps to follow to reproduce the problem: 1. Compile and run the included test case 2. The print dialog shows up and avaible printers information is printed out on screen. Click cancel to dismiss the dialog. The test case is pending. 3. Use Printer Selector Tool to add a new printer into selected printers list and save changes. 4. Back to the terminal that run the test case an click enter button to continue. Then a new thread will be created to invoke the lookupPrintServices() and pop up the print dialog again. 5. The screen output shows that invoking lookupPrintServices() doesn't reflect the newly added printer information, neither does the print dialog. // source code begin---// import java.awt.print.*; import javax.print.*; public class MTPrinterTest extends Thread { public static void main(String[] args) { MTPrinterTest t1 = new MTPrinterTest(); t1.start(); try { System.in.read(); } catch (Exception e){} MTPrinterTest t2 = new MTPrinterTest(); t2.start(); } public void run() { PrinterJob printerJob; PrintService[] printServices; printerJob = PrinterJob.getPrinterJob(); printServices = printerJob.lookupPrintServices(); System.out.println(Number of servies found: + printServices.length); for (int i =0; i printServices.length; i++) System.out.println(-- Available Printer + i + : + printServices[i]); printerJob.printDialog(); } } // source code end --// Work Around Exit the current running application and run it again, then the printers list get refreshed. Seems the running JVM can not get updated printer information -Original Message- From: Steffen Heil [mailto:[EMAIL PROTECTED] Sent: Friday, October 15, 2004 8:25 AM To: 'Tomcat Users List' Subject: AW: Servlet caching? Hi If I write a java program to list the services and run the program from the command line, I can see the newly added service right away. Modify your program to list the services, wait one minute, list the services again. Install a printer in that time. See, if the application reflects that change. If not, the Lookup is caching information. Regards, Steffen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet caching?
Hi, Note that this is an RFE, not a bug, so don't hold your breath, and further that you can register an use your own PrintService SPI already in JDK 1.4, and that's probably one reason the Sun folks aren't jumping to implement this RFE. Yoav Shapira http://www.yoavshapira.com -Original Message- From: Carlos Oliva [mailto:[EMAIL PROTECTED] Sent: Friday, October 22, 2004 2:55 PM To: 'Tomcat Users List' Subject: RE: Servlet caching? Hi Steffen, Thank you for your response. I found that there is indeed a bug fro this problem reported for the SUN JDK. You can view it at: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4744405 It also seems that this bug has not yet been solved. Its status is in progress This is a short version of the bug report: Bug ID: 4744405 Votes 17 Synopsis RFE: lookupPrintServices() to refresh the printers list dynamically Category java:classes_2d Reported Against 1.4 , 1.4.1 Release Fixed State In progress, request for enhancement Related Bugs 5028849 , 5033703 Submit Date 10-SEP-2002 Description *This also happened on Windows platform. java version 1.4.1-rc Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b19) Java HotSpot(TM) Client VM (build 1.4.1-rc-b19, mixed mode) When invoke method lookupPrintServices() on class PrinterJob or PrintServiceLookup, the printers list can not refreshed when adding or deleting printers dynamically. Steps to follow to reproduce the problem: 1. Compile and run the included test case 2. The print dialog shows up and avaible printers information is printed out on screen. Click cancel to dismiss the dialog. The test case is pending. 3. Use Printer Selector Tool to add a new printer into selected printers list and save changes. 4. Back to the terminal that run the test case an click enter button to continue. Then a new thread will be created to invoke the lookupPrintServices() and pop up the print dialog again. 5. The screen output shows that invoking lookupPrintServices() doesn't reflect the newly added printer information, neither does the print dialog. // source code begin---// import java.awt.print.*; import javax.print.*; public class MTPrinterTest extends Thread { public static void main(String[] args) { MTPrinterTest t1 = new MTPrinterTest(); t1.start(); try { System.in.read(); } catch (Exception e){} MTPrinterTest t2 = new MTPrinterTest(); t2.start(); } public void run() { PrinterJob printerJob; PrintService[] printServices; printerJob = PrinterJob.getPrinterJob(); printServices = printerJob.lookupPrintServices(); System.out.println(Number of servies found: + printServices.length); for (int i =0; i printServices.length; i++) System.out.println(-- Available Printer + i + : + printServices[i]); printerJob.printDialog(); } } // source code end --// Work Around Exit the current running application and run it again, then the printers list get refreshed. Seems the running JVM can not get updated printer information -Original Message- From: Steffen Heil [mailto:[EMAIL PROTECTED] Sent: Friday, October 15, 2004 8:25 AM To: 'Tomcat Users List' Subject: AW: Servlet caching? Hi If I write a java program to list the services and run the program from the command line, I can see the newly added service right away. Modify your program to list the services, wait one minute, list the services again. Install a printer in that time. See, if the application reflects that change. If not, the Lookup is caching information. Regards, Steffen - 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]
RE: Servlet caching?
Thanks for your clarification. At least the bug says Sate In progress ... Let us hope... -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, October 22, 2004 3:01 PM To: Tomcat Users List Subject: RE: Servlet caching? Hi, Note that this is an RFE, not a bug, so don't hold your breath, and further that you can register an use your own PrintService SPI already in JDK 1.4, and that's probably one reason the Sun folks aren't jumping to implement this RFE. Yoav Shapira http://www.yoavshapira.com -Original Message- From: Carlos Oliva [mailto:[EMAIL PROTECTED] Sent: Friday, October 22, 2004 2:55 PM To: 'Tomcat Users List' Subject: RE: Servlet caching? Hi Steffen, Thank you for your response. I found that there is indeed a bug fro this problem reported for the SUN JDK. You can view it at: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4744405 It also seems that this bug has not yet been solved. Its status is in progress This is a short version of the bug report: Bug ID: 4744405 Votes 17 Synopsis RFE: lookupPrintServices() to refresh the printers list dynamically Category java:classes_2d Reported Against 1.4 , 1.4.1 Release Fixed State In progress, request for enhancement Related Bugs 5028849 , 5033703 Submit Date 10-SEP-2002 Description *This also happened on Windows platform. java version 1.4.1-rc Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b19) Java HotSpot(TM) Client VM (build 1.4.1-rc-b19, mixed mode) When invoke method lookupPrintServices() on class PrinterJob or PrintServiceLookup, the printers list can not refreshed when adding or deleting printers dynamically. Steps to follow to reproduce the problem: 1. Compile and run the included test case 2. The print dialog shows up and avaible printers information is printed out on screen. Click cancel to dismiss the dialog. The test case is pending. 3. Use Printer Selector Tool to add a new printer into selected printers list and save changes. 4. Back to the terminal that run the test case an click enter button to continue. Then a new thread will be created to invoke the lookupPrintServices() and pop up the print dialog again. 5. The screen output shows that invoking lookupPrintServices() doesn't reflect the newly added printer information, neither does the print dialog. // source code begin---// import java.awt.print.*; import javax.print.*; public class MTPrinterTest extends Thread { public static void main(String[] args) { MTPrinterTest t1 = new MTPrinterTest(); t1.start(); try { System.in.read(); } catch (Exception e){} MTPrinterTest t2 = new MTPrinterTest(); t2.start(); } public void run() { PrinterJob printerJob; PrintService[] printServices; printerJob = PrinterJob.getPrinterJob(); printServices = printerJob.lookupPrintServices(); System.out.println(Number of servies found: + printServices.length); for (int i =0; i printServices.length; i++) System.out.println(-- Available Printer + i + : + printServices[i]); printerJob.printDialog(); } } // source code end --// Work Around Exit the current running application and run it again, then the printers list get refreshed. Seems the running JVM can not get updated printer information -Original Message- From: Steffen Heil [mailto:[EMAIL PROTECTED] Sent: Friday, October 15, 2004 8:25 AM To: 'Tomcat Users List' Subject: AW: Servlet caching? Hi If I write a java program to list the services and run the program from the command line, I can see the newly added service right away. Modify your program to list the services, wait one minute, list the services again. Install a printer in that time. See, if the application reflects that change. If not, the Lookup is caching information. Regards, Steffen - 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]
Mysterious (I think caching) Problem with IE 6 and Form Authentication under SSL (Tomcat 5.0.x)
Hello, I have a real strange Problem with Tomcat and IE When I get forwarded to the login page of my application and enter my account data I always get the following message: HTTP Status 408 - The time allowed for the login process has been exceeded. If you wish to continue you must either click back twice and re-click the link you requested or close and re-open your browser But following the instructions does always result in the same errormessage. With every other browser even InternetExplores on other Machines (same version) I can login without any Problem. I think IE caches the error page somewhere because in the logfile the login is logged as success I tried everthing delete temporary internetfiles /cookies nothing worked! Funny is, when I copy the installation to an other machine (other hostname/ip) I can login with my IE without any Problem. If someone knows something about this problem, please give me a hint! greetings Martin Grüneberg Virus checked by G DATA AntiVirusKit Version: AVK 15.0.551 from 19.10.2004 Virus news: www.antiviruslab.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet caching?
One thing you might want to check is that whatever PrintService SPI implementation is looking up your printers doesn't cache the result for the lifetime of the JVM. Does your command line app show new printers and then exit? If so, you might want to change it so you can: 1) list the printers 2) install the new printer while the app is still running 3) list the printers I just did a (rather noddy) check on my workstation: I brought up the print dialog in JEdit and saw just one printer. I installed a new printer then opened the print dialog again and saw just one printer. I restarted JEdit and voila: two printers. I assume JEdit is using the default PrintService discovery mechanism supplied by the JVM. On my workstation that's sun.print.Win32PrintServiceLookup as defined in META-INF/services. If the default implementation is caching then you are out of luck unless you want to write your own PrintServiceLookup. Jon Shapira, Yoav wrote: Hi, I would think that after reloading the servlet all the classes that it had used would cease to exist. That is, any class that had been instantiated or used by the servlet would not remain instantiated after I reload the servlet. Under most instances, but not all. For example, if the library you're using the find the list of printers is in common/lib or shared/lib, your thought above is false. Yoav - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet caching?
Hi Jon, I was arriving to the same conclusion. The servlet and perhaps Tomcat is caching the result of the PrintServiceLookup for the lifetime of the JVM. If I write a java program to list the services and run the program from the command line, I can see the newly added service right away. This program is working because it is exiting every time before restarting. Do you know if unloading and reloading the PrintServiceLookup would clear the cache of the services? Is there any way to clear the cache without having to terminate the instance of Tomcat? -Original Message- From: Jon Wingfield [mailto:[EMAIL PROTECTED] Sent: Friday, October 15, 2004 4:04 AM To: Tomcat Users List Subject: Re: Servlet caching? One thing you might want to check is that whatever PrintService SPI implementation is looking up your printers doesn't cache the result for the lifetime of the JVM. Does your command line app show new printers and then exit? If so, you might want to change it so you can: 1) list the printers 2) install the new printer while the app is still running 3) list the printers I just did a (rather noddy) check on my workstation: I brought up the print dialog in JEdit and saw just one printer. I installed a new printer then opened the print dialog again and saw just one printer. I restarted JEdit and voila: two printers. I assume JEdit is using the default PrintService discovery mechanism supplied by the JVM. On my workstation that's sun.print.Win32PrintServiceLookup as defined in META-INF/services. If the default implementation is caching then you are out of luck unless you want to write your own PrintServiceLookup. Jon Shapira, Yoav wrote: Hi, I would think that after reloading the servlet all the classes that it had used would cease to exist. That is, any class that had been instantiated or used by the servlet would not remain instantiated after I reload the servlet. Under most instances, but not all. For example, if the library you're using the find the list of printers is in common/lib or shared/lib, your thought above is false. Yoav - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Servlet caching?
Hi If I write a java program to list the services and run the program from the command line, I can see the newly added service right away. Modify your program to list the services, wait one minute, list the services again. Install a printer in that time. See, if the application reflects that change. If not, the Lookup is caching information. Regards, Steffen smime.p7s Description: S/MIME cryptographic signature
Servlet caching?
Do servlets in Tomcat (1.4) catch results of programs that they run? I have a java servlet that lists the print services of printers installed in the server (Linux Red Hat). I run the servlet before and after I install a couple of printers in the server; however, the list of printer services does not change until I restart Tomcat. At the same time, I run a test program in the server from the command line to list the print services and this program lists the newly installed printers right away. This has led me to believe that the servlet is caching the list of printer services when it is run the first time and does not re-run the code until Tomcat has been re-started. Thanks in advance for your response.
Re: Servlet caching?
It sounds like one of the classes the Servlet is depending on is caching the result. -Tim Carlos wrote: Do servlets in Tomcat (1.4) catch results of programs that they run? I have a java servlet that lists the print services of printers installed in the server (Linux Red Hat). I run the servlet before and after I install a couple of printers in the server; however, the list of printer services does not change until I restart Tomcat. At the same time, I run a test program in the server from the command line to list the print services and this program lists the newly installed printers right away. This has led me to believe that the servlet is caching the list of printer services when it is run the first time and does not re-run the code until Tomcat has been re-started. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet caching?
Hi, The servlets by themselves do what you tell them to: you wrote them, after all ;) Tomcat doesn't provide any caching of response content by itself without special effort or configuration on your behalf. As Tim said, my guess is a utility class used by your servlet is doing the caching for the printer services list. Yoav Shapira http://www.yoavshapira.com -Original Message- From: Carlos [mailto:[EMAIL PROTECTED] Sent: Thursday, October 14, 2004 9:43 AM To: Tomcat-User ([EMAIL PROTECTED]) Subject: Servlet caching? Do servlets in Tomcat (1.4) catch results of programs that they run? I have a java servlet that lists the print services of printers installed in the server (Linux Red Hat). I run the servlet before and after I install a couple of printers in the server; however, the list of printer services does not change until I restart Tomcat. At the same time, I run a test program in the server from the command line to list the print services and this program lists the newly installed printers right away. This has led me to believe that the servlet is caching the list of printer services when it is run the first time and does not re-run the code until Tomcat has been re-started. Thanks in advance for your response. 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]
caching taglibs
Hello folks, i noticed that everytime tomcat-5.0.x needs a taglib it just create a new one, i´d like to cached all tag in my JSPs, how ca i do that? Is there any taglib container like we have with servlets? Regards, Edson
RE: Servlet caching?
Hi Yoav, I have found that even if I terminate every connection of the servlet to the database and reload the servlet, the servlet still does not find the newly installed printer. I would think that after reloading the servlet all the classes that it had used would cease to exist. That is, any class that had been instantiated or used by the servlet would not remain instantiated after I reload the servlet. So I am thinking that re-starting tomcat somehow makes Tomcat aware of the services that have been installed after Tomcat was started -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Thursday, October 14, 2004 10:00 AM To: Tomcat Users List Subject: RE: Servlet caching? Hi, The servlets by themselves do what you tell them to: you wrote them, after all ;) Tomcat doesn't provide any caching of response content by itself without special effort or configuration on your behalf. As Tim said, my guess is a utility class used by your servlet is doing the caching for the printer services list. Yoav Shapira http://www.yoavshapira.com -Original Message- From: Carlos [mailto:[EMAIL PROTECTED] Sent: Thursday, October 14, 2004 9:43 AM To: Tomcat-User ([EMAIL PROTECTED]) Subject: Servlet caching? Do servlets in Tomcat (1.4) catch results of programs that they run? I have a java servlet that lists the print services of printers installed in the server (Linux Red Hat). I run the servlet before and after I install a couple of printers in the server; however, the list of printer services does not change until I restart Tomcat. At the same time, I run a test program in the server from the command line to list the print services and this program lists the newly installed printers right away. This has led me to believe that the servlet is caching the list of printer services when it is run the first time and does not re-run the code until Tomcat has been re-started. Thanks in advance for your response. 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: Servlet caching?
Hi Tim, I have found that even if I terminate every connection of the servlet to the database and reload the servlet, the servlet still does not find the newly installed printer. I would think that after reloading the servlet all the classes that it had used would cease to exist. That is, any class that had been instantiated or used by the servlet would not remain instantiated after I reload the servlet. So I am thinking that re-starting tomcat somehow makes Tomcat aware of the services that have been installed after Tomcat was started -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Thursday, October 14, 2004 9:50 AM To: Tomcat Users List Subject: Re: Servlet caching? It sounds like one of the classes the Servlet is depending on is caching the result. -Tim Carlos wrote: Do servlets in Tomcat (1.4) catch results of programs that they run? I have a java servlet that lists the print services of printers installed in the server (Linux Red Hat). I run the servlet before and after I install a couple of printers in the server; however, the list of printer services does not change until I restart Tomcat. At the same time, I run a test program in the server from the command line to list the print services and this program lists the newly installed printers right away. This has led me to believe that the servlet is caching the list of printer services when it is run the first time and does not re-run the code until Tomcat has been re-started. - 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: Servlet caching?
On Thu, Oct 14, 2004 at 04:20:08PM -0400, Carlos Oliva wrote: : I have found that even if I terminate every connection of the servlet to the : database and reload the servlet, the servlet still does not find the newly : installed printer. Please post the servlet, or provide a walk-through. It really sounds like you're storing data somewhere (instance variable, whatever) but not properly updating it second time around. -QM -- software -- http://www.brandxdev.net tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet caching?
Hi, I would think that after reloading the servlet all the classes that it had used would cease to exist. That is, any class that had been instantiated or used by the servlet would not remain instantiated after I reload the servlet. Under most instances, but not all. For example, if the library you're using the find the list of printers is in common/lib or shared/lib, your thought above is false. Yoav 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]
[OT] Webapp upgrades and browser caching
I'm looking for some advice about how to handle the following situation. (1) Apache 2.x in front of Tomcat 5.x (2) Deploy new web application. Bunch of servlets, bunch of jsps, bunch of static content (mainly js, css). (3) Many users use the application, during which time their browsers cache lots of static content (4) We do a major version upgrade of the webapp, including (almost) all new static content, but URLs stay the same (to alleviate bookmark-maintenance requirements). The problem arises when the browsers continue to use their cached version of the static content. Now, the browsers eventually get updated, but immediately after deployment there are huge numbers of graphical and functional (js files) problems. It seems like behavior in this area is widely different amongst browsers and/or their settings. I have only come up with the following option: (1) Play with URLs. New deployments can be deployed under a different url domain like: http://www.server.com/myapp/v1/main.css http://www.server.com/myapp/v2/main.css This would force browsers to get new content since the content appears as totally new content to the browser. Aside from disabling static content caching, are there any other options out there? Much thanks for the help! justin __ Justin Ruthenbeck Lead Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential. See: http://www.nextengine.com/confidentiality.php __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Webapp upgrades and browser caching
Justin Ruthenbeck wrote: I'm looking for some advice about how to handle the following situation. (1) Apache 2.x in front of Tomcat 5.x (2) Deploy new web application. Bunch of servlets, bunch of jsps, bunch of static content (mainly js, css). (3) Many users use the application, during which time their browsers cache lots of static content (4) We do a major version upgrade of the webapp, including (almost) all new static content, but URLs stay the same (to alleviate bookmark-maintenance requirements). The problem arises when the browsers continue to use their cached version of the static content. Now, the browsers eventually get updated, but immediately after deployment there are huge numbers of graphical and functional (js files) problems. It seems like behavior in this area is widely different amongst browsers and/or their settings. I have only come up with the following option: (1) Play with URLs. New deployments can be deployed under a different url domain like: http://www.server.com/myapp/v1/main.css http://www.server.com/myapp/v2/main.css This would force browsers to get new content since the content appears as totally new content to the browser. Aside from disabling static content caching, are there any other options out there? Much thanks for the help! justin __ Justin Ruthenbeck Lead Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential. See: http://www.nextengine.com/confidentiality.php __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For static web pages you can use a tag like this: META HTTP-EQUIV=EXPIRES CONTENT=TUE, 2 OCT 1998 12:42:00 GMT If the browsers still have a problem you might be able to configure Apache to output a header will all content called EXPIRES. I think you can if I remember right from some docs I read. You will have to look at Apache for that. I'm not sure about tomcat being able to handle that or not, but the apache bit should prepend the header I believe. The only other way would be to output all images and static pages from a servlet of some kind and add the header yourself to the request. Browsers should honor that tag or header for all images down the line from your html or jsp pages, but may not. Some browsers may be able to be set to ignore this all together though. Sometimes it is even worse than that. I have seen ISP's who think they are slick who install a cache in their systems, and they basically become a proxy for the users. If they are ignoring such things your users would have to contact them. I have seen some who do this for different protocols even http and https differently. That one irked me pretty good. Anyways, I use expires in all my jsp and html files. I haven't ever tried the other stuff for the headers from Apache, but think I remember reading about it in the Apache docs. I have output that header from servlets and ISAPI dlls before. Someone else may be able to offer more help. Wade - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Webapp upgrades and browser caching
Wade, Thanks for your comments. By adding the META expires tag, it sounds like you setting the system up to schedule the upgrade. By this, I mean that you know you're gonna upgrade a week from today, so you configure Apache to suggest that all content should expire at that time. Sounds reasonable. In our situation, we have our webapps installed offsite in clients' facilities, so all/most of the upgrade process needs to be fool-proof... reconfiguring Apache 1 week (or whatever) before the upgrade isn't really an option. Aside from this, any more idea about how to handle this? Thanks, justin For static web pages you can use a tag like this: META HTTP-EQUIV=EXPIRES CONTENT=TUE, 2 OCT 1998 12:42:00 GMT If the browsers still have a problem you might be able to configure Apache to output a header will all content called EXPIRES. I think you can if I remember right from some docs I read. You will have to look at Apache for that. I'm not sure about tomcat being able to handle that or not, but the apache bit should prepend the header I believe. The only other way would be to output all images and static pages from a servlet of some kind and add the header yourself to the request. Browsers should honor that tag or header for all images down the line from your html or jsp pages, but may not. Some browsers may be able to be set to ignore this all together though. Sometimes it is even worse than that. I have seen ISP's who think they are slick who install a cache in their systems, and they basically become a proxy for the users. If they are ignoring such things your users would have to contact them. I have seen some who do this for different protocols even http and https differently. That one irked me pretty good. Anyways, I use expires in all my jsp and html files. I haven't ever tried the other stuff for the headers from Apache, but think I remember reading about it in the Apache docs. I have output that header from servlets and ISAPI dlls before. Someone else may be able to offer more help. Wade At 11:21 AM 10/7/2004, you wrote: Justin Ruthenbeck wrote: I'm looking for some advice about how to handle the following situation. (1) Apache 2.x in front of Tomcat 5.x (2) Deploy new web application. Bunch of servlets, bunch of jsps, bunch of static content (mainly js, css). (3) Many users use the application, during which time their browsers cache lots of static content (4) We do a major version upgrade of the webapp, including (almost) all new static content, but URLs stay the same (to alleviate bookmark-maintenance requirements). The problem arises when the browsers continue to use their cached version of the static content. Now, the browsers eventually get updated, but immediately after deployment there are huge numbers of graphical and functional (js files) problems. It seems like behavior in this area is widely different amongst browsers and/or their settings. I have only come up with the following option: (1) Play with URLs. New deployments can be deployed under a different url domain like: http://www.server.com/myapp/v1/main.css http://www.server.com/myapp/v2/main.css This would force browsers to get new content since the content appears as totally new content to the browser. Aside from disabling static content caching, are there any other options out there? Much thanks for the help! justin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Webapp upgrades and browser caching
Hi Justin, Sorry If I don't understand your question correctly, but I hope this is what you are looking for. Just add a dummy variable at the end the url. if your css file is http://www.server.com/myapp/v1/main.css, then add ?dummy=%=new java.util.Date().getTime()% i.e., http://www.server.com/myapp/v1/main.css?dummy=%=new java.util.Date().getTime()% Appa Justin Ruthenbeck [EMAIL PROTECTED] wrote: I'm looking for some advice about how to handle the following situation. (1) Apache 2.x in front of Tomcat 5.x (2) Deploy new web application. Bunch of servlets, bunch of jsps, bunch of static content (mainly js, css). (3) Many users use the application, during which time their browsers cache lots of static content (4) We do a major version upgrade of the webapp, including (almost) all new static content, but URLs stay the same (to alleviate bookmark-maintenance requirements). The problem arises when the browsers continue to use their cached version of the static content. Now, the browsers eventually get updated, but immediately after deployment there are huge numbers of graphical and functional (js files) problems. It seems like behavior in this area is widely different amongst browsers and/or their settings. I have only come up with the following option: (1) Play with URLs. New deployments can be deployed under a different url domain like: http://www.server.com/myapp/v1/main.css http://www.server.com/myapp/v2/main.css This would force browsers to get new content since the content appears as totally new content to the browser. Aside from disabling static content caching, are there any other options out there? Much thanks for the help! justin __ Justin Ruthenbeck Lead Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential. See: http://www.nextengine.com/confidentiality.php __ - 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
Re: [OT] Webapp upgrades and browser caching
Justin, Have a read of http://www.mnot.net/cache_docs/ If you have access to the apache config then you should be able to add a header like the ones below using mod_headers Cache-Control: max-age=60, must-revalidate to expire content after 60 seconds or use Cache-Control: no-cache to force revalidation of the content on each request. PJ On Fri, 2004-10-08 at 04:53, Justin Ruthenbeck wrote: Wade, Thanks for your comments. By adding the META expires tag, it sounds like you setting the system up to schedule the upgrade. By this, I mean that you know you're gonna upgrade a week from today, so you configure Apache to suggest that all content should expire at that time. Sounds reasonable. In our situation, we have our webapps installed offsite in clients' facilities, so all/most of the upgrade process needs to be fool-proof... reconfiguring Apache 1 week (or whatever) before the upgrade isn't really an option. Aside from this, any more idea about how to handle this? Thanks, justin For static web pages you can use a tag like this: META HTTP-EQUIV=EXPIRES CONTENT=TUE, 2 OCT 1998 12:42:00 GMT If the browsers still have a problem you might be able to configure Apache to output a header will all content called EXPIRES. I think you can if I remember right from some docs I read. You will have to look at Apache for that. I'm not sure about tomcat being able to handle that or not, but the apache bit should prepend the header I believe. The only other way would be to output all images and static pages from a servlet of some kind and add the header yourself to the request. Browsers should honor that tag or header for all images down the line from your html or jsp pages, but may not. Some browsers may be able to be set to ignore this all together though. Sometimes it is even worse than that. I have seen ISP's who think they are slick who install a cache in their systems, and they basically become a proxy for the users. If they are ignoring such things your users would have to contact them. I have seen some who do this for different protocols even http and https differently. That one irked me pretty good. Anyways, I use expires in all my jsp and html files. I haven't ever tried the other stuff for the headers from Apache, but think I remember reading about it in the Apache docs. I have output that header from servlets and ISAPI dlls before. Someone else may be able to offer more help. Wade At 11:21 AM 10/7/2004, you wrote: Justin Ruthenbeck wrote: I'm looking for some advice about how to handle the following situation. (1) Apache 2.x in front of Tomcat 5.x (2) Deploy new web application. Bunch of servlets, bunch of jsps, bunch of static content (mainly js, css). (3) Many users use the application, during which time their browsers cache lots of static content (4) We do a major version upgrade of the webapp, including (almost) all new static content, but URLs stay the same (to alleviate bookmark-maintenance requirements). The problem arises when the browsers continue to use their cached version of the static content. Now, the browsers eventually get updated, but immediately after deployment there are huge numbers of graphical and functional (js files) problems. It seems like behavior in this area is widely different amongst browsers and/or their settings. I have only come up with the following option: (1) Play with URLs. New deployments can be deployed under a different url domain like: http://www.server.com/myapp/v1/main.css http://www.server.com/myapp/v2/main.css This would force browsers to get new content since the content appears as totally new content to the browser. Aside from disabling static content caching, are there any other options out there? Much thanks for the help! justin - 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]
Client-side caching via If-Modified-Since
Hi all, I'm new to the list. Have searched on the web for answers to my question, but was unable to find much. Summary: I am trying to utilize client-side caching via the If-Modified-Since request header and 304 response code for jsp pages. There is a mechanism in Tomcat that returns status 304 for static files that have not been modified since the last request by the client. I've seen it in my logs, but only for gif, jpg, css files and the like. I run a website with many thousands of articles online. Every time Google et al come around, my load shoots up since they're requesting all articles. I added the Last-Modified header to all articles, in the understanding that Tomcat would match this header with the incoming If-Modified-Since, and return 304 for old articles. This does not seem to happen though (Tomcat 4.1.24). Correct? So then I'm left with writing a filter that does this trick for me. Unfortunately I'm stuck there too (I've attached it). My question really is, should this functionality be in Tomcat and if it is, how can I use it? Joost. package nl.gomagazine.web; import java.io.IOException; import java.util.logging.*; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * @author joost */ public class CacheFilter implements Filter { private int responseCode = HttpServletResponse.SC_NOT_MODIFIED; private String responseMsg = Not modified; private static Logger log = null; /** * @see Filter#init(FilterConfig) */ public synchronized void init(FilterConfig filterConfig) throws ServletException { if(log == null) { log = Logger.getLogger(nl.gomagazine.web); try { Handler fh = new FileHandler(/export/web/gomagazine/www/logs/cachefilter.log, true); fh.setFormatter(new java.util.logging.SimpleFormatter()); log.addHandler(fh); log.setLevel(Level.ALL); log.config(Program started); } catch (IOException e) { throw new ServletException(e); } catch (SecurityException e) { throw new ServletException(e); } } } /** * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain) */ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpRequest = (HttpServletRequest)request; HttpServletResponse httpResponse = (HttpServletResponse)response; log.info(filter activated for request=+httpRequest.getRequestURL()); // always pass the request/response on chain.doFilter(request, response); // if If-Modified-Since was set, modify the response long ifModifiedSince = httpRequest.getDateHeader(If-Modified-Since); if(ifModifiedSince -1) { log.config(request has If-Modified-Since set); long lastModified = httpRequest.getDateHeader(Last-Modified); if(ifModifiedSince lastModified) httpResponse.sendError(this.responseCode, this.responseMsg); } } /** * @see Filter#destroy() */ public void destroy() { } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Client-side caching via If-Modified-Since
It belongs in a filter like you have done. It doesn't belong in tomcat. Also your filter isn't correct - it is still executing your JSP code and wasting resources. It should be: doFilter() { ... if (contentIsFresh) { httpResponse.sendError(HttpServletResponse.SC_NOT_MODIFIED); } else { chain.doFilter( ... ); } } -Tim Joost Baaij wrote: Hi all, I'm new to the list. Have searched on the web for answers to my question, but was unable to find much. Summary: I am trying to utilize client-side caching via the If-Modified-Since request header and 304 response code for jsp pages. There is a mechanism in Tomcat that returns status 304 for static files that have not been modified since the last request by the client. I've seen it in my logs, but only for gif, jpg, css files and the like. I run a website with many thousands of articles online. Every time Google et al come around, my load shoots up since they're requesting all articles. I added the Last-Modified header to all articles, in the understanding that Tomcat would match this header with the incoming If-Modified-Since, and return 304 for old articles. This does not seem to happen though (Tomcat 4.1.24). Correct? So then I'm left with writing a filter that does this trick for me. Unfortunately I'm stuck there too (I've attached it). My question really is, should this functionality be in Tomcat and if it is, how can I use it? Joost. package nl.gomagazine.web; import java.io.IOException; import java.util.logging.*; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * @author joost */ public class CacheFilter implements Filter { private int responseCode = HttpServletResponse.SC_NOT_MODIFIED; private String responseMsg = Not modified; private static Logger log = null; /** * @see Filter#init(FilterConfig) */ public synchronized void init(FilterConfig filterConfig) throws ServletException { if(log == null) { log = Logger.getLogger(nl.gomagazine.web); try { Handler fh = new FileHandler(/export/web/gomagazine/www/logs/cachefilter.log, true); fh.setFormatter(new java.util.logging.SimpleFormatter()); log.addHandler(fh); log.setLevel(Level.ALL); log.config(Program started); } catch (IOException e) { throw new ServletException(e); } catch (SecurityException e) { throw new ServletException(e); } } } /** * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain) */ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpRequest = (HttpServletRequest)request; HttpServletResponse httpResponse = (HttpServletResponse)response; log.info(filter activated for request=+httpRequest.getRequestURL()); // always pass the request/response on chain.doFilter(request, response); // if If-Modified-Since was set, modify the response long ifModifiedSince = httpRequest.getDateHeader(If-Modified-Since); if(ifModifiedSince -1) { log.config(request has If-Modified-Since set); long lastModified = httpRequest.getDateHeader(Last-Modified); if(ifModifiedSince lastModified) httpResponse.sendError(this.responseCode, this.responseMsg); } } /** * @see Filter#destroy() */ public void destroy() { } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Client-side caching via If-Modified-Since
There is no need for the response's last modified header. Unless you wish to set a header in the caching response header. But at that point - that is your code setting it, not tomcat. If a client is sending a If-Modified-Since header - that means they have retrieved the content at some time. In that case, you'd need a rule to determine when to re-display page or send a 304. (The job of the filter). Your original code is - Executing the JSP (and probably sending content back to the client) - Then checking for freshness and possibly sending a 304 - At which point - you probably are getting an IllegalStateException Unless your page is smaller than the buffer size - I bet you'll see a lot of IllegalStateExceptions in your logs. -Tim Joost Baaij wrote: Thanks for your help! A filter then. it's the question if(contentIsFresh) I'm having trouble with. I can getDateHeader(If-Modified-Since) from the request without any problems, but how can I retrieve the Last-Modified from the response? There's no method for it. Does the initial request-object have this information? I'm a novice servlet programmer. Sorry if my question is too basic. Also, I do think the chain.doFilter() must still be executed. I need to get that Last-Modified information from the response (if only I knew how to access it!) Joost. On Wed, 8 Sep 2004, Tim Funk wrote: It belongs in a filter like you have done. It doesn't belong in tomcat. Also your filter isn't correct - it is still executing your JSP code and wasting resources. It should be: doFilter() { ... if (contentIsFresh) { httpResponse.sendError(HttpServletResponse.SC_NOT_MODIFIED); } else { chain.doFilter( ... ); } } -Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How do I get an intermediary proxy from caching?
Hello all, I have taken a cursory look at the documentation for tomcat 5.x and I could not see how to get intermediary proxy's from caching my web page. I have the tags: meta http-equiv=pragma content=no-cache meta http-equiv=cache-control content=no-cache META HTTP-EQUIV=Expires CONTENT=Wed, 01 Sep 2004 17:52:51 GMT in my head section, but the proxy still caches my page. I read somewhere to put the cache-control:no-cache in the http header of the request, but I could not find how to do this in tomcat. Any help would be appreciated. -- Christopher Cullum [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I get an intermediary proxy from caching?
On Tue, Aug 31, 2004 at 10:47:27AM -0700, [EMAIL PROTECTED] wrote: : in my head section, but the proxy still caches my page. I read somewhere : to put the cache-control:no-cache in the http header of the request, but I : could not find how to do this in tomcat. Any help would be appreciated. Response.setHeader() -QM -- software -- http://www.brandxdev.net tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I get an intermediary proxy from caching?
Thanks, I will give this a try. -- Christopher Cullum [EMAIL PROTECTED] QM said: On Tue, Aug 31, 2004 at 10:47:27AM -0700, [EMAIL PROTECTED] wrote: : in my head section, but the proxy still caches my page. I read somewhere : to put the cache-control:no-cache in the http header of the request, but I : could not find how to do this in tomcat. Any help would be appreciated. Response.setHeader() -QM -- software -- http://www.brandxdev.net tech news -- http://www.RoarNetworX.com - 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 do I get an intermediary proxy from caching?
When I am battling against IE caching or proxy caching, I add the following lines to my response header. A bit brute force but it seems to work, althought I think it cause some issues when backing up on a form, forcing a reload. response.setHeader(Cache-Control, no-cache,max-age=0,must-revalidate); response.setHeader(Pragma, no-cache); response.setHeader(Expires, -1d); [EMAIL PROTECTED] wrote: Hello all, I have taken a cursory look at the documentation for tomcat 5.x and I could not see how to get intermediary proxy's from caching my web page. I have the tags: meta http-equiv=pragma content=no-cache meta http-equiv=cache-control content=no-cache META HTTP-EQUIV=Expires CONTENT=Wed, 01 Sep 2004 17:52:51 GMT in my head section, but the proxy still caches my page. I read somewhere to put the cache-control:no-cache in the http header of the request, but I could not find how to do this in tomcat. Any help would be appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I get an intermediary proxy from caching?
Must you do this as one of the first things you do, before you output any html? -- Christopher Cullum [EMAIL PROTECTED] John Gentilin said: When I am battling against IE caching or proxy caching, I add the following lines to my response header. A bit brute force but it seems to work, althought I think it cause some issues when backing up on a form, forcing a reload. response.setHeader(Cache-Control, no-cache,max-age=0,must-revalidate); response.setHeader(Pragma, no-cache); response.setHeader(Expires, -1d); [EMAIL PROTECTED] wrote: Hello all, I have taken a cursory look at the documentation for tomcat 5.x and I could not see how to get intermediary proxy's from caching my web page. I have the tags: meta http-equiv=pragma content=no-cache meta http-equiv=cache-control content=no-cache META HTTP-EQUIV=Expires CONTENT=Wed, 01 Sep 2004 17:52:51 GMT in my head section, but the proxy still caches my page. I read somewhere to put the cache-control:no-cache in the http header of the request, but I could not find how to do this in tomcat. Any help would be appreciated. - 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 do I get an intermediary proxy from caching?
Not sure if order matters but in my code, I set the headers first then process the request. -JG [EMAIL PROTECTED] wrote: Must you do this as one of the first things you do, before you output any html? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I get an intermediary proxy from caching?
Yes. To be precise: you have to set the headers before Tomcat flushes its outputbuffer for the first time. To be save, just set headers, than output html. Ronald, On Tue Aug 31 20:10:13 CEST 2004 [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Must you do this as one of the first things you do, before you output any html? -- Christopher Cullum [EMAIL PROTECTED] John Gentilin said: When I am battling against IE caching or proxy caching, I add the following lines to my response header. A bit brute force but it seems to work, althought I think it cause some issues when backing up on a form, forcing a reload. response.setHeader(Cache-Control, no-cache,max-age=0,must-revalidate); response.setHeader(Pragma, no-cache); response.setHeader(Expires, -1d); [EMAIL PROTECTED] wrote: Hello all, I have taken a cursory look at the documentation for tomcat 5.x and I could not see how to get intermediary proxy's from caching my web page. I have the tags: meta http-equiv=pragma content=no-cache meta http-equiv=cache-control content=no-cache META HTTP-EQUIV=Expires CONTENT=Wed, 01 Sep 2004 17:52:51 GMT in my head section, but the proxy still caches my page. I read somewhere to put the cache-control:no-cache in the http header of the request, but I could not find how to do this in tomcat. Any help would be appreciated. - 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 do I get an intermediary proxy from caching?
you could also use a filter for your whole app that does that, if you want all your app non-cached, same rules apply Ronald Klop escribió: Yes. To be precise: you have to set the headers before Tomcat flushes its outputbuffer for the first time. To be save, just set headers, than output html. Ronald, On Tue Aug 31 20:10:13 CEST 2004 [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Must you do this as one of the first things you do, before you output any html? -- Christopher Cullum [EMAIL PROTECTED] John Gentilin said: When I am battling against IE caching or proxy caching, I add the following lines to my response header. A bit brute force but it seems to work, althought I think it cause some issues when backing up on a form, forcing a reload. response.setHeader(Cache-Control, no-cache,max-age=0,must-revalidate); response.setHeader(Pragma, no-cache); response.setHeader(Expires, -1d); [EMAIL PROTECTED] wrote: Hello all, I have taken a cursory look at the documentation for tomcat 5.x and I could not see how to get intermediary proxy's from caching my web page. I have the tags: meta http-equiv=pragma content=no-cache meta http-equiv=cache-control content=no-cache META HTTP-EQUIV=Expires CONTENT=Wed, 01 Sep 2004 17:52:51 GMT in my head section, but the proxy still caches my page. I read somewhere to put the cache-control:no-cache in the http header of the request, but I could not find how to do this in tomcat. Any help would be appreciated. - 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] -- John Villar Gerente de Proyectos Computadores Flor Hard Soft 2058 C.A. www.florhard.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I get an intermediary proxy from caching?
Can I ask Tomcat if it has flushed it's output buffer yet? -- Christopher Cullum [EMAIL PROTECTED] John Villar said: you could also use a filter for your whole app that does that, if you want all your app non-cached, same rules apply Ronald Klop escribió: Yes. To be precise: you have to set the headers before Tomcat flushes its outputbuffer for the first time. To be save, just set headers, than output html. Ronald, On Tue Aug 31 20:10:13 CEST 2004 [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Must you do this as one of the first things you do, before you output any html? -- Christopher Cullum [EMAIL PROTECTED] John Gentilin said: When I am battling against IE caching or proxy caching, I add the following lines to my response header. A bit brute force but it seems to work, althought I think it cause some issues when backing up on a form, forcing a reload. response.setHeader(Cache-Control, no-cache,max-age=0,must-revalidate); response.setHeader(Pragma, no-cache); response.setHeader(Expires, -1d); [EMAIL PROTECTED] wrote: Hello all, I have taken a cursory look at the documentation for tomcat 5.x and I could not see how to get intermediary proxy's from caching my web page. I have the tags: meta http-equiv=pragma content=no-cache meta http-equiv=cache-control content=no-cache META HTTP-EQUIV=Expires CONTENT=Wed, 01 Sep 2004 17:52:51 GMT in my head section, but the proxy still caches my page. I read somewhere to put the cache-control:no-cache in the http header of the request, but I could not find how to do this in tomcat. Any help would be appreciated. - 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] -- John Villar Gerente de Proyectos Computadores Flor Hard Soft 2058 C.A. www.florhard.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I get an intermediary proxy from caching?
[EMAIL PROTECTED] wrote: Can I ask Tomcat if it has flushed it's output buffer yet? As part of the servlet spec... HttpServletResponse has an isCommitted() method. That will tell you whether it's flushed the buffer. But really, it seems like a bad design to rely on that method. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I get an intermediary proxy from caching?
-- Christopher Cullum [EMAIL PROTECTED] Carl Howells said: [EMAIL PROTECTED] wrote: Can I ask Tomcat if it has flushed it's output buffer yet? As part of the servlet spec... HttpServletResponse has an isCommitted() method. That will tell you whether it's flushed the buffer. But really, it seems like a bad design to rely on that method. To rely on that method, yes a bad design, to check before you change the headers, so you can head off an exception, not a bad design. - 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 do I get an intermediary proxy from caching?
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: Re: How do I get an intermediary proxy from caching? To rely on that method, yes a bad design, to check before you change the headers, so you can head off an exception, not a bad design. However, you're adding code for a hopefully infrequent situation to the main path. If you simply catch the exception, you don't impact the main path. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How do I get an intermediary proxy from caching?
Adding the headers will not be an infrequent situation, most of my site is dynamic so almost all of the site cannot be cached. The adding of these headers will be part of the main path. -- Christopher Cullum [EMAIL PROTECTED] Caldarale, Charles R said: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: Re: How do I get an intermediary proxy from caching? To rely on that method, yes a bad design, to check before you change the headers, so you can head off an exception, not a bad design. However, you're adding code for a hopefully infrequent situation to the main path. If you simply catch the exception, you don't impact the main path. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - 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 do I get an intermediary proxy from caching?
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: RE: How do I get an intermediary proxy from caching? Adding the headers will not be an infrequent situation, most of my site is dynamic so almost all of the site cannot be cached. The adding of these headers will be part of the main path. You're missing the point. The infrequent case is that the output is already committed, not that you'll be adding headers. You're including an error check in the main path that would be perfectly well handled by an exception. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How do I get an intermediary proxy from caching?
I don't agree with your assesment. I would rather do a simple boolean check before I do something and make a decision based on that and use exceptions for catastrophic errors. Just a choice in how to use the tools available. -- Christopher Cullum [EMAIL PROTECTED] Caldarale, Charles R said: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: RE: How do I get an intermediary proxy from caching? Adding the headers will not be an infrequent situation, most of my site is dynamic so almost all of the site cannot be cached. The adding of these headers will be part of the main path. You're missing the point. The infrequent case is that the output is already committed, not that you'll be adding headers. You're including an error check in the main path that would be perfectly well handled by an exception. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - 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]
Session Sharingand Caching Problem
Hi , We are having the following architecture being used in our web based application HTML/JSP --- Main Servlet processor class Session Bean DAO layer Oracle 8i Database. Application Server : Oracle 9i Application Server. OC4J being the container. We start the server using java -jar orion.jar The issue is :- When there is load one user is able to see the data of other users, we also get 500 internal server error when two or more people hit the same page at the same time. We have used all cache clear snippets coding but still we are having some issues in it. what do we do ? We are storing some data in the session but each user would have his own session id assigned to him right. Then in that case where and which point is it getting shared ? regards Selva * Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session Sharingand Caching Problem
I think your using Orion, not tomcat. http://www.orionserver.com/ -Tim Selva Kumar B. wrote: Hi , We are having the following architecture being used in our web based application HTML/JSP --- Main Servlet processor class Session Bean DAO layer Oracle 8i Database. Application Server : Oracle 9i Application Server. OC4J being the container. We start the server using java -jar orion.jar The issue is :- When there is load one user is able to see the data of other users, we also get 500 internal server error when two or more people hit the same page at the same time. We have used all cache clear snippets coding but still we are having some issues in it. what do we do ? We are storing some data in the session but each user would have his own session id assigned to him right. Then in that case where and which point is it getting shared ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Caching Service for clustered tomcat
I have written a web app that uses my own object cache, this works great as a singleton, but would like to eventually get where I can cluster my servlet container. I have just heard about jcs and jCache. Does anyone have any other resources for implementing these on a clustered tomcat 4.x? Am I missing a FAQ somewhere? thanks Michael Holly
My own caching implementation...
Hi Guys I have been trying to improve the performace of our app the past week and one of the things I did was to cache our vast navigation systems as lots of JSPs each with the page ID as the jsp filename. Annnyway, this works fine but each time a page is accessed where the JSP include for the navigation has not been used before there is a 3 second delay or so where presumably the include is compiled because thereafter it is fast. Cool. Now, a moment ago we pre-released a version to technical staff and what we saw was that even pages that had been visited seemed after 5 clicks on them to re-compile? I am just wondering if Tomcat will compile these include fragments again for some reason? Should I be using development=false in the Jasper sevlet in servlet.conf to stop this happening?? Cheers Guys, ADC FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: My own caching implementation...
Yeah, that'd be my first guess.set development to false. Why didn't you just try it? It would have taken you just as long to try it as it did for you to write an email and send it. - Original Message - From: Allistair Crossley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 08, 2004 11:25 AM Subject: My own caching implementation... Hi Guys I have been trying to improve the performace of our app the past week and one of the things I did was to cache our vast navigation systems as lots of JSPs each with the page ID as the jsp filename. Annnyway, this works fine but each time a page is accessed where the JSP include for the navigation has not been used before there is a 3 second delay or so where presumably the include is compiled because thereafter it is fast. Cool. Now, a moment ago we pre-released a version to technical staff and what we saw was that even pages that had been visited seemed after 5 clicks on them to re-compile? I am just wondering if Tomcat will compile these include fragments again for some reason? Should I be using development=false in the Jasper sevlet in servlet.conf to stop this happening?? Cheers Guys, ADC FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - 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: My own caching implementation...
Jasper 2 already caches jsp pages. Have you realy noticed a performance increase? -Original Message- From: Seth Newton [mailto:[EMAIL PROTECTED] Sent: Thursday, April 08, 2004 11:35 AM To: Tomcat Users List Subject: Re: My own caching implementation... Yeah, that'd be my first guess.set development to false. Why didn't you just try it? It would have taken you just as long to try it as it did for you to write an email and send it. - Original Message - From: Allistair Crossley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 08, 2004 11:25 AM Subject: My own caching implementation... Hi Guys I have been trying to improve the performace of our app the past week and one of the things I did was to cache our vast navigation systems as lots of JSPs each with the page ID as the jsp filename. Annnyway, this works fine but each time a page is accessed where the JSP include for the navigation has not been used before there is a 3 second delay or so where presumably the include is compiled because thereafter it is fast. Cool. Now, a moment ago we pre-released a version to technical staff and what we saw was that even pages that had been visited seemed after 5 clicks on them to re-compile? I am just wondering if Tomcat will compile these include fragments again for some reason? Should I be using development=false in the Jasper sevlet in servlet.conf to stop this happening?? Cheers Guys, ADC FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - 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: My own caching implementation...
I don't think you understood quite what I meant - my JSP beforehand was actually dynamically creating all the nav from the database per request. All I mean by cache in this case is that I wrote a script that goes through the database tree and generates loads of little JSPs so that they do not have to be calculated from the DB at runtime. I am sure Jasper caches these small JSPs. Cheers! ADC -Original Message- From: John Trollinger [mailto:[EMAIL PROTECTED] Sent: Thu 08/04/2004 17:55 To: 'Tomcat Users List' Cc: Subject: RE: My own caching implementation... Jasper 2 already caches jsp pages. Have you realy noticed a performance increase? -Original Message- From: Seth Newton [mailto:[EMAIL PROTECTED] Sent: Thursday, April 08, 2004 11:35 AM To: Tomcat Users List Subject: Re: My own caching implementation... Yeah, that'd be my first guess.set development to false. Why didn't you just try it? It would have taken you just as long to try it as it did for you to write an email and send it. - Original Message - From: Allistair Crossley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 08, 2004 11:25 AM Subject: My own caching implementation... Hi Guys I have been trying to improve the performace of our app the past week and one of the things I did was to cache our vast navigation systems as lots of JSPs each with the page ID as the jsp filename. Annnyway, this works fine but each time a page is accessed where the JSP include for the navigation has not been used before there is a 3 second delay or so where presumably the include is compiled because thereafter it is fast. Cool. Now, a moment ago we pre-released a version to technical staff and what we saw was that even pages that had been visited seemed after 5 clicks on them to re-compile? I am just wondering if Tomcat will compile these include fragments again for some reason? Should I be using development=false in the Jasper sevlet in servlet.conf to stop this happening?? Cheers Guys, ADC FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - 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: My own caching implementation...
Not to get too wrapped up in how-to... since you are already going to the database to identify the nav links for the person, was there a reason why you didn't put the results into a collection and save it to session for the user? That way they are always available during their session. When you display the page all you have to do is iterate through the collection to display the nav links. Just a thought -Original Message- From: Allistair Crossley [mailto:[EMAIL PROTECTED] Sent: Thursday, April 08, 2004 2:28 PM To: Tomcat Users List Subject: RE: My own caching implementation... I don't think you understood quite what I meant - my JSP beforehand was actually dynamically creating all the nav from the database per request. All I mean by cache in this case is that I wrote a script that goes through the database tree and generates loads of little JSPs so that they do not have to be calculated from the DB at runtime. I am sure Jasper caches these small JSPs. Cheers! ADC -Original Message- From: John Trollinger [mailto:[EMAIL PROTECTED] Sent: Thu 08/04/2004 17:55 To: 'Tomcat Users List' Cc: Subject: RE: My own caching implementation... Jasper 2 already caches jsp pages. Have you realy noticed a performance increase? -Original Message- From: Seth Newton [mailto:[EMAIL PROTECTED] Sent: Thursday, April 08, 2004 11:35 AM To: Tomcat Users List Subject: Re: My own caching implementation... Yeah, that'd be my first guess.set development to false. Why didn't you just try it? It would have taken you just as long to try it as it did for you to write an email and send it. - Original Message - From: Allistair Crossley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 08, 2004 11:25 AM Subject: My own caching implementation... Hi Guys I have been trying to improve the performace of our app the past week and one of the things I did was to cache our vast navigation systems as lots of JSPs each with the page ID as the jsp filename. Annnyway, this works fine but each time a page is accessed where the JSP include for the navigation has not been used before there is a 3 second delay or so where presumably the include is compiled because thereafter it is fast. Cool. Now, a moment ago we pre-released a version to technical staff and what we saw was that even pages that had been visited seemed after 5 clicks on them to re-compile? I am just wondering if Tomcat will compile these include fragments again for some reason? Should I be using development=false in the Jasper sevlet in servlet.conf to stop this happening?? Cheers Guys, ADC FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - 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: My own caching implementation...
The nav is not determined by the user so there is no need to store it in each user session I would say. The database is hit to create these JSPs actually before tomcat is even started up, so there is no cost in doing that. Cheers ADC -Original Message- From: LILES, DAVID (CONTRACTOR) [mailto:[EMAIL PROTECTED] Sent: Thu 08/04/2004 20:35 To: Tomcat Users List Cc: Subject: RE: My own caching implementation... Not to get too wrapped up in how-to... since you are already going to the database to identify the nav links for the person, was there a reason why you didn't put the results into a collection and save it to session for the user? That way they are always available during their session. When you display the page all you have to do is iterate through the collection to display the nav links. Just a thought -Original Message- From: Allistair Crossley [mailto:[EMAIL PROTECTED] Sent: Thursday, April 08, 2004 2:28 PM To: Tomcat Users List Subject: RE: My own caching implementation... I don't think you understood quite what I meant - my JSP beforehand was actually dynamically creating all the nav from the database per request. All I mean by cache in this case is that I wrote a script that goes through the database tree and generates loads of little JSPs so that they do not have to be calculated from the DB at runtime. I am sure Jasper caches these small JSPs. Cheers! ADC -Original Message- From: John Trollinger [mailto:[EMAIL PROTECTED] Sent: Thu 08/04/2004 17:55 To: 'Tomcat Users List' Cc: Subject: RE: My own caching implementation... Jasper 2 already caches jsp pages. Have you realy noticed a performance increase? -Original Message- From: Seth Newton [mailto:[EMAIL PROTECTED] Sent: Thursday, April 08, 2004 11:35 AM To: Tomcat Users List Subject: Re: My own caching implementation... Yeah, that'd be my first guess.set development to false. Why didn't you just try it? It would have taken you just as long to try it as it did for you to write an email and send it. - Original Message - From: Allistair Crossley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 08, 2004 11:25 AM Subject: My own caching implementation... Hi Guys I have been trying to improve the performace of our app the past week and one of the things I did was to cache our vast navigation systems as lots of JSPs each with the page ID as the jsp filename. Annnyway, this works fine but each time a page is accessed where the JSP include for the navigation has not been used before there is a 3 second delay or so where presumably the include is compiled because thereafter it is fast. Cool. Now, a moment ago we pre-released a version to technical staff and what we saw was that even pages that had been visited seemed after 5 clicks on them to re-compile? I am just wondering if Tomcat will compile these include fragments again for some reason? Should I be using development=false in the Jasper sevlet in servlet.conf to stop this happening?? Cheers Guys, ADC FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: caching static objects
We are running Tomcat-standalone and are having some caching issues. It appears to be a browser issue, but there's got to be some workaround. We've got the headers set to pragma nocache, but it continues to cache objects, such as charts that are created dynamically. I suppose this wouldn't be an issue if the code worked with Apache. Also, creating unique identifiers for each object has been shot down. Does anyone know of a way to get server.xml to set each object not to cache? Thanks. The 'Pragma' header you use is from HTTP/1.0. Most caches, including browser cache, by now use HTTP/1.1, where cache control is achieved differently. You should use 'Cache-Control' headers (although it never hurts to also use 'Pragma' headers, in case you encounter an older HTTP/1.0 cache). For more information you can look at the HTTP/1.1 RFC at: ftp://ftp.isi.edu/in-notes/rfc2616.txt and search for the text 'Cache-Control'. Regards, Ronald. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: caching static objects
Howdy, We are running Tomcat-standalone and are having some caching issues. It appears to be a browser issue, but there's got to be some workaround. We've got the headers set to pragma nocache, but it continues to cache objects, such as charts that are created dynamically. I suppose this wouldn't be an issue if the code worked with Apache. Also, creating unique identifiers for each object has been shot down. Does anyone know of a way to get server.xml to set each object not to cache? Thanks. There's no server.xml way to do this, but it's a trivial filter to write. Just add the pragma-nocache and the cache-control headers to every outgoing response. Yoav Shapira 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]
caching static objects
We are running Tomcat-standalone and are having some caching issues. It appears to be a browser issue, but there's got to be some workaround. We've got the headers set to pragma nocache, but it continues to cache objects, such as charts that are created dynamically. I suppose this wouldn't be an issue if the code worked with Apache. Also, creating unique identifiers for each object has been shot down. Does anyone know of a way to get server.xml to set each object not to cache? Thanks.
RE: caching static objects
if you're using the jfreechart package for dynamic chart creation, then there's a setting in that package that you can adjust for whether or not the chart should be cached or not (and when it expires). -Original Message- From: Kimberly McKinnis [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 4:42 PM To: [EMAIL PROTECTED] Subject: caching static objects We are running Tomcat-standalone and are having some caching issues. It appears to be a browser issue, but there's got to be some workaround. We've got the headers set to pragma nocache, but it continues to cache objects, such as charts that are created dynamically. I suppose this wouldn't be an issue if the code worked with Apache. Also, creating unique identifiers for each object has been shot down. Does anyone know of a way to get server.xml to set each object not to cache? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: caching static objects
Mmm... good thought. Am using Chart FX though. I shall look in there. Thanks! -Original Message- From: Mike Curwen [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 3:25 PM To: 'Tomcat Users List' Subject: RE: caching static objects if you're using the jfreechart package for dynamic chart creation, then there's a setting in that package that you can adjust for whether or not the chart should be cached or not (and when it expires). -Original Message- From: Kimberly McKinnis [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 4:42 PM To: [EMAIL PROTECTED] Subject: caching static objects We are running Tomcat-standalone and are having some caching issues. It appears to be a browser issue, but there's got to be some workaround. We've got the headers set to pragma nocache, but it continues to cache objects, such as charts that are created dynamically. I suppose this wouldn't be an issue if the code worked with Apache. Also, creating unique identifiers for each object has been shot down. Does anyone know of a way to get server.xml to set each object not to cache? Thanks. - 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: Tomcat, Oracle and connection caching.
Howdy, I have it running with the thin driver. I haven't tried OCI. Doesn't the OCI driver require some system libraries that have to be declared in the LD_LIBRARY_PATH or loaded via JNI? Yoav Shapira Millennium ChemInformatics -Original Message- From: David Short [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 12:14 AM To: 'Tomcat Users List' Subject: Tomcat, Oracle and connection caching. Does anyone have Tomcat 4.1.x running with connection caching using the Oracle oci8 driver? I can get it to work using the thin driver but it won't work with the oci8 driver. The oci8 driver works just fine with the test program provided by Oracle, so my configuration is right. There's something about the OracleConnectionCacheImpl class that the oci8 driver doesn't like. Here's the error: java.sql.SQLException: No suitable driver Any help would be greatly appreciated. - 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]
RE: Tomcat, Oracle and connection caching.
It requires the Oracle client DLLs (or .so files) to be installed in the correct place and the path setup correctly. I have tested my oci8 configuration with the JdbcCheck program supplied by Oracle and the oci8 driver works just fine without JNI. For some reason, it's not working with JNI. I've been reading everything I can find on the subject and haven't seen anything explicitly describing special configurations, outside of what I've already tried, for JNI. The documentation states to simply replace thin with oci8 in the JDBCURL string. Also, in researching this, I've found that you need to replace the thin JDBCURL string as follows in the web.xml file: Thin driver: param-valuejdbc:oracle:thin:@serverName:1521:orcl/param-value oci8 driver: param-value(description=(address=(host=serverName)(protocol=tcp)(port=1521 ))(connect_data=(sid=orcl)))/param-value Not sure where to go from here. Perhaps, if you had a few spare moments, you could try the oci8 driver and see what you come up with? Thanks Dave -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 6:04 AM To: Tomcat Users List Subject: RE: Tomcat, Oracle and connection caching. Howdy, I have it running with the thin driver. I haven't tried OCI. Doesn't the OCI driver require some system libraries that have to be declared in the LD_LIBRARY_PATH or loaded via JNI? Yoav Shapira Millennium ChemInformatics -Original Message- From: David Short [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 12:14 AM To: 'Tomcat Users List' Subject: Tomcat, Oracle and connection caching. Does anyone have Tomcat 4.1.x running with connection caching using the Oracle oci8 driver? I can get it to work using the thin driver but it won't work with the oci8 driver. The oci8 driver works just fine with the test program provided by Oracle, so my configuration is right. There's something about the OracleConnectionCacheImpl class that the oci8 driver doesn't like. Here's the error: java.sql.SQLException: No suitable driver Any help would be greatly appreciated. - 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: Tomcat, Oracle and connection caching.
Howdy, Not sure where to go from here. Perhaps, if you had a few spare moments, you could try the oci8 driver and see what you come up with? I don't have a few spare moments, sorry ;) I'm overloaded as it is. But one thing I'd make sure is that the LD_LIBRARY_PATH is correctly set in tomcat's startup scripts -- that environment variable is ignored by defaults, but I think you need to set it up for the JVM to correctly locate the OCI driver's .so files at runtime. Yoav Shapira 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]
RE: Tomcat, Oracle and connection caching.
Make sure that the directory containing the DLLs/SOs is in your java library path. You can check by printing System.getProperty(java.library.path), if it isn't there you can set it at vm startup (add -Djava.library.path=/path/to/so) -Original Message- From: David Short [mailto:[EMAIL PROTECTED] Sent: 06 February 2004 16:09 To: 'Tomcat Users List' Subject: RE: Tomcat, Oracle and connection caching. It requires the Oracle client DLLs (or .so files) to be installed in the correct place and the path setup correctly. I have tested my oci8 configuration with the JdbcCheck program supplied by Oracle and the oci8 driver works just fine without JNI. For some reason, it's not working with JNI. I've been reading everything I can find on the subject and haven't seen anything explicitly describing special configurations, outside of what I've already tried, for JNI. The documentation states to simply replace thin with oci8 in the JDBCURL string. Also, in researching this, I've found that you need to replace the thin JDBCURL string as follows in the web.xml file: Thin driver: param-valuejdbc:oracle:thin:@serverName:1521:orcl/param-value oci8 driver: param-value(description=(address=(host=serverName)(protocol=tcp)(port=1521 ))(connect_data=(sid=orcl)))/param-value Not sure where to go from here. Perhaps, if you had a few spare moments, you could try the oci8 driver and see what you come up with? Thanks Dave -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 6:04 AM To: Tomcat Users List Subject: RE: Tomcat, Oracle and connection caching. Howdy, I have it running with the thin driver. I haven't tried OCI. Doesn't the OCI driver require some system libraries that have to be declared in the LD_LIBRARY_PATH or loaded via JNI? Yoav Shapira Millennium ChemInformatics -Original Message- From: David Short [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 12:14 AM To: 'Tomcat Users List' Subject: Tomcat, Oracle and connection caching. Does anyone have Tomcat 4.1.x running with connection caching using the Oracle oci8 driver? I can get it to work using the thin driver but it won't work with the oci8 driver. The oci8 driver works just fine with the test program provided by Oracle, so my configuration is right. There's something about the OracleConnectionCacheImpl class that the oci8 driver doesn't like. Here's the error: java.sql.SQLException: No suitable driver Any help would be greatly appreciated. - 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: Tomcat, Oracle and connection caching.
Still no luck. Here's the output from the System.getProperty(java.library.path): java.library.path=c:/orahome/bin;c:/orahome/jdbc/lib Here's the code: public class ResourceManagerListener implements ServletContextListener { private OracleConnectionCacheImpl ds = null; private Context ctx = null; public void contextInitialized(ServletContextEvent sce) { ServletContext application = sce.getServletContext(); /* * Get the JDBC URL, user, password and limit from the web.xml * context init parameters */ String jdbcURL = application.getInitParameter(jdbcURL); String user = application.getInitParameter(user); String password = application.getInitParameter(password); String minLimit = application.getInitParameter(minLimit); String maxLimit = application.getInitParameter(maxLimit); try { ds = new OracleConnectionCacheImpl(); ds.setURL(jdbcURL); ds.setUser(user); ds.setPassword(password); ds.setMinLimit(Integer.parseInt(minLimit)); ds.setMaxLimit(Integer.parseInt(maxLimit)); } catch (Exception e) { application.log(Failed to create data source: + e.getMessage()); this is where it fails. } /* Initialize the database connection pool. */ try { ctx = new InitialContext(); ctx.lookup(java:comp/env/jdbc/altura); } catch (Exception e) { application.log(Failed to create database connection pool: + e.getMessage()); } application.setAttribute(appDataSource, ds); } public void contextDestroyed(ServletContextEvent sce) { ServletContext application = sce.getServletContext(); application.removeAttribute(appDataSource); // Close the connections in the DataSource try { ds.close(); } catch (java.sql.SQLException e) {} ds = null; } } Here are the web.xml entries: context-param param-namejdbcURL/param-name param-value(description=(address=(host=serverName)(protocol=tcp)(port=1521 ))(connect_data=(sid=orcl)))/param-value /context-param context-param param-nameuser/param-name param-valueuserName/param-value /context-param context-param param-namepassword/param-name param-valuepassword/param-value /context-param context-param param-namemaxLimit/param-name param-value50/param-value /context-param context-param param-nameminLimit/param-name param-value5/param-value /context-param and the Tomcat application error log message: 2004-02-06 08:57:05 Failed to create data source: No suitable driver There is a strange twist. If I use the oci8 driver, with the ds.setMinLimit(Integer.parseInt(minLimit)); line above, this message appears in the Tomcat application log. If I comment out the line, no message appears, but when I try to get a connection, I get the java.sql.SQLException: No suitable driver message and the application fails. -Original Message- From: Ryan Lissack [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 8:21 AM To: 'Tomcat Users List' Subject: RE: Tomcat, Oracle and connection caching. Make sure that the directory containing the DLLs/SOs is in your java library path. You can check by printing System.getProperty(java.library.path), if it isn't there you can set it at vm startup (add -Djava.library.path=/path/to/so) -Original Message- From: David Short [mailto:[EMAIL PROTECTED] Sent: 06 February 2004 16:09 To: 'Tomcat Users List' Subject: RE: Tomcat, Oracle and connection caching. It requires the Oracle client DLLs (or .so files) to be installed in the correct place and the path setup correctly. I have tested my oci8 configuration with the JdbcCheck program supplied by Oracle and the oci8 driver works just fine without JNI. For some reason, it's not working with JNI. I've been reading everything I can find on the subject and haven't seen anything explicitly describing special configurations, outside of what I've already tried, for JNI. The documentation states to simply replace thin with oci8 in the JDBCURL string. Also, in researching this, I've found that you need to replace the thin JDBCURL string as follows in the web.xml file: Thin driver: param-valuejdbc:oracle:thin:@serverName:1521:orcl/param-value oci8 driver: param-value(description=(address=(host=serverName)(protocol=tcp)(port=1521 ))(connect_data=(sid=orcl)))/param-value Not sure where to go from here. Perhaps, if you had a few spare moments, you could try the oci8 driver and see what you come up with? Thanks Dave -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 6:04 AM To: Tomcat Users List Subject: RE: Tomcat, Oracle and connection caching. Howdy, I have it running with the thin driver. I haven't tried OCI. Doesn't the OCI driver require some system libraries that have to be declared in the LD_LIBRARY_PATH or loaded via JNI
RE: Tomcat, Oracle and connection caching.
I have only used the oci driver under Oracle 9i. Our url looked something like this though: jdbc:oracle:oci:@TNS_ENTRY_NAME where TNS_ENTRY_NAME is an entry in [ORACLE_CLIENT_HOME]/network/ADMIN/tnsnames.ora So for you, something like this ... TNS_ENTRY_NAME = (description=(address=(host=serverName)(protocol=tcp)(port=1521 ))(connect_data=(sid=orcl)) -Original Message- From: David Short [mailto:[EMAIL PROTECTED] Sent: 06 February 2004 17:20 To: 'Tomcat Users List' Subject: RE: Tomcat, Oracle and connection caching. Still no luck. Here's the output from the System.getProperty(java.library.path): java.library.path=c:/orahome/bin;c:/orahome/jdbc/lib Here's the code: public class ResourceManagerListener implements ServletContextListener { private OracleConnectionCacheImpl ds = null; private Context ctx = null; public void contextInitialized(ServletContextEvent sce) { ServletContext application = sce.getServletContext(); /* * Get the JDBC URL, user, password and limit from the web.xml * context init parameters */ String jdbcURL = application.getInitParameter(jdbcURL); String user = application.getInitParameter(user); String password = application.getInitParameter(password); String minLimit = application.getInitParameter(minLimit); String maxLimit = application.getInitParameter(maxLimit); try { ds = new OracleConnectionCacheImpl(); ds.setURL(jdbcURL); ds.setUser(user); ds.setPassword(password); ds.setMinLimit(Integer.parseInt(minLimit)); ds.setMaxLimit(Integer.parseInt(maxLimit)); } catch (Exception e) { application.log(Failed to create data source: + e.getMessage()); this is where it fails. } /* Initialize the database connection pool. */ try { ctx = new InitialContext(); ctx.lookup(java:comp/env/jdbc/altura); } catch (Exception e) { application.log(Failed to create database connection pool: + e.getMessage()); } application.setAttribute(appDataSource, ds); } public void contextDestroyed(ServletContextEvent sce) { ServletContext application = sce.getServletContext(); application.removeAttribute(appDataSource); // Close the connections in the DataSource try { ds.close(); } catch (java.sql.SQLException e) {} ds = null; } } Here are the web.xml entries: context-param param-namejdbcURL/param-name param-value(description=(address=(host=serverName)(protocol=tcp)(port=1521 ))(connect_data=(sid=orcl)))/param-value /context-param context-param param-nameuser/param-name param-valueuserName/param-value /context-param context-param param-namepassword/param-name param-valuepassword/param-value /context-param context-param param-namemaxLimit/param-name param-value50/param-value /context-param context-param param-nameminLimit/param-name param-value5/param-value /context-param and the Tomcat application error log message: 2004-02-06 08:57:05 Failed to create data source: No suitable driver There is a strange twist. If I use the oci8 driver, with the ds.setMinLimit(Integer.parseInt(minLimit)); line above, this message appears in the Tomcat application log. If I comment out the line, no message appears, but when I try to get a connection, I get the java.sql.SQLException: No suitable driver message and the application fails. -Original Message- From: Ryan Lissack [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 8:21 AM To: 'Tomcat Users List' Subject: RE: Tomcat, Oracle and connection caching. Make sure that the directory containing the DLLs/SOs is in your java library path. You can check by printing System.getProperty(java.library.path), if it isn't there you can set it at vm startup (add -Djava.library.path=/path/to/so) -Original Message- From: David Short [mailto:[EMAIL PROTECTED] Sent: 06 February 2004 16:09 To: 'Tomcat Users List' Subject: RE: Tomcat, Oracle and connection caching. It requires the Oracle client DLLs (or .so files) to be installed in the correct place and the path setup correctly. I have tested my oci8 configuration with the JdbcCheck program supplied by Oracle and the oci8 driver works just fine without JNI. For some reason, it's not working with JNI. I've been reading everything I can find on the subject and haven't seen anything explicitly describing special configurations, outside of what I've already tried, for JNI. The documentation states to simply replace thin with oci8 in the JDBCURL string. Also, in researching this, I've found that you need to replace the thin JDBCURL string as follows in the web.xml file: Thin driver: param-valuejdbc:oracle:thin:@serverName:1521:orcl/param-value oci8 driver: param-value(description=(address=(host=serverName)(protocol=tcp)(port=1521 ))(connect_data=(sid=orcl)))/param
RE: Tomcat, Oracle and connection caching.
Are you using it with connection caching? -Original Message- From: Ryan Lissack [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 10:09 AM To: 'Tomcat Users List' Subject: RE: Tomcat, Oracle and connection caching. I have only used the oci driver under Oracle 9i. Our url looked something like this though: jdbc:oracle:oci:@TNS_ENTRY_NAME where TNS_ENTRY_NAME is an entry in [ORACLE_CLIENT_HOME]/network/ADMIN/tnsnames.ora So for you, something like this ... TNS_ENTRY_NAME = (description=(address=(host=serverName)(protocol=tcp)(port=1521 ))(connect_data=(sid=orcl)) -Original Message- From: David Short [mailto:[EMAIL PROTECTED] Sent: 06 February 2004 17:20 To: 'Tomcat Users List' Subject: RE: Tomcat, Oracle and connection caching. Still no luck. Here's the output from the System.getProperty(java.library.path): java.library.path=c:/orahome/bin;c:/orahome/jdbc/lib Here's the code: public class ResourceManagerListener implements ServletContextListener { private OracleConnectionCacheImpl ds = null; private Context ctx = null; public void contextInitialized(ServletContextEvent sce) { ServletContext application = sce.getServletContext(); /* * Get the JDBC URL, user, password and limit from the web.xml * context init parameters */ String jdbcURL = application.getInitParameter(jdbcURL); String user = application.getInitParameter(user); String password = application.getInitParameter(password); String minLimit = application.getInitParameter(minLimit); String maxLimit = application.getInitParameter(maxLimit); try { ds = new OracleConnectionCacheImpl(); ds.setURL(jdbcURL); ds.setUser(user); ds.setPassword(password); ds.setMinLimit(Integer.parseInt(minLimit)); ds.setMaxLimit(Integer.parseInt(maxLimit)); } catch (Exception e) { application.log(Failed to create data source: + e.getMessage()); this is where it fails. } /* Initialize the database connection pool. */ try { ctx = new InitialContext(); ctx.lookup(java:comp/env/jdbc/altura); } catch (Exception e) { application.log(Failed to create database connection pool: + e.getMessage()); } application.setAttribute(appDataSource, ds); } public void contextDestroyed(ServletContextEvent sce) { ServletContext application = sce.getServletContext(); application.removeAttribute(appDataSource); // Close the connections in the DataSource try { ds.close(); } catch (java.sql.SQLException e) {} ds = null; } } Here are the web.xml entries: context-param param-namejdbcURL/param-name param-value(description=(address=(host=serverName)(protocol=tcp)(port=1521 ))(connect_data=(sid=orcl)))/param-value /context-param context-param param-nameuser/param-name param-valueuserName/param-value /context-param context-param param-namepassword/param-name param-valuepassword/param-value /context-param context-param param-namemaxLimit/param-name param-value50/param-value /context-param context-param param-nameminLimit/param-name param-value5/param-value /context-param and the Tomcat application error log message: 2004-02-06 08:57:05 Failed to create data source: No suitable driver There is a strange twist. If I use the oci8 driver, with the ds.setMinLimit(Integer.parseInt(minLimit)); line above, this message appears in the Tomcat application log. If I comment out the line, no message appears, but when I try to get a connection, I get the java.sql.SQLException: No suitable driver message and the application fails. -Original Message- From: Ryan Lissack [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 8:21 AM To: 'Tomcat Users List' Subject: RE: Tomcat, Oracle and connection caching. Make sure that the directory containing the DLLs/SOs is in your java library path. You can check by printing System.getProperty(java.library.path), if it isn't there you can set it at vm startup (add -Djava.library.path=/path/to/so) -Original Message- From: David Short [mailto:[EMAIL PROTECTED] Sent: 06 February 2004 16:09 To: 'Tomcat Users List' Subject: RE: Tomcat, Oracle and connection caching. It requires the Oracle client DLLs (or .so files) to be installed in the correct place and the path setup correctly. I have tested my oci8 configuration with the JdbcCheck program supplied by Oracle and the oci8 driver works just fine without JNI. For some reason, it's not working with JNI. I've been reading everything I can find on the subject and haven't seen anything explicitly describing special configurations, outside of what I've already tried, for JNI. The documentation states to simply replace thin with oci8 in the JDBCURL string. Also, in researching this, I've found that you need to replace the thin JDBCURL string