Forcefully remove tmp files in JBoss running on Windows machine
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 5.x
- Operationg System: Microsoft Windows
Issue
- Sometimes in JBoss does not clears its tmp directory on server startup, even after providing the following parameter:
-Djboss.shutdown.forceHalt=false
Resolution
Add the following line in either run.bat or shutdown.bat
set tmp_location=<profile_home>\tmp
rmdir /s /q %tmp_location%
Keeping the above line in run.bat will ensure that the server clears up the tmp directory while starting the jboss server and keeping in shutdown.bat will ensure that the tmp directory is cleared while you stop the server using shutdown.sh.
It is preferred to keep the value in run.sh as you might not always stop the server using shutdown.sh. In case of server hang or server crash, hsutdown.sh will not be called.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
