I am trying to apply a livecycle policy to a document with the following code:
Properties properties = new Properties();
properties.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_SOAP_ENDPOINT,
"https://hostOfJBoss:port");
properties.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,
ServiceClientFactoryProperties.DSC_SOAP_PROTOCOL);
properties.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE,
ServiceClientFactoryProperties.DSC_JBOSS_SERVER_TYPE);
properties.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "username");
properties.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
ServiceClientFactory client = ServiceClientFactory.createInstance(properties);
FileInputStream fis = null;
try {
fis = new FileInputStream("test.pdf");
} catch (FileNotFoundException e) {
e.printStackTrace();
}
Document pdf = new Document(fis);
RightsManagementClient rmClient = new RightsManagementClient(client);
DocumentManager docManager = rmClient.getDocumentManager();
RMSecureDocumentResult finalPdf = null;
try {
finalPdf = docManager.protectDocument(pdf, "test.pdf", "Policy", "Policy",
null, null, null);
} catch(.......)
However, I am getting an error on in the protectDocument method:
Sep 15, 2012 4:17:46 PM com.adobe.idp.DocumentManagerClient clientSidePush
SEVERE: DOCS001: Unexpected exception. See the stack trace for details.
com.adobe.idp.DocumentError: java.io.IOException: Error writing to server
at com.adobe.idp.DocumentManagerClient.clientSidePush(DocumentManagerClient.java:341)
at com.adobe.idp.Document.doInputStream(Document.java:1693)
at com.adobe.idp.Document.passivateInitData(Document.java:1579)
at com.adobe.idp.Document.passivate(Document.java:1252)
at com.adobe.idp.Document.passivate(Document.java:1196)
at com.adobe.idp.DocumentManagerClient.passivate(DocumentManagerClient.java:258)
at com.adobe.idp.dsc.provider.impl.base.RequestOutputStream.defaultPassivate(RequestOutputStream.java:40)
at com.adobe.idp.DocumentRequestOutputStream.passivate(DocumentRequestOutputStream.java:56)
at com.adobe.idp.Document.writeObject(Document.java:882)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at java.util.HashMap.writeObject(HashMap.java:1001)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at com.adobe.idp.dsc.provider.impl.soap.axis.sdk.SoapSdkBindingStubUtil.serializeRequest(SoapSdkBindingStubUtil.java:78)
at com.adobe.idp.dsc.provider.impl.soap.axis.sdk.SoapAxisDispatcher.doSend(SoapAxisDispatcher.java:124)
at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:66)
at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
at com.adobe.livecycle.rightsmanagement.client.impl.scf.SCFConnection.protectDocument(SCFConnection.java:1050)
at com.adobe.livecycle.rightsmanagement.client.impl.DocumentManagerImpl.protectDocument(DocumentManagerImpl.java:146)
at Main.main(Main.java:43)
Can someone please help me with this error?