Here I am with one more interesting story of WebLogic Administration "Clearing Cache". This is most often in development environments, where you need to clear the cache for new releases for Web-tier changes, XML loadings, JDBC connection changes, JMS issues, etc.,.
Some of the great developers think like this "I can change minor things directly in the jsp files to test stuff"
What is actually WebLogic Cache?
Some of the great developers think like this "I can change minor things directly in the jsp files to test stuff"
What is actually WebLogic Cache?
Basically all the web-tier related files (.jsp .class, JSPCompiled files etc.,) get stored in ./wlnotdelete/app_yourapplicaiton directory. This is treated as cache whenever there is a restart of a WebLogic instance happen then the WebLogic server will look up for last serviced object status stored in the cache to service for any pending requests. Usually, when your EJB Classes need sessions, JMS object requires persistence, your web-tier may contain static contents then Cache will be used by WebLogic Application Server instance.
Cache Clearing in WebLogic Domain |
Why we need to remove Cache?
Whenever your application is accessed for the first time that fresh deployment of a new version, WebLogic server lookup in this directory, if there are older objects persists that will be a conflict with new code objects. This is where the need of removal of cache arises.
Where there is a need of a new version deployment we might need to clear the cache when the changes to the new version is not reflected. In the old version WebLogic 8.1 below we used to remove the .wldonotdelete folder. In the new version of WebLogic 9.x onwards removal of cache means deleting each server instance's tmp folder contains cache, stage folders or you can simply remove tmp folder too provided there should not be configuration changes happen to the server.
Generally for WebLogic 9.x and higher versions
WIN: C:\bea\user_projects\domains\yourdomain\servers\yourserver\tmp
UNIX: /bea/user_projects/domains/yourdomain/servers/yourserver/tmp
you can use the following commands to clear the cache:
WIN: rmdir C:\bea\user_projects\domains\yourdomain\servers\yourserver\tmp \s
UNIX: rm -rf /bea/user_projects/domains/yourdomain/servers\yourserver/tmp
Here I am removing all the subdirectories and files in the given directory.
When to do this Clearing Cache?
Where there is a need of a new version deployment we might need to clear the cache when the changes to the new version is not reflected. In the old version WebLogic 8.1 below we used to remove the .wldonotdelete folder. In the new version of WebLogic 9.x onwards removal of cache means deleting each server instance's tmp folder contains cache, stage folders or you can simply remove tmp folder too provided there should not be configuration changes happen to the server.
Generally for WebLogic 9.x and higher versions
WIN: C:\bea\user_projects\domains\yourdomain\servers\yourserver\tmp
UNIX: /bea/user_projects/domains/yourdomain/servers/yourserver/tmp
you can use the following commands to clear the cache:
WIN: rmdir C:\bea\user_projects\domains\yourdomain\servers\yourserver\tmp \s
UNIX: rm -rf /bea/user_projects/domains/yourdomain/servers\yourserver/tmp
Here I am removing all the subdirectories and files in the given directory.
When to do this Clearing Cache?
After Stopping the WebLogic server instance you can go for removal of cache.
Mostly, Spring framework users, struts framework users have this no changes reflected issue for their web applications.
An alternative solution is you can use the 'stage' mode set to 'no_stage' deployment. when undeployed an application then WebLogic server itself removes the cache objects.
Mostly, Spring framework users, struts framework users have this no changes reflected issue for their web applications.
An alternative solution is you can use the 'stage' mode set to 'no_stage' deployment. when undeployed an application then WebLogic server itself removes the cache objects.