This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding ' work ' directory under tomcat.

 
Venkata Sirish
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
My question seems to be silly ... please don't mind .

What i need is , as soon as i restart my tomcat, the work folder under tomcat must be deleted. Is there any configuration that we can do through the server.xml or context.xml files ...

Thanks,
Venkata Guru
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've read a lot of Tomcat's configuration documentation and have never seen anything like that.
Why would you need this?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat's kick off scripts are just shell/batch scripts. CATALINA_HOME is already defined, just add some lines in the scripts to kill the data under the work folder.

Why would you need this?

During production you shouldn't. During development I've had situations where no matter what I did to a file I never saw the changes. Something got hung up and the only way to fix it was to delete the contents of the work dir and let Tomcat re-create it all.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
Tomcat's kick off scripts are just shell/batch scripts. CATALINA_HOME is already defined, just add some lines in the scripts to kill the data under the work folder.


Not always.
If you install Tomcat as a service the shell/batch scripts are not used to start and stop Tomcat.

Originally posted by Gregg Bolinger:

During production you shouldn't. During development I've had situations where no matter what I did to a file I never saw the changes. Something got hung up and the only way to fix it was to delete the contents of the work dir and let Tomcat re-create it all.


I've had similar cases where the dates get messed up causing Jasper to ignore newer versions of JSP files.
I'm not sure I would want this to happen automatically every time Tomcat is restarted. There are things in the work directory that you might not always want to delete (like serialized sessions).

Maybe I should have asked differently.
What problem are you trying to solve by doing this?
There may be a better way.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic