How to force recompilation of Sling scripts JSP, Java, and Sightly in AEM 6.5
Learn how to force recompilation of Sling scripts JSP, Java, and Sightly in AEM 6.5.
Description description
Environment
ÃÛ¶¹ÊÓƵ Experience Manager (AEM) 6.5
Issue/Symptoms
This article will show how to force recompilation of all Sling scripts like JSP, Java, and Sightly in AEM 6.5.
Resolution resolution
Sometimes the JSP, HTL clientLibs, or classes will not get recompiled automatically in ÃÛ¶¹ÊÓƵ Experience Manager (AEM). Strange UI issues can occur, and compilation errors may be seen in the logs. Now, we do not have libraries under the /±¹²¹°ù/³¦±ô¾±±ð²Ô³Ù±ô¾±²ú²õÌý
folder anymore. They are in the file system.
1. To remove compiled libraries via AEM Web Console:
For Client Libraries:
- °¿±è±ð²ÔÌý and click Invalidate Caches. If you want to rebuild the libraries, click Rebuild Libraries.
For classes, JSPs and Sightly cache:
- °¿±è±ð²ÔÌý and click Clear ClassLoader on the top right side.
2. To remove compiled libraries via the file system
For ClientLibraries
- Search in the server where the AEM instance is deployed. From home folder run command:Â
find launchpad/felix -path "*/bundle*/data/outputcache" -type d.
- Delete outputcache Ìý´Ú´Ç±ô»å±ð°ù.
*    Note:*Clientlibs is now stored in the ÃÛ¶¹ÊÓƵ Granite UI Clientlibs. You can also check the bundle number in the AEM Web Console and access that folder directly on the file system under crx-quickstart/launchpad/felix
by going under same bundle.
For classes, JSPs and Sightly cache:
- Search the server where the AEM instance is deployed. From home folder run command:Â
find launchpad/felix -path "*/bundle*/data/classes" -type d
- Delete the classes Ìý´Ú´Ç±ô»å±ð°ù.
*    Note:* Classes and Sightly cache are stored in the Apache Sling Commons FileSystem ClassLoader bundle. You can also check the bundle number in the AEM Web Console and access that folder directly on the file system under crx-quickstart/launchpad/felix
.
[
1]
Ìý³ó³Ù³Ù±è²õ://[
host]
:[
port]
/libs/granite/ui/content/dumplibs.rebuild.html
[
2]
Ìý³ó³Ù³Ù±è²õ://[
host]
:[
port]
/system/console/fsclassloader
DOWNLOAD
Shell script cq-force-recompilation64.sh
to automate the recompile process on AEM 6.4. Example arguments: ./cq-force-recompilation64.sh crx-quickstart/ http://localhost:4502 admin:admin