OutputService.generatePDFOutput connection to failed Service | Community
Skip to main content
nchandra
New Participant
August 28, 2018
Solved

OutputService.generatePDFOutput connection to failed Service

  • August 28, 2018
  • 16 replies
  • 11297 views

We are attempting to generate pdf document, using OutputService.generatePDFOutput() getting connection to failed Service error. Below are our environment details

Environment : AEM  6.3.2

Forms package : AEM-Forms-6.3.2.0-LX-4.1.64

Server : Linux

in the POM added below dependency

<dependency>

    <groupId>com.adobe.aemfd</groupId>

    <artifactId>aemfd-client-sdk</artifactId>

    <version>6.3.0</version>

    <scope>provided</scope>

</dependency>

Exception :

com.adobe.fd.output.internal.exception.OutputServiceException: AEM_OUT_001_003:Unexpected Exception: AEM_OUT_001_003:Unexpected Exception: Connection to failed service.

at com.adobe.fd.output.impl.OutputServiceImpl.generatePDFOutput(OutputServiceImpl.java:84)

at com.xxx.core.servlet.MSServicesServlet.generatePDFOutput(MSServicesServlet.java:590)

at com.xxx.core.servlet.MSServicesServlet.doPost(MSServicesServlet.java:291)

at org.apache.sling.api.servlets.SlingAllMethodsServlet.mayService(SlingAllMethodsServlet.java:149)

at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:346)

at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:378)

at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:552)

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.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:138)

at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:375)

at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:190)

at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:96)

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:71)

at com.day.cq.wcm.core.impl.warp.TimeWarpFilter.doFilter(TimeWarpFilter.java:109)

at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

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)

...frames omitted

Caused by: com.adobe.fd.output.internal.exception.OutputServiceException: AEM_OUT_001_003:Unexpected Exception: Connection to failed service.

at com.adobe.fd.output.impl.OutputServiceImpl.generatePDFOutput(OutputServiceImpl.java:117)

at com.adobe.fd.output.impl.OutputServiceImpl.generatePDFOutput(OutputServiceImpl.java:82)

... 136 common frames omitted

Caused by: java.lang.IllegalStateException: Connection to failed service.

at com.adobe.service.ResourcePooler.allocateResource(ResourcePooler.java:104)

at com.adobe.service.ConnectionFactoryManagerPeer.getConnectionResourceFromPool(ConnectionFactoryManagerPeer.java:76)

at com.adobe.service.ConnectionFactoryManagerPeerImpl.getConnection(ConnectionFactoryManagerPeerImpl.java:155)

at com.adobe.service.impl.PlatformPeerImpl.lookup(PlatformPeerImpl.java:49)

at com.adobe.forms.aem.impl.XFANativeServiceImpl.paExecute(XFANativeServiceImpl.java:115)

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$com$adobe$forms$xtg$impl$XMLFormServiceImpl$$resolveTemplateCacheGen$2.apply(XMLFormServiceImpl.scala:192)

at com.adobe.forms.xtg.impl.XMLFormServiceImpl$$anonfun$com$adobe$forms$xtg$impl$XMLFormServiceImpl$$resolveTemplateCacheGen$2.apply(XMLFormServiceImpl.scala:187)

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.com$adobe$forms$xtg$impl$XMLFormServiceImpl$$resolveTemplateCacheGen(XMLFormServiceImpl.scala:187)

at com.adobe.forms.xtg.impl.XMLFormServiceImpl$$anonfun$resolveTemplate$2$$anonfun$apply$2.apply(XMLFormServiceImpl.scala:281)

at com.adobe.forms.xtg.impl.XMLFormServiceImpl$$anonfun$resolveTemplate$2$$anonfun$apply$2.apply(XMLFormServiceImpl.scala:281)

at com.adobe.forms.cache.ResourceCache$$anonfun$getOrElseUpdate$2.apply(ResourceCache.scala:107)

at com.adobe.forms.cache.ResourceCache$$anonfun$getOrElseUpdate$2.apply(ResourceCache.scala:97)

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.cache.ResourceCache$class.getOrElseUpdate(ResourceCache.scala:97)

at com.adobe.forms.cache.impl.PreRenderCacheImpl.getOrElseUpdate(PreRenderCacheImpl.scala:35)

at com.adobe.forms.xtg.impl.XMLFormServiceImpl$$anonfun$resolveTemplate$2.apply(XMLFormServiceImpl.scala:281)

at com.adobe.forms.xtg.impl.XMLFormServiceImpl$$anonfun$resolveTemplate$2.apply(XMLFormServiceImpl.scala:280)

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.resolveTemplate(XMLFormServiceImpl.scala:279)

