Re: Hot redeploying a WAR - HTML is not refreshed
- Original Message - From: Peter Desjardins [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Thursday, August 14, 2008 6:58 AM Subject: Hot redeploying a WAR - HTML is not refreshed Hi. I have a web application that consists of an online help system. It serves HTML content using the Eclipse user assistance system. The usage I need to support is that the help system WAR is running in Tomcat, we repackage a new version of the WAR with updated content (only new HTML pages, no new application functionality), and then hot redeploy the new WAR file. The hope is that users will see the new HTML content with minimal interruption of service. I am able to hot redeploy the new WAR files by overwriting the versions in the webapps directory. In the server log I can verify that Tomcat undeploys the old version and then deploys the new version. However, the HTML files that are being served are not updated. Tomcat serves the HTML pages from the previous WAR file. If I stop the server, replace the WAR files, delete the work directory, and restart the server, the HTML pages are refreshed. Is there a way to clear all the old content from the cache during a hot redeploy? Or is there any other way to serve the new HTML content without stopping the server? I am using Apache Tomcat Version 6.0.18, jdk1.5.0_14, and Windows XP. Thanks for your help. Peter Desjardins Peter, it doesnt make sense to me... if the html file is changed its changed. Try edit an HTML file while TC is running, then refresh the browser... it will show you the new one... hopefully I dont know this eclipse framework you using, so maybe I'm not getting it... But I think... either you have some smart software attached that is doing the caching... ie some kind of no so smart filter... Or its just the browser caching... IE tends to forget easily, but Opera has a memory like an elephant ;) If you change the html file and refresh the browser... I think you have to see the change... To stop HTML pages caching in a browser one uses various meta tags in the html page... then the browser gets it every time. Google for No Cache... I have 6.0.18 running as well... it doesnt exhibit that xstic... If its a special client and its using some kind of RSS feed maybe there is a setting there... Change a HTML file in your web app... refresh the browser... if its not changing then there is an issue... Or maybe its something silly like the webapp is up to mischief... if it does that... open that webapp and check that the file you think are changed are actually changed inside... I think its a silly thing somewhere ;) There may be some new caching in TC that I'm not aware of... some setting, but my TC's are not doing that ;) Have fun... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Hot redeploying a WAR - HTML is not refreshed
Thanks for the information. I know it is not the browser caching. I've tried both IE and Firefox, clearing all caches and refreshing. I did look more closely at what Tomcat is doing when it hot redeploys my WAR file. I'm using an unmodified copy of Tomcat to test this issue. So Tomcat deploys the new HTML files here: C:\apache-tomcat-6.0.18\webapps\war-file-name\ But it leaves the old HTML files here: C:\apache-tomcat-6.0.18\work\Catalina\localhost\war-file-name\ And the browser is getting the old HTML files. If I shut down the server, delete C:\apache-tomcat-6.0.18\work\, and restart the server, the browser sees the new HTML files. Is deleting the work directory standard practice for completely refreshing web content? I can't do it while Tomcat is accessing the files. Or is there a configuration option that will cause Tomcat to delete and recreate the work directories when redeploying? Again, thank you. Peter Desjardins - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Hot redeploying a WAR - HTML is not refreshed
- Original Message - From: Peter Desjardins [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, August 14, 2008 5:00 PM Subject: Re: Hot redeploying a WAR - HTML is not refreshed Thanks for the information. I know it is not the browser caching. I've tried both IE and Firefox, clearing all caches and refreshing. I did look more closely at what Tomcat is doing when it hot redeploys my WAR file. I'm using an unmodified copy of Tomcat to test this issue. So Tomcat deploys the new HTML files here: C:\apache-tomcat-6.0.18\webapps\war-file-name\ But it leaves the old HTML files here: C:\apache-tomcat-6.0.18\work\Catalina\localhost\war-file-name\ And the browser is getting the old HTML files. If I shut down the server, delete C:\apache-tomcat-6.0.18\work\, and restart the server, the browser sees the new HTML files. Is deleting the work directory standard practice for completely refreshing web content? I can't do it while Tomcat is accessing the files. Or is there a configuration option that will cause Tomcat to delete and recreate the work directories when redeploying? Again, thank you. Peter Desjardins Peter... I dont know... I cant get it to do anything like that... Try with something that isnt your application, like the examples that come with TC... For example view a JSP or an HTML example... Then open the unpacked webapp cal1.jsp example... change the title, and refresh the browser.. Note I have not even told TC to reinstall the webapp and it changes it knows the html or web app has changed... I've never had to touch a work file ever... imagine if we did have to delete it on a deploy, ouch! No there is something else going on... I'm wondering if its not worth trying a diff version of TC just to elim that as well, maybe we got a diff build... You see... if say a servlet is busy... and you drop a new webapp in what TC will do is make sure all the busy stuff finishes, and then it will only change (redeploy the web app) The other thing is that I cant actually recall ever seeing an HTML file in the work folder... I see stuff like... basic_002darithmetic_jsp.class basic_002darithmetic_jsp.java which is what it is used for... ie to hold the compiled JSP's... if you using HTML to describe JSP's then we already have crossed lines... I dont know if you ever noticed, but for example if you cchange tomcats default root index.jsp... it aslo doesnt change, but thats because its precompiled into the app... Done guessing... I cant make it do it on my apps... best of luck ;( Ah just had another brain wave... it happen, albeit seldomly ;) Next time it happens... check the conf\Catalina\localhost THE WEBAPP CONTEXT FILE... I bet its still pointing at your dev environment delete that, then drop the webapp in... You see TC almost may be saying... the idiot (just kidding) has dropped a webapp into me... but the one I'm actually using in the IDE, is still cool, so I'll just ignore the other one When you done developing from an IDE... esp Netbeans... you must undeploy it... else it still uses the webapp in the build folder of NB... Ok now I really am done guessing... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Hot redeploying a WAR - HTML is not refreshed
From: Peter Desjardins [mailto:[EMAIL PROTECTED] Subject: Re: Hot redeploying a WAR - HTML is not refreshed I did look more closely at what Tomcat is doing when it hot redeploys my WAR file. Exactly how are you accomplishing this hot redeployment? Does Tomcat really shut down the application and reload it? Since you're on a Windows box, you may want to experiment with the antiResourceLocking attribute of your webapp's Context element - but watch out for the caveats mentioned in the doc: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Standard%20Implementation - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Hot redeploying a WAR - HTML is not refreshed
Those are excellent suggestions. Thanks. The other thing is that I cant actually recall ever seeing an HTML file in the work folder... I see stuff like... basic_002darithmetic_jsp.class basic_002darithmetic_jsp.java which is what it is used for... ie to hold the compiled JSP's... if you using HTML to describe JSP's then we already have crossed lines... Maybe this is causing the problem: the HTML files are wrapped up in JAR files. This is functionality of the Eclipse help system. You can wrap up all of your documentation content (HTML files, image files, tables of contents, ...) in a JAR file. This becomes a documentation plugin that the Eclipse application knows how to unpack and serve. So my HTML content is actually in here: C:\apache-tomcat-6.0.18\webapps\war-file-name\WEB-INF\eclipse\plugins\com.my.doc.plugin.name.jar C:\apache-tomcat-6.0.18\work\Catalina\localhost\war-file-name\eclipse\plugins\com.my.doc.plugin.name.jar Does the fact that my content is in a JAR file make a difference? Is there a different way that Tomcat handles redeploying JAR files? Also, there is no development environment on my computer. I am taking the WAR files from a separate build server and just trying to deploy and redeploy locally. Thank you. Peter Desjardins - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Hot redeploying a WAR - HTML is not refreshed
- Original Message - From: Peter Desjardins [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, August 14, 2008 7:00 PM Subject: Re: Hot redeploying a WAR - HTML is not refreshed Those are excellent suggestions. Thanks. The other thing is that I cant actually recall ever seeing an HTML file in the work folder... I see stuff like... basic_002darithmetic_jsp.class basic_002darithmetic_jsp.java which is what it is used for... ie to hold the compiled JSP's... if you using HTML to describe JSP's then we already have crossed lines... Maybe this is causing the problem: the HTML files are wrapped up in JAR files. This is functionality of the Eclipse help system. You can wrap up all of your documentation content (HTML files, image files, tables of contents, ...) in a JAR file. This becomes a documentation plugin that the Eclipse application knows how to unpack and serve. So my HTML content is actually in here: C:\apache-tomcat-6.0.18\webapps\war-file-name\WEB-INF\eclipse\plugins\com.my.doc.plugin.name.jar C:\apache-tomcat-6.0.18\work\Catalina\localhost\war-file-name\eclipse\plugins\com.my.doc.plugin.name.jar Does the fact that my content is in a JAR file make a difference? Is there a different way that Tomcat handles redeploying JAR files? Also, there is no development environment on my computer. I am taking the WAR files from a separate build server and just trying to deploy and redeploy locally. Thank you. Peter Desjardins My best guess is that the framework is not letting go... ie that plugin is running in a thread or something... and TC cant dump the thing out of its classloaders. No it shouldnt make any diff... the webapp should replace everything... But it is possible that a help system is doing some form of caching, running singletons and never ending threads... You have to (I guess) find someway of telling that system to die... its staying alive somehow.. --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Hot redeploying a WAR - HTML is not refreshed
quiesce the container *look for shutdownbat/sh* clean off everything under %TOMCAT_HOME%/work clean off everything under %TOMCAT_HOME%/logs clean off everything under %TEMP% start tc Martin - __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: Hot redeploying a WAR - HTML is not refreshed Date: Thu, 14 Aug 2008 20:01:52 +0200 - Original Message - From: Peter Desjardins [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, August 14, 2008 7:00 PM Subject: Re: Hot redeploying a WAR - HTML is not refreshed Those are excellent suggestions. Thanks. The other thing is that I cant actually recall ever seeing an HTML file in the work folder... I see stuff like... basic_002darithmetic_jsp.class basic_002darithmetic_jsp.java which is what it is used for... ie to hold the compiled JSP's... if you using HTML to describe JSP's then we already have crossed lines... Maybe this is causing the problem: the HTML files are wrapped up in JAR files. This is functionality of the Eclipse help system. You can wrap up all of your documentation content (HTML files, image files, tables of contents, ...) in a JAR file. This becomes a documentation plugin that the Eclipse application knows how to unpack and serve. So my HTML content is actually in here: C:\apache-tomcat-6.0.18\webapps\war-file-name\WEB-INF\eclipse\plugins\com.my.doc.plugin.name.jar C:\apache-tomcat-6.0.18\work\Catalina\localhost\war-file-name\eclipse\plugins\com.my.doc.plugin.name.jar Does the fact that my content is in a JAR file make a difference? Is there a different way that Tomcat handles redeploying JAR files? Also, there is no development environment on my computer. I am taking the WAR files from a separate build server and just trying to deploy and redeploy locally. Thank you. Peter Desjardins My best guess is that the framework is not letting go... ie that plugin is running in a thread or something... and TC cant dump the thing out of its classloaders. No it shouldnt make any diff... the webapp should replace everything... But it is possible that a help system is doing some form of caching, running singletons and never ending threads... You have to (I guess) find someway of telling that system to die... its staying alive somehow.. --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Get more from your digital life. Find out how. http://www.windowslive.com/default.html?ocid=TXT_TAGLM_WL_Home2_082008
Re: Hot redeploying a WAR - HTML is not refreshed
Exactly how are you accomplishing this hot redeployment? Does Tomcat really shut down the application and reload it? I copy the new version of the WAR file into C:\apache-tomcat-6.0.18\webapps\, overwriting the old copy. Here's the log: Aug 14, 2008 3:45:05 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Aug 14, 2008 3:45:05 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 559 ms Aug 14, 2008 3:45:05 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Aug 14, 2008 3:45:05 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 Aug 14, 2008 3:45:05 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive nexus-5-0-admin.war Aug 14, 2008 3:45:22 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive nexus-5-0-eped.war Aug 14, 2008 3:45:32 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive nexus-5-0-ps-mon.war Aug 14, 2008 3:45:42 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Aug 14, 2008 3:45:42 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Aug 14, 2008 3:45:42 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/32 config=null Aug 14, 2008 3:45:42 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 36795 ms * New versions of WAR files copied into C:\apache-tomcat-6.0.18\webapps Aug 14, 2008 3:46:42 PM org.apache.catalina.startup.HostConfig checkResources INFO: Undeploying context [/nexus-5-0-ps-mon] Aug 14, 2008 3:46:50 PM org.apache.catalina.startup.HostConfig checkResources INFO: Undeploying context [/nexus-5-0-admin] Aug 14, 2008 3:46:58 PM org.apache.catalina.startup.HostConfig checkResources INFO: Undeploying context [/nexus-5-0-eped] Aug 14, 2008 3:47:05 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive nexus-5-0-admin.war Aug 14, 2008 3:47:16 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive nexus-5-0-eped.war Aug 14, 2008 3:47:25 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive nexus-5-0-ps-mon.war Since you're on a Windows box, you may want to experiment with the antiResourceLocking attribute of your webapp's Context element - but watch out for the caveats mentioned in the doc: This problem is occurring on two type of Linux server also. I'm just troubleshooting the problem on my Windows computer. Thanks! Peter - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]