Wednesday, April 18, 2007

Debug messages

Got some weird debug messages today:

Here is the first i encounterd: "Send Failed".

Appearantly the flex compiler includes a context in the swf. When the swf is downloaded and tries a RemoteObject or other request to the server, it uses the precompiled context of your webapp. So if you are developing at "http://localhost/appcodename", then after a couple of weeks hard work you create a war file like "financeApp.war" and you deploy it to like "". Then suddenly your remote requests give a weird "Send Failed" error... I found out that the url it is requesting is wrong (after hours of debugging) and ended up recompiling the SWF files with the correct context (i set the context from the flex builder -> project properties -> Flex Server. So i changed 'appcodename' to 'financeApp'

Another fun error message: Error #2044: Unhandled SecurityErrorEvent:. text=Error #2047: Security sandbox violation: LocalConnection.send: pc002 cannot access

And this message pops up randomly when accessing a flex generated html page with does nothing more then embedding the swf file.

I'm not sure what causes this error, only some flexplugins have this problem and only occasionnally. It has something to do with the history management of your browser. The solution to this problem is to remove the IFrame where flex does its history management (history.htm). The error message dissapears when removing the IFrame. I am not sure why or how, but i recommend not to compile your apps with history management if you don't use it.

Why do i never get a debug message with usefull information?

written by Marcel Panse


Justin said...

Hi Marcel,

Did you ever find a solution to this? I have the exact same problem however i really need history management for my app.

Marcel Panse said...

I don't know, i am working on a AIR app now.. Maybe the bug is fixed in the new flex 3 beta, otherwise check the bug database to see if someone had submitted it already...

Thomas Lyon said...

nice blog its really awesome.more info