Yesterday, I required a clean WebSphere Application Server Cache because one among my colleagues was working on the IBM UNICA application, and she or he made some changes that require a WAS restart and clean WebSphere Application Server cache also. So, in this tutorial, we'll see the way to clear the WebSphere Application Server (WAS) Cache.
Why We Need Clean WebSphere Cache?
There are multiple reasons for which we sometimes need to clean the WebSphere cache.
- After the upgrade, the class cache may still retain the classes of the previous version.
- The cache may also be corrupted.
Types of Cache in WebSphere Application Server:
There are two types of cache in the WebSphere Application Server.
- JVM's cache
- OSGi cache
Clear JVM class Cache:
Note: - Remember, I have installed the UNICA application on Windows OS so, sharing the steps I performed on the Windows Operating System. But if you are running Unix or Linux , run the script with .sh instead of .bat
- Go to the command line by hitting window key + R from your computer and then type cmd. i.e., press window key + R →then type "cmd" from the keyboard → , and finally press Enter key.
- Go to the bin directory of the application server profile. In my case, it was E:/Unica/IBMWAS/WebSphere/AppServer/profiles/AppSrv01/bin
- Type clearClassCache.bat and press the Enter key. Once this command finishes, it will take you back to the command prompt.
Clear OSGi class Cache:
- Type osgiCfgInit.bat and press the Enter key. Once this command finishes, you will see two lines stating that the OSGI profile and WebSphere server cache are clear successfully.
- If you are running WebSphere as a service, the clearClassCache command may not completely clear the javasharedresources folder. In this case, you need to perform another step.
- You need to go to your user's folder and then the AppData folder. By default, the Application Data folder is hidden. Press Window Key + R then Type CMD → then Type %appdata% → and at last Press Enter key.
- Then, go to the Local folder and take the backup of the javasharedresources folder.
- Remove/Delete all files within this folder. Everything is fine now.
Points to Remember:
- Please do not clean the cache when anyone of the JVM is running and cache is in use. You should stop the JVM server before clearing the cache.
- You must log in as the user who started WebSphere Application Server.
In the next article, I will explain how we can export LTPA keys from WebSphere Application Server. If you have question, queries or remarks related to this post please do write us in the comment section.
No comments:
Post a Comment
Please do not enter spam links.