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.