iEntry 10th Anniversary RSS Newsletter Advertising
Join the WebProWorld Forum!
Text: Decrease Font Size Increase Font Size | Print Print Article | Share: Delicious Digg StumbleUpon Post to Twitter Post to Facebook
Monday, January 22, 2007

Flex/ColdFusion Mystery and a Very Simple Answer

I was working on a Flex project when I hit a brick wall. I had a very simple form.

Flex was using remoting to send the form information to ColdFusion. ColdFusion was doing nothing with the data.

It was just an empty method. However, every time I'd try to send the data I'd get an error.

Here is where things got weird. The first thing I tried was launching ServiceCapture so I could see the response from ColdFusion.

However - when I would send the form data, ServiceCapture would actually hang. I had to force it down.

So then I went to my ColdFusion logs. Nothing was reported in the error log but an empty string. At this point I'm really confused.

I go into my Application.cfc file's onError and added this:

<cfsavecontent variable="temp">
<cfdump var="#arguments#">
</cfsavecontent>
<cffile action="write" file="c:foo.html" output="#temp#">

Now I get somewhere. When I look at the file, I see no message, no detail, but I do see a type for the error:

java.lang.StackOverflowError

What the heck? (Ok, I didn't say heck.) So now I start trying random crap. First I change the method names. Doesn't help. Finally I change my Flex code to send nothing to ColdFusion. And it works.

Um. Ok.

I restored my code and noticed something....

core.addAdminUser(username,password);

username and password were the form elements, not the values of the form elements. Somehow Flex thought this was ok. Can you really send a component over the wire? Flex could. And while it didn't die, it was enough to freak out ServiceCapture and ColdFusion.

Changing my Flex to:

core.addAdminUser(username.text,password.text);

made everything kosher. Whew!

Comments

Tag:

Add to Del.icio.us | Digg | Reddit | Furl

Bookmark WebProNews:

Raymond Camden, ray@camdenfamily.com
http://ray.camdenfamily.com

Raymond Camden is Vice President of Technology for roundpeg, Inc. A long
time ColdFusion user, Raymond has worked on numerous ColdFusion books
and is the creator of many of the most popular ColdFusion community web
sites. He is an Adobe Community Expert, user group manager, and the
proud father of three little bundles of joy.

News Tags: coldfusion, Flex
About the author:
Raymond Camden, ray@camdenfamily.com
http://ray.camdenfamily.com

Raymond Camden is Vice President of Technology for roundpeg, Inc. A long time ColdFusion user, Raymond has worked on numerous ColdFusion books and is the creator of many of the most popular ColdFusion community web sites. He is an Adobe Community Expert, user group manager, and the proud father of three little bundles of joy.

Worked like a charm!

Thanks Ray, that was something that I was struggling with for a while. I was getting this error while passing an TextInput to a cfc instead of it's text value.

ScottD

yikes

I did the exact same thing, basically an empty cffunction to do nothing but return the string passed to it. Except I wasn't passing the mx:TextInput's text value, I was passing the object itself. Talk about pulling my hair out trying to figure out why CF didn't like it.

Such simple things, easy to miss...and a two-and-a-half year old post on the Internet gave me one of those "D'OH!" moments.

Publish A Comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
8 + 7 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
SEARCH
Popular WPN Business Resources












Subscribe to WebProNews


Send me relevant info