Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Error when calling addAsset/updateAsset methods

Avatar

Level 1

I'm relatively new to invoking LiveCycle opertions with the Java API. I have managed to automated most of the necessary tasks I typically perform in the Workbench. The remaining piece involves asset management.

I am trying to upload a new document to an application with the following code snippet.

// Create a ServiceClientFactory object

ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);

// Create an ApplicationManagerClient object

ApplicationManagerClient appClient = new ApplicationManagerClient(myFactory);

try {

  // Create a Document object

  FileInputStream myAsset = new FileInputStream(filePath + "/" + fileName);

  Document newAsset = new Document(myAsset);

  // Add a new asset to the application

  String assetPath = appClient.addAsset(application, folder + "/" + fileName, newAsset);

  System.out.println("Successfully deployed file " + assetPath + " in " + application + " application.");

} catch(Exception e) {

  e.printStackTrace();

}

application, filePath, fileName, and folder are strings (e.g. TestApp, /data01/tmp, TestFile.xdp, TestFolder).

I keep getting the following error, however.

ALC-DSC-000-000: com.adobe.livecycle.applicationmanager.client.ApplicationManagerClientException: Internal error.

        at com.adobe.livecycle.applicationmanager.client.ApplicationManagerClient.addAsset(ApplicationManagerClient.java:422)

        at com.adobe.livecycle.applicationmanager.client.ApplicationManagerClient.addAsset(ApplicationManagerClient.java:364)

        at DeployAsset.main(DeployAsset.java:41)

There is no error in the server logs, and the same error occurs when using the updateAsset method. The deleteAsset method works for an existing asset.

Any assistance would be appreciated.

2 Replies

Avatar

Level 1

Yes, the Repository Service works to upload documents, but then if I try to deploy the application I receive an error that it is empty. Also when I export the application it is empty.

Additionally, if a document is only uploaded to the repository and not written to the file system, it cannot be retrieved by the Output Service (at least for the application I am working with).

This is from the "Using the Repository Service" help page for ES4:

Important: The Repository Service should not be used with LiveCycle ES2, LiveCycle ES2.5, andthe newer LiveCycle ES4. Also, the Repository Service should not be used with the current Application Model.