Expand my Community achievements bar.

Error: read EOF on inputStream with 512 bytes pending

Avatar

Former Community Member
Hi,



I'm testing HTML rendering. I have a small calculation (adds 2 numbers together) that I want to execute on the server. I'm getting the following execption in the first line of code when I call



IOutputContext formServerOutput = formServerObject.processFormSubmission(request, "OutputType=0"); // optional:



An internal error occurred. Please make a note of exactly what you were doing when this occurred, and report it to Support.

com.adobe.formServer.interfaces.ProcessFormSubmissionException: java.io.IOException: read EOF on inputStream with 512 bytes pending



If I render the form as PDFForm it all works fine. At present the render option is "AUTO".



Any suggestions.



Philip
4 Replies

Avatar

Former Community Member
This is a generic java exception thrown when you attempt to re-read the contents of the input stream.



The processFormSubmission(Request, ...) method uses the HttpServletRequest Object which contains a ServletInputStream object in turn containing the posted data from your HTML form as binary data. processFormSubmission will try and read this a byte array.



If you have anything in your servlet/JSP code before the processFormSubmission which queries the contents of the request object, the InputStream will be parsed automatically and this exception occurs.



You have 2 options, 1) Make sure you do read the contents of the inputstream before calling processFormSubmission or 2) use the alternative method which takes a byte array instead of the Request object - the byte array would have to be manually created as name / value pairs of Http post data.



I would try and stick with option 1 but you may have no choice. BTW, This can also happen in struts based apps - same reason, but the framework is doing the damage.

Avatar

Former Community Member
Thanks - I was reading a parameter. Is this logged as a bug. At the very least it should be documented as this is non-standard Servlet behaviour.



Cheers



Philip

Avatar

Former Community Member
Hello,



I am having same issue in integrating Weblogic Portal with Forms 7.1.

Based on David's reply above, it seems weblogic portal framework is reading the ServletInputStream before I am passing it to FormServer.



Philip, which option you chose to fix it? Can you share sample code?



Thanks in advance.

Mahesh

Avatar

Former Community Member
I am also facing a similar issue.

Some data is posted as hidden variable to the servlet. And same is read in Servlet through request.parameter().

If i try to fetch variable data through request.parameter before calling 'ProcessFormSubmission' then I get error as "read EOF on inputStream with 512 bytes pending"



But if I try fetching variable data through request.parameter after calling 'ProcessFormSubmission' then API 'ProcessFormSubmission' works fine but request.parameter returns null.



Cant I fetch both the information at the same time. Plz suggest