Expand my Community achievements bar.

Failed to load TemplateStream for FormQuery on WebSphere 6.1

Avatar

Level 2

Trying to execute the following code on LiveCycle Server running on WebSphere 6.1 but getting the Failed to load TemplateStream for FormQuery" error. The same peice of code runs perfectly on my machine against JBOSS running on my machine.

Note that, the form repository is on my machine at C:\AdobeTest.

My JDK and all jar files are all compatible with the websphere. I am even sing the WebSphere JDK. Also, changed the OutputService time out setting to 360  from 180 default. 

Any suggestions?

How do you set the Content URI? tried setting it to C:\AdobeTest on server machine but didn't work.

Thanks

***************************************************************************************

//Create a FormsServiceClient object  
   FormsServiceClient formsClient = new FormsServiceClient(myFactory);     
                 
   //Cache the form  
    PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec();  
    pdfFormRenderSpec.setCacheEnabled(new Boolean(true));
  
   //Specify URI values  
   URLSpec uriValues = new URLSpec();   
   uriValues.setContentRootURI("C:\\AdobeTest");  
  
   //Invoke the renderForm method  
   FormsResult formOut =
    formsClient.renderPDFForm(   
     cover.xdp,               //formQuery   
     formData,        //inDataDoc   
     pdfFormRenderSpec,      //PDFFormRenderSpec    
     uriValues,    //urlSpec   
     null     //attachments   
     );

8 Replies

Avatar

Level 10

"Note that, the form repository is on my machine at C:\AdobeTest."

When you set the ContentRootURI, it has to be a path on the server. That code executes server side and doesn't have access to the client's machine.

Try to put file:///c:/AdobeTest/

Also your cover.xdo is not in quotes. Put "Cover.xdp" instead.

Jasmin

Avatar

Level 8

I also noticed your code is not sending a string for the template name:

This should be:

FormsClient.renderPDFForm(   
    "cover.xdp",               //formQuery  

Avatar

Level 2

Jasmin,

Now, I am running the follwing code on the same machine where the LiveCycle is running. It's on WebSpehere 6.1. Now I am getting the following error.

"Not that the same code runs on JBoss on my machine."

ALC-DSC-005-000:

com.adobe.idp.dsc.DSCNotSerializableException : Not Serializable Caused by: ALC-DSC-003-000: com.adobe.idp.dsc.DSCInvocationException : Invocation error.

aused by: com.adobe.livecycle.formsservice.exception.RenderFormException: com.adobe.document.xmlform.RenderException: IDL:com/adobe/document/xmlform/RenderException:1.0
at com.adobe.formServer.FormServer.renderForm(FormServer.java:210)
at com.adobe.formServer.FormServer.renderForm(FormServer.java:257)
at com.adobe.formServer.docservice.FormsDocService.renderForm(FormsDocService.java:483)
at com.adobe.formServer.docservice.FormsDocService.renderForm(FormsDocService.java:421)
at com.adobe.formServer.docservice.FormsDocService.renderPDFForm(FormsDocService.java:119)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.java:118)
... 64 more
Caused by: com.adobe.livecycle.formsservice.exception.FormServerException: com.adobe.document.xmlform.RenderException: IDL:com/adobe/document/xmlform/RenderException:1.0
at com.adobe.formServer.PA.XMLFormAgentWrapper.doPAExecute(XMLFormAgentWrapper.java:418)
at com.adobe.formServer.PA.XMLFormAgentWrapper.execute(XMLFormAgentWrapper.java:192)
at com.adobe.formServer.PA.XMLFormAgentWrapper.execute(XMLFormAgentWrapper.java:212)
at com.adobe.formServer.Controller.resolveFragments(Controller.java:860)
at com.adobe.formServer.Controller.doRender(Controller.java:495)
at com.adobe.formServer.Controller.render(Controller.java:129)
at com.adobe.formServer.FormServer.renderForm(FormServer.java:191)
... 73 more
Caused by: com.adobe.document.xmlform.RenderException: IDL:com/adobe/document/xmlform/RenderException:1.0

