Newbie to AEM : Connection refused when invoking a service | Community
Skip to main content
anupd73374180
Level 2
October 16, 2015
Solved

Newbie to AEM : Connection refused when invoking a service

  • October 16, 2015
  • 16 replies
  • 4176 views

I am trying to run the example from : https://helpx.adobe.com/livecycle/help/aem/aem-livecycle-connector.html#Invoking%20via%20Service%20References%20from%20OSGi%20Service%20Registry

Here's the package download link on that page: https://helpx.adobe.com/content/help/en/livecycle/help/aem/aem-livecycle-connector/_jcr_content/main-pars/download/file.res/aem-lc-connector-sample-pkg-1.0.0.zip

Its a simple form  that converts a word doc into pdf but i am not able to run it.

I tried to trace the issue in the log and disabled few Validation components to get around HTTP 403.

But now it errors out with and am stuck. Please advise. Please find the stacktrace from errors.log

12.08.2015 11:06:02.198 *INFO* [0:0:0:0:0:0:0:1 [1439395562195] POST /content/livecycle/connector/samples/pdfg.html HTTP/1.1] org.apache.commons.httpclient.HttpMethodDirector I/O exception (java.net.ConnectException) caught when processing request: Connection refused 12.08.2015 11:06:02.198 *INFO* [0:0:0:0:0:0:0:1 [1439395562195] POST /content/livecycle/connector/samples/pdfg.html HTTP/1.1] org.apache.commons.httpclient.HttpMethodDirector Retrying request 12.08.2015 11:06:02.198 *INFO* [0:0:0:0:0:0:0:1 [1439395562195] POST /content/livecycle/connector/samples/pdfg.html HTTP/1.1] org.apache.commons.httpclient.HttpMethodDirector I/O exception (java.net.ConnectException) caught when processing request: Connection refused 12.08.2015 11:06:02.198 *INFO* [0:0:0:0:0:0:0:1 [1439395562195] POST /content/livecycle/connector/samples/pdfg.html HTTP/1.1] org.apache.commons.httpclient.HttpMethodDirector Retrying request 12.08.2015 11:06:02.198 *INFO* [0:0:0:0:0:0:0:1 [1439395562195] POST /content/livecycle/connector/samples/pdfg.html HTTP/1.1] org.apache.commons.httpclient.HttpMethodDirector I/O exception (java.net.ConnectException) caught when processing request: Connection refused 12.08.2015 11:06:02.198 *INFO* [0:0:0:0:0:0:0:1 [1439395562195] POST /content/livecycle/connector/samples/pdfg.html HTTP/1.1] org.apache.commons.httpclient.HttpMethodDirector Retrying request 12.08.2015 11:06:02.199 *ERROR* [0:0:0:0:0:0:0:1 [1439395562195] POST /content/livecycle/connector/samples/pdfg.html HTTP/1.1] apps.livecycle.connector.samples.pdfg.POST$jsp Error occured while converting document to PDF com.adobe.idp.dsc.DSCRuntimeException: java.net.ConnectException: Connection refused         at com.adobe.livecycle.dsc.clientsdk.internal.soap.AbstractHttpInvocationRequestExecutor.executeRequest(AbstractHttpInvocationRequestExecutor.java:73)         at com.adobe.livecycle.dsc.clientsdk.internal.soap.CommonsClientMessageDispatcherFactory$CommonsClientMessageDispatcher.doSend(CommonsClientMessageDispatcherFactory.java:121)         at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:69)         at com.adobe.livecycle.dsc.clientsdk.internal.MessageDispatcherProxy$InvocationInterceptorChainImpl.doIntercept(MessageDispatcherProxy.java:64)         at com.adobe.livecycle.dsc.clientsdk.internal.ClassLoaderInterceptor.intercept(ClassLoaderInterceptor.java:34)         at com.adobe.livecycle.dsc.clientsdk.internal.MessageDispatcherProxy$InvocationInterceptorChainImpl.doIntercept(MessageDispatcherProxy.java:60)         at com.adobe.livecycle.dsc.clientsdk.internal.security.SecurityInterceptor.intercept(SecurityInterceptor.java:128)         at com.adobe.livecycle.dsc.clientsdk.internal.MessageDispatcherProxy$InvocationInterceptorChainImpl.doIntercept(MessageDispatcherProxy.java:60)         at com.adobe.livecycle.dsc.clientsdk.internal.RequestProgressInterceptor.intercept(RequestProgressInterceptor.java:41)         at com.adobe.livecycle.dsc.clientsdk.internal.MessageDispatcherProxy$InvocationInterceptorChainImpl.doIntercept(MessageDispatcherProxy.java:60)         at com.adobe.livecycle.dsc.clientsdk.internal.MessageDispatcherProxy.send(MessageDispatcherProxy.java:41)         at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:213)         at com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient.createPDF2(GeneratePdfServiceClient.java:620)         at org.apache.jsp.apps.livecycle.connector.samples.pdfg.POST_jsp$1.run(POST_jsp.java:43)  
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 ogill

Unless I am completely mistaken, the package you have installed allows you to invoke services on a LiveCycle ES4 Server. So you need a standalone LiveCycle ES4 server running. From "http://help.adobe.com/en_US/livecycle/11.0/Overview/lc_overview_ds.pdf":

Integration with Adobe Experience Manager (AEM)

LiveCycle provides a rich client SDK that allows client applications to invoke LiveCycle services using Java APIs. You can invoke LiveCycle Document Services from within Adobe Experience Manager (AEM) web apps and workflows using AEM LiveCycle Conenctor. It simplifies using these APIs within the OSGi environment and enables seamless invocation of LiveCycle Services. 

16 replies

Adobe Employee
October 16, 2015

From this exception:

  1. or.samples.pdfg.POST$jsp Error occured while converting document to PDF
  2. com.adobe.idp.dsc.DSCRuntimeException: java.net.ConnectException: Connection refused

Is your LifeCycle server definitely up and running?

anupd73374180
Level 2
October 16, 2015

How do i check the status of my LifeCycle server? And how do i know which port it is running on?

I checked various configurations and services in console but i couldn't find it.

Appreciate your help!

Adobe Employee
October 16, 2015

From the link you posted[1],  the article explains "Adobe® Experience Manager (AEM) LiveCycle Connector enables seamless invocation of Adobe® LiveCycle® ES4 Document Services from within AEM web apps and workflows."

Do you have a lifecycle server running?

So you need a LiveCycle instance to connect to. In the Getting started section of the article, it states you need to configure the OSGI settings for "Adobe LiveCycle Client SDK Configuration Component":

The details required are:

Although the properties are self explanatory, the important ones are as follows:

  • Server URL - URL to the LiveCycle server. If you want LiveCycle and AEM to communicate over https, start AEM with the -Djavax.net.ssl.trustStore=<path to LC keystore> option.
  • Username - Username of the account That will be used for making calls from AEM to LiveCycle. It can be any LiveCycle user who has the permissions to invoke Document Services.
  • Password - User password.
  • Service Name - Services that should be invoked using the user credentials provided in Username and Password fields. By default, no credentials are passed while invoking LiveCycle services.

[1] https://helpx.adobe.com/livecycle/help/aem/aem-livecycle-connector.html#Invoking%20via%20Service%20References%20from%20OSGi%20Service%20Registry

anupd73374180
Level 2
October 16, 2015

I checked for GeneratePDFService in Components and Services and it was present. I assumed that LiveCycle services are running since GeneratePDFService is part of the SDK. Here's the service from service section :

[com.adobe.pdfg.service.api.GeneratePDFService]

                                                         
component.id2372
component.namecom.adobe.pdfg.impl.GeneratePDFServiceImpl
htmlToPdfFactory.target(bmc.service.name=HtmlToPdfSvc)
imageToPdfFactory.target(bmc.service.name=Img2PDFSvc)
nativeToPdfFactory.target(bmc.service.name=Native2PDFSvc)
openOfficeToPdfFactory.target(bmc.service.name=OpenOffice2PDFSvc)
paperCaptureFactory.target(bmc.service.name=PaperCaptureSvc)
pdfMakerFactory.target(bmc.service.name=PDFMakerSvc)
service.bundleid490
Service PIDcom.adobe.pdfg.impl.GeneratePDFServiceImpl
service.scopebundle
Service VendorAdobe Systems
swfToPdfFactory.target(bmc.service.name=Swf2PDFSvc)
Using Bundlesadobe-aemfd-pdfg-config (489)
ogillAdobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

Unless I am completely mistaken, the package you have installed allows you to invoke services on a LiveCycle ES4 Server. So you need a standalone LiveCycle ES4 server running. From "http://help.adobe.com/en_US/livecycle/11.0/Overview/lc_overview_ds.pdf":

Integration with Adobe Experience Manager (AEM)

LiveCycle provides a rich client SDK that allows client applications to invoke LiveCycle services using Java APIs. You can invoke LiveCycle Document Services from within Adobe Experience Manager (AEM) web apps and workflows using AEM LiveCycle Conenctor. It simplifies using these APIs within the OSGi environment and enables seamless invocation of LiveCycle Services. 

anupd73374180
Level 2
October 16, 2015

@Opkar Gill  That's true. Thanks a lot clarifying. I was investigating and found the same. Its a standalone server that needs to be installed in order to use the Document services.

I presumed that LiveCycle was bundled with AEM.

I wonder what the com.adobe.pdfg.service.api.GeneratePDFService is then?

My eventual goal is to use some kind of PDF conversion service. Does AEM have anything out of the box?

Lokesh_Shivalingaiah
Level 10
October 16, 2015

are you talking about converting the AEM pages into pdf ? or a word doc asset into pdf ?

smacdonald2008
Level 10
October 16, 2015

LiveCycle ES is not bundled with AEM. 

Lokesh_Shivalingaiah
Level 10
October 16, 2015

If its from word doc to pdf, you can use some 3rd party APIs like JODConverter or OpenOffice

anupd73374180
Level 2
October 16, 2015

@smacdonald2008 Thanks for confirming!