Accessing AEM 6.2 livecycle application manager with java

Avatar

Avatar

James_R_Green

Avatar

James_R_Green

James_R_Green

31-07-2017

Hi,

I am attempting to connect to the livecycle part of AEM 6.2 JEE in order to update assets. But at the moment I cannot connect successfully and perform getApplications() on the application manager. Below is a snippet of the code I am using:

//Create service factory Properties
   Properties connectionProps = new Properties();

  connectionProps.setProperty("DSC_DEFAULT_SOAP_ENDPOINT", "http://192.168.56.101:8080/lc");

  connectionProps.setProperty("DSC_TRANSPORT_PROTOCOL", "SOAP");

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

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

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

   // Create the service client factory
   ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);

  ApplicationManagerClient appMgrClient = new ApplicationManagerClient(myFactory);

   //Create an application called Sample1, version 1.0 is created
   try {

// appMgrClient.createApplication("Sample1");
   List list = appMgrClient.getApplications();

  } catch (ApplicationManagerClientException e) {

  e.printStackTrace();

  }

I based this on code from ApplicationManager (AEM forms on JEE Java API Reference)

I have also tried ApplicationManager instead of ApplicationManagerClient

I get an exception when executing this code:

ALC-DSC-099-000: com.adobe.idp.applicationmanager.application.ApplicationManagerException: java.lang.NoClassDefFoundError: javax/ejb/EJBException

I have also had the below error from other tests I have performed:

ALC-DSC-099-000: com.adobe.idp.applicationmanager.application.ApplicationManagerException: java.lang.ClassNotFoundException: org.apache.axis.soap.SOAPConstants not found by com.adobe.livecycle.dsc.clientsdk.api [496]

I think I am missing dependencies but do not know which ones. Has anyone used the application manager on AEM forms 6.2 recently and has a working example?

I am particular interested in the pom files and any additional classes that needed adding.

Thanks,

James

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

James_R_Green

Avatar

James_R_Green

James_R_Green

31-07-2017

I managed to work out a solution and thought I would document it here in case it helps someone else.

Instead of setting the properties for the service client factory myself like this:

ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);

I used the service client factory provider instead:

@Reference
ServiceClientFactoryProvider scfProvider;

...

ServiceClientFactory myFactory = scfProvider.getDefaultServiceClientFactory();

As described in the page below:

AEM 6.2 Forms Help | Connecting AEM Forms with Adobe LiveCycle

I am connecting to a remote server and had to change my Adobe LiveCycle Client SDK Configuration in configMgr to the remote IP.

After doing this it connected, but I got a different error:

ALC-DSC-099-000: java.lang.UnsupportedOperationException: Deserialization not allowed for class sun.util.calendar.ZoneInfo

To fix that I found a blog post that had the solution of adding "sun.util." to the deserializationFirewall whitelist

http://localhost:4503/system/console/configMgr/com.adobe.cq.deserfw.impl.DeserializationFirewallImpl

See the following for full details:

Deserialization error submitting forms to AEM Forms JEE | The LiveCycle & AEM Forms survival kit

It then worked.

I assume I was previously missing a setting for the service client factory, but can't be sure.

For completeness, this required the following entry in the core pom file:

<dependency>

   <groupId>com.adobe.livecycle.dsc</groupId>

   <artifactId>com.adobe.livecycle.dsc.clientsdk</artifactId>

   <version>6.2</version>

</dependency>

Thanks,

James

Answers (3)

Answers (3)

Avatar

Avatar

James_R_Green

Avatar

James_R_Green

James_R_Green

31-07-2017

Hi

smacdonald2008

Yes that is right - I am connecting to a AEM JEE server. My title for this was a little misleading in hindsight, but I wanted to describe the area of forms that the problem was related too.

Thanks,

James

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

31-07-2017

This code was once used to run on a LC server. I assume you are trying to run on on AEM J2EE for forms server?

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

31-07-2017

Are you trying to run this code within AEM or on a LiveCycle Server (or what is now a LC Server)?

So i take it you want to invoke a LC process from AEM?