-
1. Re: Delete tmp folder on redeploy
jaikiran Oct 14, 2010 12:31 AM (in response to bkenison)When you say stop and restart, do you mean stopping and starting the server or do you mean redeploying the application? Which Operating system are you on and which exact version/vendor of Java?
-
2. Re: Delete tmp folder on redeploy
wdfink Oct 14, 2010 3:05 AM (in response to bkenison)With JBoss 4.3.0(EAP) the tmp directory was not deleted after stopping.
We decide to delete tmp and work before starting because sometimes we have startup problems which disapear after removing this directories.
-
3. Re: Delete tmp folder on redeploy
jaikiran Oct 14, 2010 3:10 AM (in response to wdfink)Wolf-Dieter Fink wrote:
With JBoss 4.3.0(EAP) the tmp directory was not deleted after stopping.
I would have expected the tmp to be deleted and recreated on every server restart.
Wolf-Dieter Fink wrote:
We decide to delete tmp and work
The "work" directory is a bit different. It by default is not recreated every restart. There's a configuration in one of the xml files which controls the work directory recreation.
-
4. Re: Delete tmp folder on redeploy
bkenison Oct 14, 2010 11:26 AM (in response to jaikiran)I am running on Windows Server 2008 and have JBoss 5.1.0.GA running as a Windows service. By stopping/starting, I am stopping the service and restarting the service. Stopping the service does a complete stop of JBoss. When restarting the service, JBoss is started and the ear is re-deployed. The prior contents of the tmp directory remain and additional files are created.
In JBoss 4.2.3.GA, this did not happen. In 4.2.3, the prior contents of the tmp directory were removed and only the newly deployed files exist once JBoss has completely started. I have seen reference to the configuration to delete the work directory and wondered if there was a similar control for the tmp directory.
-
5. Re: Delete tmp folder on redeploy
peterj Oct 14, 2010 11:49 AM (in response to bkenison)If I recall correctly for another discussion, you are using service.bat for run as a service. You can add a 'del' into either run.bat or even service.bat (as part of either start or stop) to remove the tmp directory.
-
6. Delete tmp folder on redeploy
glyph5 Apr 11, 2011 2:06 PM (in response to peterj)Just wanted to comment on this, I achieved this by adding the following lines to the top of the run.bat:
rem Remove tmp folder on startup
set TMP_FOLDER ..\server\default\tmp
rmdir /s /q %TMP_FOLDER%
Note: This path is relative to the \bin folder and you might need to rename the path to match your instance.
-
7. Delete tmp folder on redeploy
peterj Apr 11, 2011 4:45 PM (in response to glyph5)Change the second line to:
set TMP_FOLDER=%JBOSS_HOME%\server\default\tmp
Note that the first thing that run.bat does is set JBOSS_HOME (if it is not already set, and I recommend never to set it).