Skip to main content
Participant
March 10, 2008
Answered

Coldfusion 8 bug with GetPageContext().forward()

  • March 10, 2008
  • 4 replies
  • 1163 views
Hi,

I have a form that uses enctype="multipart/form-data" in a production server with Coldfusion MX 7 that's working fine. But when I try to move the application to the Coldfusion 8 it crashes!

This error only happens when using GetPageContext().forward() after submiting the form. We need to use forward method after the submitting (instead of using the <cflocation>) because we want to keep the status of the page.

The exception we get is the following one:

Corrupt form data: premature ending

The error occurred in D:\Inetpub\wwwroot\LRNSystemMVC\test.cfm: line 3

1 : <cfif isDefined('form.submit')>
2 : <cfscript>
3 : GetPageContext().forward('index.cfm');
4 : </cfscript>
5 : </cfif>

This is the stacktrace of the error:

java.io.IOException: Corrupt form data: premature ending
at com.oreilly.servlet.multipart.MultipartParser.<init>(MultipartParser.java:169)
at com.oreilly.servlet.multipart.MultipartParser.<init>(MultipartParser.java:93)
at coldfusion.filter.FormScope.fillMultipart(FormScope.java:136)
at coldfusion.filter.FusionContext.SymTab_initForRequest(FusionContext.java:428)
(continues...)


You can reproduce the error with the attached code.

Thanks in advance,
Maiquel

form.cfm
This topic has been closed for replies.
Correct answer maiquelm
Apparently, the new Coldfusion 8 update 1 (8.0.1) resolved the problem.

I did some tests with the code above and with another one more complex and none problem occurred.

I think this bug can be marked as resolved.

Regards,
Maiquel Sampaio de Melo

4 replies

maiquelmAuthorCorrect answer
Participant
April 9, 2008
Apparently, the new Coldfusion 8 update 1 (8.0.1) resolved the problem.

I did some tests with the code above and with another one more complex and none problem occurred.

I think this bug can be marked as resolved.

Regards,
Maiquel Sampaio de Melo
Participant
June 22, 2008
Dear Maiquel,

The Coldfusion 8 has not fixed the problem.

You gotta do a combination of things to get this problem solved.

Indeed you need to have the version 8.0.1 running, but it must be running on the JRE 1.5.0.15 and you must also set in the JVM the argument -Dcoldfusion.markResetForMultiPart=true (not false as mentioned above).

It was a nightmare to figure out all this, I hope adobe get this fixed in the next hot fixes. This is nothing something easy to get it fix, and can drive a man mad!

I hope no one besides us have faced this problem!

Best regards...

JC
maiquelmAuthor
Participant
March 13, 2008
Ken, thank you for the answer.

I tried both solutions but the problem persists.

I found a post in the "Coldfused?" blog about the new upload code in CF8:

http://coldfused.blogspot.com/2007/08/coldfusion-8-changes-with-file-upload.html

There, the solution proprosed to use the old upload code from CF mx7 is to set the argument markResetForMultiPart to true:

-Dcoldfusion.markResetForMultiPart=true

I would like to remind you that we use the enctype=”multipart/form-data” in the form, however uploading or not a file we get this exception. I don’t thinl our problem is related with the size of the file.

Do you know any other workaround for this problem?

Thank you in advance,
Maiquel Sampaio
maiquelmAuthor
Participant
March 10, 2008
Thank you so much for the answer.

Maiquel
March 13, 2008
Hi Maiquel,
There were updates to GetPageContext that improve performance, generally. But they cause this issue. You can workaround this error by setting the property coldfusion.markResetForMultiPart=false.

You set the jvm argument as -Dcoldfusion.markResetForMultiPart=false

or programatically set it as:

<cfscript>
sys = createObject("java","java.lang.System");
sys.setProperty("coldfusion.markResetForMultiPart", "false");
</cfscript>

It is better to set it as a JVM argument since the script does impact the whole CF server. There will be some loss of performance for fileupload. It will remain similar to cfmx7 performance with this property set false.


March 10, 2008
Better to submit bugs at Feature Request/Bug Report Form.

Although this bug has already been submitted as 71432. You can watch for the next cf8 cumulative hot fix to see if it is resolved there or in cf8.01 (in beta). I will try to post if I see it is fixed.