Error with transformer breaks login screen | Community
Skip to main content
jkpanera
Level 4
December 5, 2020
Solved

Error with transformer breaks login screen

  • December 5, 2020
  • 1 reply
  • 769 views

Hi guys,

We have a custom html transformer configured as follows:

<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="nt:unstructured"
contentTypes="[text/html]"
enabled="{Boolean}true"
generatorType="htmlparser"
order="{Long}1"
serializerType="htmlwriter"
transformerTypes="[linkchecker,jsonlinksmapper]">
<generator-htmlparser
jcr:primaryType="nt:unstructured"
includeTags="[BUTTON,IW-ORDER-SETUP-FLOW,DIV,META,/META,A,/A,/AREA,FORM,BASE,LINK,SCRIPT,BODY,/BODY,VIDEO,/VIDEO,ASIDE,/ASIDE,SECTION,/SECTION]"/>
</jcr:root>

Most of the time it works fine but if something does go wrong, it can actually take down the login screen. I see an exception with the root exception of this:

 

 

Caused by: java.io.IOException: Unable to get component of class 'interface org.apache.sling.rewriter.Transformer' with type 'jsonlinksmapper'. at org.apache.sling.rewriter.impl.PipelineImpl.getPipelineComponent(PipelineImpl.java:161) at org.apache.sling.rewriter.impl.PipelineImpl.init(PipelineImpl.java:103) at org.apache.sling.rewriter.impl.ProcessorManagerImpl.getProcessor(ProcessorManagerImpl.java:480) ... 73 common frames omitted

 

 

I can usually fix whatever is wrong with the transformer (and sometimes it seems to be something else wrong with the bundle), but it's much harder if I can log in to crx etc. I can still use curl but it is pretty hard to diagnose issues without the system console, crx, etc.

I presume that the issue is that this html transformer is attempting to process the login screen and failing. I'd like to restrict the pipeline to only attempt to invoke it on specific paths or somehow exclude system paths.

Note that I'm not trying to fix the transformer. It's working fine at the moment.

Thanks!

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

@jkpanera 

As simple as it sounds, when working with the transformer configurations, there is a property that you can allow which paths to be HTML transformed, called paths. You can try other properties such as resourceTypes... for the full list of transformer configurations, checkout Apache's documentation page.

Your configuration can look something like this:

 

<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="nt:unstructured" contentTypes="[text/html]" enabled="{Boolean}true" generatorType="htmlparser" order="{Long}1" -> paths="[/content/my-site,/content/experience-fragments/my-site]" serializerType="htmlwriter" transformerTypes="[linkchecker,jsonlinksmapper]"> <generator-htmlparser jcr:primaryType="nt:unstructured" includeTags="[BUTTON,IW-ORDER-SETUP-FLOW,DIV,META,/META,A,/A,/AREA,FORM,BASE,LINK,SCRIPT,BODY,/BODY,VIDEO,/VIDEO,ASIDE,/ASIDE,SECTION,/SECTION]"/> </jcr:root>

 

I hope this helps

 

1 reply

BrianKasingli
Community Advisor and Adobe Champion
BrianKasingliCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
December 5, 2020

@jkpanera 

As simple as it sounds, when working with the transformer configurations, there is a property that you can allow which paths to be HTML transformed, called paths. You can try other properties such as resourceTypes... for the full list of transformer configurations, checkout Apache's documentation page.

Your configuration can look something like this:

 

<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="nt:unstructured" contentTypes="[text/html]" enabled="{Boolean}true" generatorType="htmlparser" order="{Long}1" -> paths="[/content/my-site,/content/experience-fragments/my-site]" serializerType="htmlwriter" transformerTypes="[linkchecker,jsonlinksmapper]"> <generator-htmlparser jcr:primaryType="nt:unstructured" includeTags="[BUTTON,IW-ORDER-SETUP-FLOW,DIV,META,/META,A,/A,/AREA,FORM,BASE,LINK,SCRIPT,BODY,/BODY,VIDEO,/VIDEO,ASIDE,/ASIDE,SECTION,/SECTION]"/> </jcr:root>

 

I hope this helps