Unknown destination - Flex Builder caching bug?
I keep hearing about a problem with Flex applications using RemoteObject. The problem is manifested via an error saying "Unknown destination 'XXX'":
As you know, RemoteObject destinations must be defined in remoting-config.xml. Flex Builder loads the file to get a list of valid destinations. However, it appears Flex Builder does not load the file every time the project is compiled, so the config file must be cached. As a result, if you add a new destination after Flex Builder creates or loads your project, the destination remains to be invalid unless the config file is reloaded.
I found two ways to force Flex Builder to reload remoting-config.xml. One is obviously a plain restart of the IDE. The other approach is quite simple too: open project properties, select Flex Compiler panel and click 'Apply'.
By the way, these are just my observations. If someone knows for sure what's going on (presumably someone from the Flex Builder development team), I'd be interested to know how far off I am from the truth. :)
UPDATE: Check out this post on the flexcoders user group. There is a nice little workaround described to avoid the problem.







7 Comments:
You can always force a clean compilation which will reload the config file.
4:38 AM
How do you do that (force clean compilation that is)?
7:37 AM
Project > Clean
it will delete all files from the bin folder and recompile everything from scratch.
9:09 AM
On OS X, I use the command line (no flex builder yet, sad) with -services option.
For example, using the example.mxml included:
mxmlc example.mxml -services=../../config/WEB-INF/flex/services-config.xml
9:40 PM
in AMFPHP, I setting "endpoint" attribute...
endpoint="http://localhost/amfphp/gateway.php"
10:32 PM
Be wary of remote drives. I just spent forever troubleshooting this and the problem turned out to be WebDrive Cache.
3:18 PM
Be wary of remote drives. I just spent forever troubleshooting this and the problem turned out to be WebDrive Cache.
3:19 PM
Post a Comment
<< Home