Monday, July 12, 2010

Clearing Cache for WebLogic instance

Hey smart WLA, 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?
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 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 persistance, your web-tier may contain static contents then Cache will be used by WebLogic Application Server instance.

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 conflict with new code objects. This is where the need of removal of cache arises.

Where there is a need of 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 .wldonotdelete folder. In 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: rd 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 the given directory.

When to do this?
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.

Alternative solution is you can use 'stage' mode set to 'no_stage' deployment. when undeployed an applicaiton then WebLogic server itself removes the cache objects.


  1. interesting blog, i will visit ur blog very often, hope u go for this website to increase visitor.Happy Blogging!!!

  2. How do you clear the nodemanager cache? im runnign weblogic on windows and my nodemanager has stored a previous system PATH and it had spaces now i have fixed it in the windows envionment variables but when i try start the managed server from the admin console using nodemenager but it errors out and show evidence of the previous path being stored somewherhe.

    i have uninstalled the service and reinstalled and reboot the server but nothing seems to work.

  3. Its Really helpful,

    about hte weblogic cache.


  4. Thank you so much!

  5. thank you so much, it's very usefull to know how to clean apps cache.

  6. Hi,
    I have a issue ,when custom log files relted to application is getting cached , even its doing the changes in the physical/box directory its not doing the changes when I am trying to access through the web URL , it has permissions , I need to know if hts caches how can I get the new logs to show up.


  7. @Vivek, correct me if I missing anything you mentioned, If your logs are accessible through web URL you might sort them to show up new one on top. sort works different for different OS environments. check which program pulling the logs to your web URL update with sort functionality.
    hope you it will works!

  8. Hi,

    Since we migrated from91 to 10.3.5, I am seeing that I must physically remove the precompiled jsp pages from the work directory. This happens 90% of time that WebLogic is
    not recognizing the updated page and recompiling it. Any idea why this is happening.
    Its a exploded ear and war way of deployment.In weblogic 91 copying the jsp pages to war doesn't require the pysical deleteions of jsps. Any ideas would be higly appreciated.


    1. We also are facing the same types of issues, specifically with out JSP pages....Came across an article noting the jsp descriptor "page-check-seconds". It states that in 10.x it defaults to -1 in production mode, and hence never checks to see if there is a newer version of a jsp. You can set this to 0 to always check, or another value to check in "n" seconds (ie 60). We are going to try this and see if it helps, but was wondering if anyone else has tried with any success?

  9. Thanks for the post, In this complex environment business need to present there company data in meaningful way.So user easily understand it .Sqiar ( which is in UK,provide services like Tableau and Data Warehousing etc .In these services sqiar experts convert company data into meaningful way.

  10. we have installed Weblogic server 10.3.6 in RHEL 5.8.There also a "tmp" folder inside <> folder..this is the path of tmp folder in my case..Now My queary :: Is it Mandatory to delete files from tmp folder manally or the The Server will take care of this action..please let me know..If we have no action taken for tmp deletion is there any Impact on Application server. ?? Actullay is there any way to delete tmp i.e After downing the App server ? is there any priority in that.Please let me know and reply to mail ""


Blurb about this blog

Blurb about this blog

Essential Middleware Administration takes in-depth look at the fundamental relationship between Middleware and Operating Environment such as Solaris or Linux, HP-UX. Scope of this blog is associated with beginner or an experienced Middleware Team members, Middleware developer, Middleware Architects, you will be able to apply any of these automation scripts which are takeaways, because they are generalized it is like ready to use. Most of the experimented scripts are implemented in production environments.
You have any ideas for Contributing to a Middleware Admin? mail to me