Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Coldfusion 8 bug with GetPageContext().forward()

3 views
Skip to first unread message

maiquelm

unread,
Mar 10, 2008, 3:50:39 PM3/10/08
to
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:

[b]Corrupt form data: premature ending[/b]
[i]
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...)
[/i]

You can reproduce the error with the attached code.

Thanks in advance,
Maiquel

[b]form.cfm[/b]

<cfif isDefined('form.submit')>
<cfscript>
GetPageContext().forward('index.cfm');
</cfscript>
</cfif>

<form action="test.cfm" name="form1" method="post"
enctype="multipart/form-data">
<input type="file">
<input type="submit" name="submit" id="submit">
</form>

maiquelm

unread,
Mar 10, 2008, 5:57:42 PM3/10/08
to
Thank you so much for the answer.

Maiquel

ksmith

unread,
Mar 10, 2008, 5:47:29 PM3/10/08
to
Better to submit bugs at
http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

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.

ksmith

unread,
Mar 13, 2008, 8:34:18 AM3/13/08
to
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.

maiquelm

unread,
Mar 13, 2008, 12:40:50 PM3/13/08
to
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

maiquelm

unread,
Apr 9, 2008, 2:50:35 PM4/9/08
to
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

overcrow

unread,
Jun 22, 2008, 1:22:54 AM6/22/08
to
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

0 new messages