*****************************************************************************************************

//Create a FormsServiceClient object  
   FormsServiceClient formsClient = new FormsServiceClient(myFactory);     
                 
   //Cache the form  
    PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec();  
    pdfFormRenderSpec.setCacheEnabled(new Boolean(true));
    pdfFormRenderSpec.setLinearizedPDF(true);
   //Specify URI values  
   URLSpec uriValues = new URLSpec();   
   uriValues.setContentRootURI("D:\\AdobeTest");  
  
   //Invoke the renderForm method  
   FormsResult formOut =
    formsClient.renderPDFForm(   
     formName,               //formQuery   
     formData,        //inDataDoc   
     pdfFormRenderSpec,      //PDFFormRenderSpec    
     uriValues,    //urlSpec   
     null     //attachments   
     );      
  
 

Avatar

Level 10

First, like I said above, you need to put file:/// for the protocol in the ContentRootURI

Also the path to the form is going to be ContentRootURI + formName. In your case it's D:\\AdobeTest + formName

If form name is test.xdp, you'll end up with D:\\AdobeTesttest.xdp, which won't work. You need an extra \\ at the end of your ContentRootURI to get D:\\AdobeTest\\test.xdp.

Finally put file:///infront of the url to set the protocol.

Jasmin

Avatar

Level 2

Jasmin,

May be I am not getting it right.

When I just put "cover.xdp" for formQuery param I get Not Serializable exception. However, when I put "D:\\AdobeTest\\Cover.xdp" and put uriValues.setContentRootURI(file:///D:\\AdobeTest);

I get "

Failed to load TemplateStream for FormQuery=D:\AdobeTest\cover.xdp from location URI =file:///D:\AdobeTest.

I have tried many combinations .. like uriValues.setContentRootURI(file:///D:\\AdobeTest\\);

I don't get the same issues in JBoss.

************************************************************************************************************

//Create a FormsServiceClient object  
   FormsServiceClient formsClient = new FormsServiceClient(myFactory);     
                 
   //Cache the form  
    PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec();  
    pdfFormRenderSpec.setCacheEnabled(new Boolean(true));
    pdfFormRenderSpec.setLinearizedPDF(true);
   //Specify URI values  
   URLSpec uriValues = new URLSpec();   
   uriValues.setContentRootURI("file:///D:\\AdobeTest"); 
  
   //Invoke the renderForm method  
   FormsResult formOut =
    formsClient.renderPDFForm(   
     "cover.xdp",               //formQuery   
     formData,        //inDataDoc   
     pdfFormRenderSpec,      //PDFFormRenderSpec    
     uriValues,    //urlSpec   
     null     //attachments   
     );     

Avatar

Level 10

Ok.... one last time

set the following:

setContentRootURI = file:///D:\\AdobeTest\\

formQuery = Cover.xdp

"When I just put "cover.xdp" for formQuery param I get Not Serializable exception. However, when I put "D:\\AdobeTest\\Cover.xdp" and put uriValues.setContentRootURI(file:///D:\\AdobeTest);"

Again, the full url location is ContentRootURI + formQuery.

If you set formQuery to "D:\\AdobeTest\\Cover.xdp" and ContentRootURI to file:///D:\\AdobeTest, the url for the form is going to be "file:///D:\\AdobeTest" + "D:\\AdobeTest\\Cover.xdp" =  "file:///D:\\AdobeTestD:\\AdobeTest\\Cover.xdp" which is not valid.

Jasmin

Avatar

Level 2

with

setContentRootURI = file:///D:\\AdobeTest\\

formQuery = Cover.xdp

I get the following Exception

ALC-DSC-005-000:

com.adobe.idp.dsc.DSCNotSerializableException : Not Serializable

Avatar

Level 8

Not Serializable just means something went wrong.  Can you check the server log?