Tuesday, March 25, 2014

Clearing WebLogic Server Cache

All the web-tier related files like .jsp, .class, JSPCompiled files, etc gets stored in a directory. This is treated as cache whenever restart of WebLogic instance happens 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.

Whenever your application is accessed for the first time after fresh deployment of a new version, WebLogic server lookup in this 'tmp' cache directory, if there older objects exists then it will conflict with new code objects. This is where the need of removal of cache arises. When 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 Weblogic Server version 9.x & 10.x removal of cache means deleting each server instance's 'tmp' folder contents or you can simply remove 'tmp' folder too provided there should not be configuration changes happening to the server.

Below example clears the weblogic managed server cache for Oracle Access Manager OAM.

[sami@srv tmp]$ pwd
/u03/oracle/mwoam/user_projects/domains/IAMDomain/servers/oam_server1/tmp

[sami@srv tmp]$ ls -ltr
drwxrwxrwx 27 sami dba 4096 Feb 28 08:11 _WL_user
drwxrwxrwx  9 sami dba 4096 Feb 28 08:11 _WL_internal
-rwxrwxrwx  1 sami dba  687 Mar  6 12:21 WebServiceUtils.ser
-rw-r-----  1 sami dba    0 Mar 18 12:04 oam_server1.lok


[sami@srv tmp]$ rm -rf /u03/oracle/mwoam/user_projects/domains/IAMDomain/servers/oam_server1/tmp

For any queries and help related to weblogic server administration, please don't hesitate to contact me. samiora@gmail.com