Large message size causing error with xssAPI.filterHTML in AEM 6.1 ?


Question: After a batch import, we get the following error in /libs/cq/gui/components/endor/badge/badge.jsp which prevented the touch UI from completely loading the authoring page

  1. java.lang.RuntimeException: Unable to scan input
  2. at
  3. at
  4. at
  5. at
  6. at com.adobe.granite.xss.impl.XSSAPIImpl.filterHTML(
  7. at org.apache.jsp.apps.cq.gui.components.endor.badge.badge_jsp._jspService(
  8. at
  9. at javax.servlet.http.HttpServlet.service(

Answer:  XSS API in AEM uses anti samy api for html encoding. The anti samy API is configured with an XML file also known as anti-samy rules. In AEM 6.1 the rules are configured in SLING-INF.content/config.xml file present in file.  And as per that configuration the maximum input size allowed is 200000 bytes which is lower than the input size you are passing and that’s why you see this exception.


  1. <directive name=“omitXmlDeclaration” value=“true”/>
  2. <directive name=“omitDoctypeDeclaration” value=“true”/>
  3. <directive name=“maxInputSize” value=“200000”/>
  4. <directive name=“useXHTML” value=“true”/>
  5. <directive name=“formatOutput” value=“true”/>

Leave a Reply

Your email address will not be published. Required fields are marked *