


abhijitch
abhijitch
28-02-2019
Hi All,
I tried to do clientlibs versioning in AEM 6.1 by creating rewriter sling-folder and copying the 'default' node from libs > cq > config > rewriter. But its not working and the whole AEM local instance in getting corrupted. Error log is showing "Unable to get component of class 'interface org.apache.sling.rewriter.Transformer' with type 'versioned-clientlibs'."
Tried from the link http://www.aemcq5tutorials.com/tutorials/versioned-clientlibs-aem/
Any kind of help would be appreciated.
Regards,
Abhijit Chowdhury
Jörg_Hoh
Employee
Jörg_Hoh
Employee
01-03-2019
You should have ACS AEM Commons installed to make this work.
abhijitch
abhijitch
04-03-2019
ACS AEM Commons is already installed. Still it is not working.
smacdonald2008
smacdonald2008
04-03-2019
YOu can comment at that URL too for questions why its not working.
Gaurav-Behl
MVP
Gaurav-Behl
MVP
04-03-2019
If you follow Versioned ClientLibs, then this is all you need. No need for "default" node under rewriter as you mentioned.
/apps/<myapp>/config/rewriter/versioned-clientlibs.xml
The easiest way to configure the rewriter pipline is just to copy /libs/cq/config/rewriter/default
to a path inside your application, e.g. /apps/myapp/config/rewriter/versioned-clientlibs
. Note that the configuration node must be inside a four-level path that ends in config/rewriter
abhijitch
abhijitch
05-03-2019
I have done all the steps with changes and now the instance is up & running. But the issue is, versioning is not reflecting in local AEM instance. Its all the same js & css files without query parameters.
Gaurav-Behl
MVP
Gaurav-Behl
MVP
05-03-2019
Could you share the configuration screenshot the way I shared above?
In addition to that, how did you test, could you share a screenshot for the same?
abhijitch
abhijitch
05-03-2019
Below is the screenshot of the configuration done
I ran a page from AEM, checked the source code. The js file should be appended with a query parameter, which is not getting done.
Please note, All the bundles are active, and Enforce MD5 is checked in Versioned Clientlibs Transformer Factory.
Gaurav-Behl
MVP
Gaurav-Behl
MVP
05-03-2019
What works for me in my local is jcr:primaryType="sling:Folder"
The same config is mentioned @ Versioned ClientLibs
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType=
"sling:Folder"
contentTypes="[text/html]"
enabled="{Boolean}true"
generatorType="htmlparser"
order="{Long}1"
serializerType="htmlwriter"
transformerTypes="[linkchecker,versioned-clientlibs]"/>
I've not enforced MD5 in my local and it works fine. Per docs
-
Optionally, a filter can registered which checks incoming requests for client libraries and ensures that the hash in the path is the correct value
abhijitch
abhijitch
05-03-2019
Thanks. But in libs > cq > config > rewriter, the default node is nt:unstructured. So when I copied, it became nt:unstructured. If manually I create the default node by choosing jcr:primaryType as sling:Folder then it appears as a folder and NOT as a node.
I am using AEM 6.1.