• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

tomcat caching

 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you removed the application cache folder in /work/Catalina/localhost after setting the cachingAllowed flag to "false"?
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It works if I remove antiResourceLocking="true"
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic