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.

Document is not available on the sending side

Avatar

Former Community Member
This post relates to a previous one in which I've asked for help in getting a simple workflow that saves a form as a PDF to disk to work. Based on help from Jasmin and Howard I believe that I'm closer to understanding how to make this work, but now I get an error when trying to read the document from the repository. Here's a complete description of what I've done:



1. I create an Adobe XML Form File (PDF) called Jeff.pdf on my server in the location \BDI\Forms\Jeff.pdf. This is just a simple form with one field on it - there is no embedded schema (my understanding is that I would only need that if I wanted to make reference to specific fields in my workflow).



2. I created a process with a two variables. The first is an xfaForm variable called JeffsForm - I set its Template Url to /BDI/Forms/Jeff.pdf. I've also checked all of the General check boxes and the Enduser UI Items check boxes. The other variable is a Document Form variable called DocumentVar (I've also tried setting this to type document...). Under General I've selected "Output" and under "Enduser UI Items" I've checked both boxes. The URL field in the "Datatype Specific Settings" is set to /BDI/Forms/Jeff.pdf.



3. In my workflow I have a User Assignment step. In the "From Data Mappings" section ive set the "Input from varaible" to /process_data/JeffsForm. I left "Form must be saved" unchecked. In the "Output form data - (variable)" field I've entered JeffsForm. In the "Task id" field I've entered "/process_data/@id".



4. I have a route going from the assignment step to a Read Resource Content step. This is where things fail. In the Input section I've tried a few different values. In one case I set the "Resource Uri" to "{$/process_data/JeffsForm/object/@templateUrl$}". In another attempt to get this to work I set it to the literal value of /BDI/Forms/Jeff.pdf. In the Output variable I've put DocumentVar.



When I run this workflow it stalls with the following entry in the server error log:



com.adobe.idp.DocumentError: The Document is not available on the sending side anymore. Make sure that it is not disposed or garbage collected too early.



I'f anyone can tell me what I'm doing wrong I'd be extreamly grateful. I've spent about 5 days so far trying to get this very simple sample workflow to work with no luck.
43 Replies

Avatar

Level 10
Let me try to explain again. I think you get confused with the different variable types.



If you use an xfaForm variable, when the user hits submit then you will only get the data back in your process not the PDF. If you want the PDF, then you can use renderPDFForm pass the data and the location of your template in the repository and it'll generate the PDF.



If you use a Document Form variable, when the user hits submit, you can pass the whole PDF back. Make sure the submit button on your form submits PDF and not XDP (in Form Designer). Then in your process you can get the PDF out of the Document Form variable with the following xPath /process_data/myDocumentForm/object/document and put it in a "document" variable. Finally you can write that document variable with the "Write Document" operation.



I don't understand why you have step 4. The repository is like the file system. It just keep a copy of the original template. You don't need to get it back using the Read Ressource.



Jasmin

Avatar

Former Community Member
I was trying to follow Howard's suggestion that I utilize an xfaForm variable "as my primary form type" so that I can manipulate data via XPath. He suggested that I create a document variable (should this be a document form variable or document?) without specifying "in (presumanbly meaning not to check the "input" check box?). The next step is to use the repository component to read the empty PDF from the repository to the document variable after which I can use the Form Data integration component to inject data from teh xfaForm variable...



I also tried to follow the first approach you suggest by:



1. Keeping my xfaForm variable. I understand that I will only have the data at this point and not the PDF but since I want to be able to easily refer to form values in routes etc this sounds like the best way to proceed.



2. You state that "If you want the PDF, then you can use renderPDFForm pass the data and the location of your template in the repository and it'll generate the PDF". This is what I tried to do. I added a renderPDFForm step and configured it with:



- the location of my template. I tried to reference this in the Input section by placing the value "/process_data/JeffsForm/object/@templateUrl" in the "Form to Rended - (template)" field.



- the form data. I'm not clear on exactly how to reference the form data properly. I've tried to set the "Form Data - (XPath expression)" field to various things, including:



a. deserialize(serialize(/process_data/JeffsForm/object/data/xdp/datasets/data/*, true))



b.

(/process_data/JeffsForm



c./process_data/JeffsForm/object/data



d. /process_data/JeffsForm/object/data/*



At any rate, my process stalls with all of these... Can you tell me whether I have the template part right and how to properly reference the data?

Avatar

Level 10
"the location of my template. I tried to reference this in the Input section by placing the value "/process_data/JeffsForm/object/@templateUrl" in the "Form to Rended - (template)" field."



Just put the location from the repository (/MyFolder/MyForm.xdp)



"the form data. I'm not clear on exactly how to reference the form data properly. I've tried to set the "Form Data - (XPath expression)" field to various things"



Put the data in a document variable using the SetValue. Use the following xPath:

/process_data/myDocVar = /process_data/myXMLvar



Jasmin

Avatar

Former Community Member
My form was created as an Adobe XML Form File (PDF) type - I don't have an xdp file so I can't follow your instruction to reference /MyFolder/MyForm.xdp - I can point to /BDI/Forms/JEFF.pdf however, I'm not clear if this is correct.



Also, you say to set /process_data/myDocVar = /process_data/myXMLvar. I don't understand what you mean by myXMLvar. Do you mean my xfaForm variable?



At any rate, I tried the above settings and it stalls.

Avatar

Level 10
Then just reference the pdf. /BDI/Forms/JEFF.pdf should work.



RenderPDFForm needs the xml data to merge with the template in a document variable. If you have the data in an xml variable then you can use the code in the previous post. If the data is in the xfaForm variable, then you'll need to get the xml data out of that variable.



/process_data/JeffsForm/object/data should give you the xml data from the xfaForm variable. The put it in a document variable.



Jasmin

Avatar

Former Community Member
Thanks for your patience Jasmin,



I think it's close to working - but I still get the following error:



com.adobe.livecycle.formsservice.exception.RenderFormException: XML document structures must start and end within the same entity.



What should I be putting for the Content Root URI? Is the above problem related to this field, or can you think of someting else I might have set incorrectly?



Thanks again!

Avatar

Level 10
I would suggest to put the /process_data/JeffsForm/object/data in a XML var and write it to the file system or use the variable logger to make sure you get valid XML.



The Content Root URI should be set to repository://



Jasmin

Avatar

Former Community Member
I set an XML variable and then called the logger component - I don't see anything wrong with the XML. I've set the Content Root URI to "repository://" - but what about the other 3 parameters. Presumably they need to be set to something - but what isn't at all clear to me... I wish there was some documentation that explained how to configure these services (if there is I can't find it).






1604
1CF6B04F-9EA0-5734-1E34-CEC20094AC78

user2@kanatest.com
http://localhost:8080/workspace-server/submit
1
483 Bay st



http://localhost:8080/workspace-server/submit







Avatar

Level 10
If you just create the PDF to archive, then you can leave the three other parameters blank.



You can get more information about the parameters if you go under Help/HelpContent in Workbench. Just do a search for renderPDFForm.



Jasmin

Avatar

Former Community Member
Thanks Jasmin, I have been looking at the online help, but it doesn't clearly explain the fields or provide examples. I've also tried to examine how the Render PDF form is configured in the sample application, but it hasn't helped me either... Could there be some other field/setting that I'm missing... or failing that, any way to get a clearer idea as to what this error message means?

Avatar

Level 10
This is not related to your RenderForm operation. This might be related to the XDP being cached and the cache expiring.



Can you send the stack trace from JBoss?



Thanks,



Jasmin

Avatar

Former Community Member
Hi,

I get the same error when I try to save a document variable come from one of mine xfaForm variable:



com.adobe.idp.DocumentError: The Document is not available on the sending side anymore. Make sure that it is not disposed or garbage collected too early.

at com.adobe.idp.DocumentManagerClient.requestRemotePassivation(DocumentManagerClient.java:319).......



The really strange thing is that it happens not always and I don't know how to solve it.

Avatar

Level 2
Can you post the complete stack trace? Thanks.

Avatar

Former Community Member
com.adobe.idp.DocumentError: The Document is not available on the sending side anymore. Make sure that it is not disposed or garbage collected too early.<br /> at com.adobe.idp.DocumentManagerClient.requestRemotePassivation(DocumentManagerClient.java:319)<br /> at com.adobe.idp.Document.passivate(Document.java:748)<br /> at com.adobe.idp.Document.<init>(Document.java:429)<br /> at com.adobe.idp.DocumentStorage.persist(DocumentStorage.java:37)<br /> at com.adobe.workflow.pat.service.PATExecutionContextImpl.setProcessDataValue(PATExecutionContextImpl.java:570)<br /> at com.adobe.workflow.engine.PEUtil.invokeAction(PEUtil.java:583)<br /> at com.adobe.workflow.engine.ProcessEngineBMTBean.continueBranchAtAction(ProcessEngineBMTBean.java:2851)<br /> at com.adobe.workflow.engine.ProcessEngineBMTBean.asyncContinueBranchCommand(ProcessEngineBMTBean.java:2380)<br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br /> at java.lang.reflect.Method.invoke(Method.java:585)<br /> at org.jboss.invocation.Invocation.performCall(Invocation.java:345)<br /> at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)<br /> at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)<br /> at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:54)<br /> at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)<br /> at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)<br /> at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:158)<br /> at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)<br /> at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)<br /> at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)<br /> at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)<br /> at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)<br /> at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)<br /> at org.jboss.ejb.Container.invoke(Container.java:873)<br /> at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)<br /> at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)<br /> at $Proxy196.asyncContinueBranchCommand(Unknown Source)<br /> at com.adobe.workflow.engine.ProcessCommandControllerBean.doOnMessage(ProcessCommandControllerBean.java:133)<br /> at com.adobe.workflow.engine.ProcessCommandControllerBean.onMessage(ProcessCommandControllerBean.java:94)<br /> at sun.reflect.GeneratedMethodAccessor516.invoke(Unknown Source)<br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br /> at java.lang.reflect.Method.invoke(Method.java:585)<br /> at org.jboss.invocation.Invocation.performCall(Invocation.java:345)<br /> at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:475)<br /> at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)<br /> at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:101)<br /> at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)<br /> at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)<br /> at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)<br /> at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:94)<br /> at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)<br /> at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:389)<br /> at org.jboss.ejb.Container.invoke(Container.java:873)<br /> at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:1077)<br /> at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1379)<br /> at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)<br /> at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:904)<br /> at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:160)<br /> at org.jboss.mq.SpySession.run(SpySession.java:333)<br /> at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)<br /> at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)<br /> at java.lang.Thread.run(Thread.java:595)

Avatar

Former Community Member
I am experiencing the same DocumentError exception described above. I have a process deployed to Workspace ES, and it is now stalled because "The Document is not available on the sending side anymore. Make sure that it is not disposed or garbage collected too early." I can start another instance of the process and the document is rendered fine, but trying to restart the stalled process always results in the same DocumentError exception being thrown.



Has anyone else seen this behavior? Anyone know how to avoid it?

Should I disable all caching options?

Avatar

Former Community Member
Hi,

Sorry but somebody is able to solve it!? Because we are trying to propose adobe Livecycle ES as a solution for one of our most important customers.... but without a real fix for this problem it will be very hard and we have to select another technology.

Please try to answer as soon as you can.



Thanks

Avatar

Level 2
Guys,



Using Jeff's instructions with a few modifications, I've been able to reproduce the 'Document not available...' error *only once*. In that one instance, the error manifested itself after I 'retried' a stalled operation. The operation had stalled because there was an error in my process. I'm using 8.0.1.2, which I assume you are all using as well.



John and Valerio, could you post a detailed description of your process, similar to what Jeff did in his initial post, and point out where 'the error' occurs? I'm getting closer but having more examples to compare against will help.

Avatar

Former Community Member
I'm using the version 8.0.3187.1

Ok, I try to explain, first:



a. I have a simple pdf forms associated whit a embedded schema, and I have loaded this file in a xfaForms variable call it "modulo_assunzione"

b. When a user start the workflow he have to fill this forms and send it to another department.



Here's a description of my workflow:



1. a execute service maps a "modulo_assunzione" variable's data to another xfaForms variable "dettagli_assunzione" that contain a pdf whit the same embedded schema, in this way:



/process_data/dettagli_assunzione/object/data/xdp/datasets/data || /process_data/modulo_assunzione/object/data/xdp/datasets/data/assunzionedata/anag_info



2. a Assign Task service have this settings:



Form data mappings:

-> input form variable: /process_data/dettagli_assunzione

-> output form data: /dettagli_assunzione



Attachments and Notes:

Show attachment windows from this task -> checked

Copy all note and attachment from previous task -> selected

Output attachment (variable): allegati [is a list document variable]



In this step a specific user can read the pdf and add some attachment file.... the user can accept o reject it



3. If accepted this task arrive to another Assign Task service that have this settings:



Initial user selection:

Assign to process creator -> selected



Form data mappings:

-> input form variable: /process_data/dettagli_assunzione



Attachments and Notes:

Copy all note and attachment from previous task -> selected



In this step the process creator can complete the task.



4. If completed a Make a Directory service create a new directory using some data contained in the "modulo_assunzione" xfaFrom variable:



Pathname (template):

C:\Adobe\Dipendenti\{$/process_data/modulo_assunzione/object/data/xdp/datasets/data/assunzionedata/anag_info/cognome$} {$/process_data/modulo_assunzione/object/data/xdp/datasets/data/assunzionedata/anag_info/nome$}



5. (HERE A GET A STALLED STATUS ONE TIME EVERY 3/4 RUNNING PROCESS) a Execute service maps a "dettagli_assunzione" variable's data to a XML variable "xmlVar" in this way:



/process_data/xmlVar || /process_data/dettagli_assunzione/object/data



6. a Read Resources Content service extract a pdf file form the "dettagli_assunzione" xfaForm variable and put it in a document variable:



Resource Uri (XPhat expression):

/process_data/dettagli_assunzione/object/@templateUrl



Output:

output_document (this is my document variable)



7. a Import data service put together the XML data in the output_document:



PDF document (variable):

output_document



Input Data (XPath expression):

/process_data/dettagli_assunzione/object/data/xdp



Output Data merged PDF (variable):

output_document



8. a Write Document service write the output_document in the new created folder into the local filesystem:



Pathname (template):

C:\Adobe\Dipendenti\{$/process_data/modulo_assunzione/object/data/xdp/datasets/data/assunzionedata/anag_info/cognome$} {$/process_data/modulo_assunzione/object/data/xdp/datasets/data/assunzionedata/anag_info/nome$}/Scheda Assunzione {$/process_data/modulo_assunzione/object/data/xdp/datasets/data/assunzionedata/anag_info/cognome$} {$/process_data/modulo_assunzione/object/data/xdp/datasets/data/assunzionedata/anag_info/nome$}.pdf



Document (variable):

output_document



I really don't know where is the problem also because is very strange that it happens not every time.

Thanks

Valerio

Avatar

Level 2
Valerio,



Thanks for the steps. I was not able to reproduce the problem.



Since you indicate that you have 8.0.1 without any service packs (the line numbers in the stack trace confirms it), could you try to apply SP2 and see if the problem still occurs for new process instances?



Any stalled operation reporting the error "Document is not available on the sending side anymore. [...]" can never be restarted since part of the data required to 'restart' the operation has been permanently lost.

Avatar

Level 2
Final note as I give up ... I've tried more tests on 8.0.1 (no service packs applied) and I'm still unable to reproduce the error.