Quantcast

Flex/ColdFusion Mystery and a Very Simple Answer

Get the WebProNews Newsletter:
[ Business]

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.

Flex/ColdFusion Mystery and a Very Simple Answer
About Raymond Camden
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. WebProNews Writer
Top Rated White Papers and Resources
  • ScottD

    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

  • Paul

    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.