Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

REST endpoint not working after AEM Forms 6.5.16 Add-on upgrade


Level 2

Hello all, I would like to share a finding about the latest AEM Forms 6.5.16 Add-ons in hope that it would help those who experienced the same issue as well as an explanation as to what's happening.


In our server environment using AEM 6.5.15 + AEM Forms 6.5.15 with JDK, after upgrade to AEM 6.5.16 SP + AEM Forms 6.5.16 Add-ons + JDK 11.0.18, the out-of-the-box REST endpoint submission type starting to fail with following error in the log even when the upgrades were clean and successful:;)Ljava/util/Map; at at [] at javax.servlet.http.HttpServlet.service( [org.apache.felix.http.servlet-api:1.2.0]​

After digging deeper, the latest has changed the signature of GuideSubmitUtils.getRedirectParameters() from 

public static Map<String, String> getRedirectParameters(SlingHttpServletRequest request) {/*...*/}​


public static Map<String, String> getRedirectParameters(HttpServletRequest request) {/*...*/}​

When the error occurred, the fix found was to use explicit casting in line #65 of /libs/fd/af/components/guidesubmittype/restendpoint/post.POST.jsp as following: 

redirectParameters = GuideSubmitUtils.getRedirectParameters((HttpServletRequest)slingRequest);​

What's odd was that after the JSP was recompiled, the explicit casting was no longer needed and can be restored back to the original (without casting). 


It is still puzzling as to why the explicit casting is needed in order to make the previously compiled JSP in JDK + AEM 6.5.15 SP to work.  The speculations are:

1.  SlingHttpServletRequest API is an interface implementing multiple superclasses which may sometimes cause JDK 11 to confuse in auto-cross casting?

2.  JDK binary codes has cross casting compatibility issue with JDK 11.0.18 or JDK 1.8_u321 used to build


With the odd experience, it may be worth it to ensure explicit casting (HttpServletRequest) is used whenever calling GuideSubmitUtils.getRedirectParameters() in JSP or OSGi services.  

0 Replies