Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat caching

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34680
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I set up my context in <Tomcat root>/conf\Catalina\localhost to point to


Based on the documentation (and a colleague's comments), I thought docBase would be the root of my war. That way when i change class files or html files, they automatically get noticed. However, when I edit HTML files, Tomcat ignores them. I noticed Tomcat created a directory in <Tomcat root>\temp which has a copy of the web app each time I start Tomcat.

I tried adding another flag, but the caching still occurs.


Is there something else I need to set?
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you removed the application cache folder in /work/Catalina/localhost after setting the cachingAllowed flag to "false"?
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'ver never experienced this but I also know that you are using Freemarker (and I really never have) and I wonder if there is some caching going on with freemarker.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34680
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Misha,
I just tried deleting that directory along with the temp directory. After restarting the server, it created "<tomcat root>\temp\0-jforum". Which Tomcat then reads from instead of the desired directory in my Eclipse workspace.

Gregg,
I think it's pretty clear that the temp directory is storing a copy of what the exploded ear looks like on server startup. The same (caching) problem occurs if I try changing a .sql file. The question is why is there a temp directory with a copy of the exploded ear.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34680
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or maybe that directory is a red herring. The class files are definitely reloading automatically as I can add lines to a file and have the debugger pick them up when I go through the web app.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34680
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gregg Bolinger wrote:I'ver never experienced this but I also know that you are using Freemarker (and I really never have) and I wonder if there is some caching going on with freemarker.

One other thing. If I change the html file in the temp directory, the web app does pick it up.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens if you use docBase="<workspace>\JForum\src\main\webapp\yourear.ear" instead ? Actually, it should be a WAR, but I'm not sure what you are doing.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34680
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christophe,
I don't have an ear, just a war.

This only makes sense if you are a moderator - I'm trying to run JForum in the configuration Gregg suggested.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:This only makes sense if you are a moderator - I'm trying to run JForum in the configuration Gregg suggested.

Wasn't this meant to point to "src\main\webapp", not to a war file ?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I have the same problem. I was working on /templates/default/admin/forum_form.htm, but it doesn't show my changes. My saved file is not being copied to the temp directory.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works if I remove antiResourceLocking="true"
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christophe Verré wrote:It works if I remove antiResourceLocking="true"


That's interesting. Normally, I've experienced the need for that when working on Windows because Tomcat will lock files so you can't save them otherwise.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34680
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christophe Verré wrote:It works if I remove antiResourceLocking="true"

That works for me too. I'll remove antiResourceLocking from the setup document. And now Tomcat doesn't create a copy of the war in the temp folder.

Interestingly, according to a bug report, this was fixed in 2005.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interestingly, according to a bug report, this was fixed in 2005.

What I understand from that report is that the only thing changed was the documentation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic