acs-aem-commons icon indicating copy to clipboard operation
acs-aem-commons copied to clipboard

ACS Common Generic List - Throwing exception if am trying to add more than 10 items

Open sambasivaraj opened this issue 3 years ago • 6 comments

Required Information

  • [ ] AEM Version, including Service Packs, Cumulative Fix Packs, etc: AEM Cloud Version 2022.1.6228.20220123T154100Z
  • [ ] ACS AEM Commons Version: 5.1.2
  • [ ] Reproducible on Latest? YES

Expected Behavior

I should be able to add as many items using the Generic list ACS Common feature

Actual Behavior

If am trying to add more than 10 items to generic list , am getting the exception as below aused by: org.apache.sling.api.SlingException: javax.servlet.ServletException: javax.servlet.jsp.JspTagException: org.apache.sling.api.request.TooManyCallsException: BundledScriptServlet (/libs/granite/ui/components/coral/foundation/form/field/field.jsp) at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspExceptionInternal(JspServletWrapper.java:685) [org.apache.sling.scripting.jsp:2.5.2] at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:602) [org.apache.sling.scripting.jsp:2.5.2] at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:519) [org.apache.sling.scripting.jsp:2.5.2] at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:445) [org.apache.sling.scripting.jsp:2.5.2] at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.callJsp(JspScriptEngineFactory.java:501) [org.apache.sling.scripting.jsp:2.5.2] at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:586) [org.apache.sling.scripting.jsp:2.5.2] at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:388) [org.apache.sling.scripting.core:2.3.6]

Steps to Reproduce

Create a latest Local AEM SDK version Deploy ACC Common 5.1.2 version Navigate to http://localhost:4502/generic-lists.html/etc/acs-commons/lists Create a generic list Add more than 10 items in the list and observe the behaviour User will see too many call exception in the error log and you will be able to view all the items in Generic list UI

sambasivaraj avatar Feb 07 '22 16:02 sambasivaraj

did u try updating the number of calls per per request in apache Sling man servlet configuration ? Hope this helps image

hearora avatar Mar 03 '22 12:03 hearora

This ticket could be resolved using a REQUEST-scope Filter to override the sling.max.calls for the genericlist.html request by setting a request attribute of the same name to an Integer that is either -1 or some multiple of the number of items in the chosen list, before the page servlet begins rendering the response. (cc: @Derthenier )

see: https://github.com/apache/sling-org-apache-sling-engine/blob/aa77c90fd80039b92880025cd00fc621afec4f6f/src/main/java/org/apache/sling/engine/impl/request/RequestData.java#L116-L119 https://github.com/apache/sling-org-apache-sling-engine/blob/aa77c90fd80039b92880025cd00fc621afec4f6f/src/main/java/org/apache/sling/engine/impl/request/RequestData.java#L641-L665

adamcin avatar Mar 03 '22 15:03 adamcin

Apart from above option to BUMP the 'Number Of calls Per Request', the latest ACS Commons release 5.2.0 might help to resolve it. Please check...

SachinMali avatar Mar 03 '22 19:03 SachinMali

@SachinMali I believe the 5.2.0 solution depends on generic list localization being disabled. It doesn't fix the situation if localization is desired.

adamcin avatar Mar 03 '22 20:03 adamcin

Its possible but if localization is desired and you have few (5-10) Localized languages (and NOT ALL) and your list items are not as huge as 'font-awesome-icons' (675 items) without tweaking the above config will work. In summary above OSGi Config can be optional for >10 items and maybe an upper limit of 100.

SachinMali avatar Mar 03 '22 21:03 SachinMali

I think @adamcin suggestion might be best -- otherwise I think a rewrite that simplifies the impl could be a reasonable option. (maybe something more akin to how it was originally designed - just not sure about back compat to the current version)

davidjgonzalez avatar Mar 04 '22 00:03 davidjgonzalez