Client Library Versioning in AEM 6.1 | Community
Skip to main content
March 1, 2019

Client Library Versioning in AEM 6.1

  • March 1, 2019
  • 3 replies
  • 6578 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

joerghoh
Adobe Employee
Adobe Employee
March 1, 2019

You should have ACS AEM Commons installed to make this work.

abhijitchAuthor
March 4, 2019

ACS AEM Commons is already installed. Still it is not working.

Level 3
January 13, 2020

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


why should the node be in 4 level path. In my case its 5 level down as per site structure. What should I do in that case? @joerghoh  @smacdonald2008 

smacdonald2008
Level 10
March 4, 2019

See Versioned ClientLibs

YOu can comment at that URL too for questions why its not working.

Level 2
March 26, 2019

Hi

I am on AEM 6.4 too. For me it is even stranger... I seems to work with a node of type nt:unstructured, but only on AUTHOR instance with a url which contains the /editor.html/ for triggering the authoring widgets in it. If I leave out the /editor.html, the md5 hashes disappear from all the clientlib references in the HTML markup.

On PUBLISH the feature doesn't seem to be active either (due to not using editor.html in the url?)

I have no idea why this is happening. Any hints?

Gaurav-Behl
Level 10
March 26, 2019

Probably, it is enabled/tied to runmode configuration

Check if you have "config.author" or similar rather than "config" folder in your setup:    /apps/myapp/config/rewriter/versioned-clientlibs.xml

Level 2
March 26, 2019

Sorry, no not at all. As you normally want this feature active in all runmodes (author and publish) this shouldn't be in a runmode specific folder in my opinion. Even if it was, I stated that it works and doesn't work with 2 urls patterns on AUTHOR.

I think I fixed it though. In our project we had another rewriter configuration active next to the 'versioned-clientlibs' node. It had a 'Paths' property value of '/content/...' in it. So I figured, what if that one is overwriting the result of my versioned-clientlibs? If you add the '/editor.html' I assume this no longer matches that path and that second one isn't applied?

The second on had order '10', while my versioned-clientlib config had order '1'. So I figured to see what happens if I reverse the order, so I set the order value on versioned-clientlibs to '11' and making sure it was of type {Long}. And voila, problem disappeared!

So please guys look at http://localhost:4502/system/console/status-slingrewriter and check the order value of your config.

I assume similar rewriters for the [text/html] content type have Paths, Selectors or Resource Types defined so they don't conflict with your config. If you find one with a similar setup, just try to give the 'versioned-clientlibs' a higher order value to see it is applied last.

Hope it works for you guys too! Cheers!