at com.adobe.forms.service.impl.LCOptionsXFAInterpreterImpl$$anonfun$resolvedTemplate$2.apply(LCOptionsXFAInterpreterImpl.scala:135)

at com.adobe.forms.service.impl.LCOptionsXFAInterpreterImpl$$anonfun$resolvedTemplate$2.apply(LCOptionsXFAInterpreterImpl.scala:134)

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.LCOptionsXFAInterpreterImpl.resolvedTemplate(LCOptionsXFAInterpreterImpl.scala:134)

at com.adobe.forms.service.impl.AEMFormsHelperServiceImpl.resolvedTemplate(AEMFormsHelperServiceImpl.scala:53)

at com.adobe.fd.output.impl.OutputServiceImpl.generatePDFOutput(OutputServiceImpl.java:114)

I am suspecting aemfd-client-sdk dependency version in the POM is not the correct one, am not sure.

Thanks,

Chandra

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by MayankGu9

Did you follow "Additional Requirements" section under https://helpx.adobe.com/in/experience-manager/6-4/forms/using/installing-configuring-aem-forms-osgi.html

16 replies

New Participant
January 11, 2021
@anjali_biddanda , I am also running this on Parallels CentOS image, I have not tested this on macOS
anjali_biddanda
New Participant
January 6, 2021
Thanks @lincolndlamini. That was very helpful. However, I'm on macOS 10.15 Catalina, which unlike earlier versions which supported 32-bit apps, Catalina has all 32-bit code ripped out. My only option is to run Parallels or a VM with the older macOS 10.14.6.
New Participant
December 31, 2020
@anjali_biddanda , the solution for me was to explicitly install 32 bit linux system libraries i.e expat.i686 , libxcb.i686 etc...
anjali_biddanda
New Participant
December 22, 2020

@nchandra/ @lincolndlamini did either of you find the cause for this error?

New Participant
November 20, 2020
@455762, did you find a solution for this?
New Participant
September 13, 2019

I think I have a similar problem, but i can't find "Additional requirements" under your link. Have it been moved?

New Participant
August 26, 2019

Hi, have you ported this yet to OSGI?

nchandra
nchandraAuthor
New Participant
August 29, 2018

smacdonald2008​   Thank you, I did some tests found it is working in Windows machines and not working on Linux machines. We missed the additional requirements part, when we are setting the AEM forms in the Linux machines ,Thank you mayankg​  for lettign me know. We are working with our infrastructure team for adding those libraries.

I will post it here results once we update the libraries.

Thanks,

Chandra

smacdonald2008
New Participant
August 29, 2018

This uses AEM Forms for J2EE. We are going to port this example as well to AEM Forms for OSGi,

smacdonald2008
New Participant
August 29, 2018

I successfully invoked the AEM Forms Output Service for J2EE. It created a PDF as shown here:

Code we used in video...

package com.adobe.community;

import java.io.File;

import java.io.FileInputStream;

import java.util.Properties;

import com.adobe.livecycle.output.client.*;

import java.util.*;

import java.io.File;

import java.io.FileInputStream;

import com.adobe.idp.Document;

import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;

import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;

public class CreatePDFDocumentSOAP {

public static void main(String[] args) {

     

     try{

     //Set connection properties required to invoke LiveCycle                                

     Properties connectionProps = new Properties();

     connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_SOAP_ENDPOINT, "http://localhost:8080"); 

     connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_SOAP_PROTOCOL);              

     connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss");

     connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");

     connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");

                 

     //Create a ServiceClientFactory object

     ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);

             

     //Create an OutputClient object

     OutputClient outClient = new OutputClient(myFactory); 

                     

     //Reference form data                        

     FileInputStream fileInputStream = new FileInputStream("C:\\Adobe\\Loan.xml");    

     Document inXMData = new Document (fileInputStream);

             

     //Set PDF run-time options    

     PDFOutputOptionsSpec outputOptions = new PDFOutputOptionsSpec();

     outputOptions.setFileURI("C:\\Adobe\\Loan.pdf");

         

     //Set rendering run-time options

     RenderOptionsSpec pdfOptions = new RenderOptionsSpec(); 

     pdfOptions.setLinearizedPDF(true);

     pdfOptions.setAcrobatVersion(AcrobatVersion.Acrobat_9);

                     

     //Create a PDF document            

     OutputResult outputDocument = outClient.generatePDFOutput(

         TransformationFormat.PDF,

         "Loan.xdp",

         "C:\\Adobe",

         outputOptions,

         pdfOptions,

         inXMData

     );

             

     //Retrieve the results of the operation

     Document metaData = outputDocument.getStatusDoc();

     File myFile = new File("C:\\Adobe\\Output.xml");

     metaData.copyToFile(myFile);

     }

     catch (Exception ee)

     {

         ee.printStackTrace();

     }

}

}