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
BedrockMission!

Learn More

View all

Sign in to view all badges

getting error when using formsService.renderPDFForm method in JAVA code

Avatar

Avatar
Establish
Level 2
manu-gupta
Level 2

Likes

4 likes

Total Posts

32 posts

Correct Reply

1 solution
Top badges earned
Establish
View profile

Avatar
Establish
Level 2
manu-gupta
Level 2

Likes

4 likes

Total Posts

32 posts

Correct Reply

1 solution
Top badges earned
Establish
View profile
manu-gupta
Level 2

07-08-2020

Hi techies
I am trying to get interactive PDF generated from XDP from particular NAS location.
XDP path is getting resolved and I am getting object returned from PDFFormRenderOptions after passing xciSetting.xci path using crx:/// path which is uploaded to my local AEM instance.
But i am passing xciSetting Object along with XDP path to
PDFFormRenderOptions ro = getRenderOptions(pathToXCIFile, pathToXDP);
Document returnDoc = formsService.renderPDFForm(xdp, null, ro);

I am unable to get PDF generated and getting below error

07.08.2020 16:20:51.731 *ERROR* [RequestProcessor-1] com.adobe.document.XMLFormService ALC-XTG-032-207: [3532] XMLForm, render : 29391, Destination not specified.
07.08.2020 16:20:51.739 *ERROR* [0:0:0:0:0:0:0:1 [1596797446295] POST /bin/generate-pdf HTTP/1.1] com.adobe.forms.aem.impl.XFANativeServiceImpl <?xml version="1.0" encoding="UTF-8"?>
<status
><messages
><m mid="29391" tid="3532.7176" sev="f" d="2020-08-07T16:20:51.730+05:30"
>XMLForm, render : 29391, Destination not specified.</m
></messages
><validationWarnings
/><validationErrors
/></status
>
07.08.2020 16:20:51.740 *ERROR* [0:0:0:0:0:0:0:1 [1596797446295] POST /bin/generate-pdf HTTP/1.1] com.adobe.forms.aem.impl.XFANativeServiceImpl Exception:
java.lang.Exception: PAExecute Failure: XFA_RENDER_FAILURE
at com.adobe.forms.aem.impl.XFANativeServiceImpl.paExecute(XFANativeServiceImpl.java:162)
at com.adobe.forms.aem.impl.XFANativeServiceImpl.paExecute(XFANativeServiceImpl.java:430)
at com.adobe.forms.xtg.impl.XMLFormServiceImpl$$anonfun$paExecute$2$$anonfun$2.apply(XMLFormServiceImpl.scala:167)
at com.adobe.forms.xtg.impl.XMLFormServiceImpl$$anonfun$paExecute$2$$anonfun$2.apply(XMLFormServiceImpl.scala:167)
at com.adobe.forms.logging.PerfLogger$class.measure(PerfLogger.scala:60)
at com.adobe.forms.logging.PerfLogger$.measure(PerfLogger.scala:33)
at com.adobe.forms.xtg.impl.XMLFormServiceImpl$$anonfun$paExecute$2.apply(XMLFormServiceImpl.scala:166)
at com.adobe.forms.xtg.impl.XMLFormServiceImpl$$anonfun$paExecute$2.apply(XMLFormServiceImpl.scala:158)
at com.adobe.forms.logging.PerfLogger$class.measure(PerfLogger.scala:60)
at com.adobe.forms.logging.PerfLogger$.measure(PerfLogger.scala:33)
at com.adobe.forms.xtg.impl.XMLFormServiceImpl.paExecute(XMLFormServiceImpl.scala:156)
at com.adobe.forms.xtg.impl.XMLFormServiceImpl$$anonfun$renderDoc$2.apply(XMLFormServiceImpl.scala:284)
at com.adobe.forms.xtg.impl.XMLFormServiceImpl$$anonfun$renderDoc$2.apply(XMLFormServiceImpl.scala:283)
at com.adobe.forms.logging.PerfLogger$class.measure(PerfLogger.scala:60)
at com.adobe.forms.logging.PerfLogger$.measure(PerfLogger.scala:33)
at com.adobe.forms.xtg.impl.XMLFormServiceImpl.renderDoc(XMLFormServiceImpl.scala:283)
at com.adobe.forms.service.impl.RenderPdfServiceImpl$$anonfun$com$adobe$forms$service$impl$RenderPdfServiceImpl$$renderPdf$2.apply(RenderPdfServiceImpl.scala:81)
at com.adobe.forms.service.impl.RenderPdfServiceImpl$$anonfun$com$adobe$forms$service$impl$RenderPdfServiceImpl$$renderPdf$2.apply(RenderPdfServiceImpl.scala:68)
at com.adobe.forms.logging.PerfLogger$class.measure(PerfLogger.scala:60)
at com.adobe.forms.logging.PerfLogger$.measure(PerfLogger.scala:33)
at com.adobe.forms.service.impl.RenderPdfServiceImpl.com$adobe$forms$service$impl$RenderPdfServiceImpl$$renderPdf(RenderPdfServiceImpl.scala:68)
at com.adobe.forms.service.impl.RenderPdfServiceImpl.render(RenderPdfServiceImpl.scala:135)
at com.adobe.forms.service.impl.LCFormsOsgiServiceImpl$$anonfun$2.apply(LCFormsOsgiServiceImpl.scala:86)
at com.adobe.forms.service.impl.LCFormsOsgiServiceImpl$$anonfun$2.apply(LCFormsOsgiServiceImpl.scala:81)
at com.adobe.forms.logging.PerfLogger$class.measure(PerfLogger.scala:60)
at com.adobe.forms.logging.PerfLogger$.measure(PerfLogger.scala:33)
at com.adobe.forms.service.impl.LCFormsOsgiServiceImpl.render(LCFormsOsgiServiceImpl.scala:81)
at com.adobe.fd.forms.internal.RenderPDFFormService.renderPDFForm(RenderPDFFormService.java:52)
at com.adobe.fd.forms.impl.FormsServiceImpl.renderPDFForm(FormsServiceImpl.java:95)
at prefillpdfgenerator.core.mergers.DataMerger.createDynamicPDF(DataMerger.java:47)
at prefillpdfgenerator.core.servlets.DataMergerServlet.doPost(DataMergerServlet.java:204)
at org.apache.sling.api.servlets.SlingAllMethodsServlet.mayService(SlingAllMethodsServlet.java:149)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:345)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:376)
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:546)
at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:77)
at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:96)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:151)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:362)
at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:177)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:282)
at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:49)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:77)
at com.adobe.cq.social.ugcbase.security.impl.SaferSlingPostServlet.doFilter(SaferSlingPostServlet.java:126)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.dam.core.impl.assetlinkshare.AdhocAssetShareAuthHandler.doFilter(AdhocAssetShareAuthHandler.java:381)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.dam.core.impl.servlet.ActivityRecordHandler.doFilter(ActivityRecordHandler.java:155)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:73)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:73)
at com.adobe.granite.requests.logging.impl.RequestLoggerImpl.doFilter(RequestLoggerImpl.java:114)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.granite.csrf.impl.CSRFFilter.doFilter(CSRFFilter.java:220)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.security.impl.ContentDispositionFilter.doFilter(ContentDispositionFilter.java:181)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.wcm.core.impl.AuthoringUIModeServiceImpl.doFilter(AuthoringUIModeServiceImpl.java:367)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.wcm.core.impl.warp.TimeWarpFilter.doFilter(TimeWarpFilter.java:106)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.doFilter(RedirectFilter.java:248)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at prefillpdfgenerator.core.filters.LoggingFilter.doFilter(LoggingFilter.java:56)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.aem.core.filters.LoggingFilter.doFilter(LoggingFilter.java:56)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.livecycle.content.appcontext.impl.AppContextFilter.doFilter(AppContextFilter.java:69)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:95)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.analytics.provisioning.impl.UserAuthenticationRequestFilter.doFilter(UserAuthenticationRequestFilter.java:119)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.livecycle.dsc.clientsdk.internal.ResourceResolverHolderFilter.doFilter(ResourceResolverHolderFilter.java:37)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.cq.social.commons.cors.CORSAuthenticationFilter.doFilter(CORSAuthenticationFilter.java:91)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet.doFilter(FormsHandlingServlet.java:285)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.granite.optout.impl.OptOutFilter.doFilter(OptOutFilter.java:74)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.fd.core.security.internal.CurrentUserServiceImpl.doFilter(CurrentUserServiceImpl.java:114)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.cq.history.impl.HistoryRequestFilter.doFilter(HistoryRequestFilter.java:107)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.wcm.core.impl.WCMRequestFilter.doFilter(WCMRequestFilter.java:90)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.cq.mcm.campaign.servlets.CampaignCopyTracker.doFilter(CampaignCopyTracker.java:100)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.rewriter.impl.RewriterFilter.doFilter(RewriterFilter.java:83)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:77)
at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:56)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:129)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.granite.rest.impl.servlet.ApiResourceFilter.doFilter(ApiResourceFilter.java:67)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.bgservlets.impl.BackgroundServletStarterFilter.doFilter(BackgroundServletStarterFilter.java:169)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.granite.resourceresolverhelper.impl.ResourceResolverHelperImpl.doFilter(ResourceResolverHelperImpl.java:84)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.engine.impl.SlingRequestProcessorImpl.doProcessRequest(SlingRequestProcessorImpl.java:151)
at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:216)
at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:85)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:79)
at com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:308)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
at org.apache.felix.http.sslfilter.internal.SslFilter.doFilter(SslFilter.java:89)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:290)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:129)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
at org.apache.sling.featureflags.impl.FeatureManager.doFilter(FeatureManager.java:116)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
at org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:75)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:124)
at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:61)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Unknown Source)
07.08.2020 16:20:51.782 *ERROR* [0:0:0:0:0:0:0:1 [1596797446295] POST /bin/generate-pdf HTTP/1.1] com.adobe.fd.forms.internal.exception.FormsServiceException AEM_FRM_001_004:Unexpected Exception: null
com.adobe.forms.service.LCFormsServiceException: null
at com.adobe.forms.service.impl.LCFormsOsgiServiceImpl.render(LCFormsOsgiServiceImpl.scala:92)
at com.adobe.fd.forms.internal.RenderPDFFormService.renderPDFForm(RenderPDFFormService.java:52)
at com.adobe.fd.forms.impl.FormsServiceImpl.renderPDFForm(FormsServiceImpl.java:95)
at prefillpdfgenerator.core.mergers.DataMerger.createDynamicPDF(DataMerger.java:47)
at prefillpdfgenerator.core.servlets.DataMergerServlet.doPost(DataMergerServlet.java:204)
at org.apache.sling.api.servlets.SlingAllMethodsServlet.mayService(SlingAllMethodsServlet.java:149)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:345)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:376)
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:546)
at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44)

AEM Forms java jee renderPDF

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Employee
Kosta_Prokopiu1
Employee

Likes

152 likes

Total Posts

342 posts

Correct Reply

98 solutions
Top badges earned
Validate 1
Establish
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
Employee
Kosta_Prokopiu1
Employee

Likes

152 likes

Total Posts

342 posts

Correct Reply

98 solutions
Top badges earned
Validate 1
Establish
Give Back 5
Give Back 3
Give Back 25
View profile
Kosta_Prokopiu1
Employee

07-08-2020

Just to confirm: you are using the FormsService API on AEM Forms OSGi (6.4?) and you have written some Java code to access the functionality of the renderPDFForm function.

This is the Javadoc:

kprokopi_1-1596803167782.png

Assuming you have correctly set up the paths and your getRenderOptions properly identifies the files and sets the Document variables and sets all fields of your option correctly:

is the xdp variable pointing to a valid URL which returns the XDP?

Why is the second parameter null? This should be a Document variable with the data?

 

Have you tried to make some simple example with local resources and got this to work?

Answers (1)

Answers (1)

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

316 likes

Total Posts

1,139 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

316 likes

Total Posts

1,139 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

24-08-2020

@manu-gupta Are you able to get this working? Please follow the suggestion by @Kosta_Prokopiu1