How to force a recompilation of all Sling scripts jsps, java, and sightly in AEM 6.5

Description

How to force a recompilation of all Sling scripts jsps, java, and sightly in AEM 6.5

Environment

AEM 6.5

Resolution

Sometimes the JSP, HTL clientLibs, or classes will not get recompiled automatically in Adobe Experience Manager(AEM).  Strange UI issues can occur and compilation errors may be seen in the logs. Now, we do not have libraries under /var/clientlibs folder anymore, they are in the file system.

 1. Recompile via AEM Web Console:

  • For clientlibs access 1, click Invalidate Caches then click Rebuild Libraries.
  • For classes, JSPs and Slightly cache, Go to 2 and click Clear Class Loader on top right side.

 2. Recompile via the file system

For classes, JSPs and Slightly cache:

  • Search the server where AEM instance is deployed. From home folder run command: find launchpad/felix -path "*/bundle*/data/classes" -type d
  • Delete the “classes” folder

Note: Classes and Slightly cache is 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.

For ClientLibraries

  • Search in the server where AEM instance is deployed. From home folder run command: find launchpad/felix -path "*/bundle*/data/outputcache" -type d 
  • Delete outputcache folder

*Note:*Clientlibs is now stored in the Adobe 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.

1 http://host:port/libs/granite/ui/content/dumplibs.rebuild.html

2 http://host:port/system/console/fsclassloader

DOWNLOAD

Get file

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

On this page