Hi All,
I have a query regarding Adaptive Forms in AEM.
I have created an AF with some fields(text box, date picker, drop-down and file attachment).
I tried to submit the form without attaching any file, then it worked as per me. But when there is some file attachment it throws '500 error' as attached.
Please help me to resolve this.
Regards,
Lakshmi.
I suspect that the submit action on your form is the default (before installing forms add-on) of "Store Content"?
If that is correct:
The store content option is just for testing see the note at the top of this page, but perhaps it doesn't work with attachments.
Store content isn't recommended for production so I would suggest trying this by POSTing to a REST endpoint. I have done this successfully on AEM 6.3 forms:
Adobe Experience Manager Help | Configuring the Submit action
If my assumption isn't correct then let me know which submit action you are using
Thanks,
James
Hi James,
I have tried with the submit action "Submit to REST endpoint" and ends up with another error says:
.......26.02.2018 02:05:05.239 *ERROR* [0:0:0:0:0:0:0:1 [1519628705201] POST /content/forms/af/sample-form/jcr:content/guideContainer.af.submit.jsp HTTP/1.1] com.adobe.aemds.guide.service.impl.RESTSubmitActionService Couldn't post data to http://localhost:7002/content/joint-library/english/event-view.html
26.02.2018 02:05:05.291 *ERROR* [0:0:0:0:0:0:0:1 [1519628705201] POST /content/forms/af/sample-form/jcr:content/guideContainer.af.submit.jsp HTTP/1.1] com.adobe.aemds.guide.servlet.GuideSubmitServlet Could not complete Submit Action due to Error during form submission
com.adobe.aemds.guide.service.GuideException: Error during form submission..........
I went through the link: [AF] [AEM-Af-901-004] error , it didn't helped me much.
What all things should I fill in the AF dialog box? If there is any prerequisites , could you please suggest.
Regards,
Lakshmi.
Views
Replies
Total Likes
An example of submit to REST endpoint below.
Create a new servlet and update the package name:
package com.<name of your package>;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingAllMethodsServlet;
import org.osgi.service.component.annotations.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import java.io.IOException;
@Component(
service = Servlet.class,
property = {
"sling.servlet.paths=/bin/submitServlet",
"sling.auth.requirements=-/bin/submitServlet"
}
)
public class SubmitServlet extends SlingAllMethodsServlet {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Override
protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException, ServletException {
String dataXML = request.getParameter("dataXml");
logger.info("Data submitted " + dataXML);
}
}
Set the properties on your adaptive form container as follows, make sure Enable Post is ticked, and make sure the servlet path matches what you defined in your servlet.
Hit the submit button and you should see that the "dataXml" parameter contains your submitted form data and the "attachments" parameter contains your attached file:
If this doesn't work, do you have the aem forms add on packages installed? You should install that and it's dependencies via package share if not.
If you can tell the version of AEM & AEM Forms which you are using, we can help you better, I suppose.
To start with, it may be that one of the Forms Servlet might be missing/unsatisfied, due to which the call is being forwarded to default SlingPostServlet which is unable to handle the request format.
You can also post the request headers for the failing call.
Cheers,
Jagjeet Singh
Hi Jagjeeth,
I'm using AEM 6.3 version.
And my adaptive form works on the submit action "Store Content" without file attachment.
Regards,
Lakshmi.
Views
Replies
Total Likes
Hi All,
We are also facing the same issue after upgrade from 6.1 to 6.3. Kindly let me know if you have any other solution apart from creating any service.
Thanks,
Swapna
Views
Replies
Total Likes
What is the submit action configured on the form? What is the result of submission with and without any attachment?
Please attach the error log snippet as well.
Views
Replies
Total Likes
Hi Mayank,
Issue is fixed after installing cumulative fix (AEM-CFP-6.3.2.2-2.0.zip) and adaptive form package (adobe-aemfd-linux-pkg-4.1.50.zip) in publish instance. There is an issue while trying to hit from dispatcher which currently we are looking into.
Thanks,
Swapna
Views
Replies
Total Likes
Was this issue resolved in dispatcher? We are having the same issue, getting [AF] [AEM-AF-901-004]: Encountered an internal error while submitting the form.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies