Java – Quickly debug Flex/Java web application from Eclipse

apache-flexdebuggingeclipsejavamaven-2

I have a Flex/Java web application that uses Maven as a build tool. Currently, if I want to debug the entire application I use Maven to create the WAR file and use the cargo plugin to deploy the WAR file and start up the app server. I then launch an Eclipse (with Flash Builder 4) Flex "Web Application" debug configuration and start debugging.

It all works very well, but I am looking for a way to make this faster. I'd like to be able to edit my Flex code and immediately launch my Flash Builder debug configuration without going through Maven.

Currently the output folder for my Flex client module is just the "bin" folder of the project. In a perfect world, I'd configure Flash Builder to put it's newly minted SWF file (and assets) directly into the app server I am running. Assuming this is impossible with remote app servers, and also impossible with the local app servers I run from Cargo, perhaps I can use another approach to running a local app server from Eclipse?

I don't know enough about Eclipse or Flash Builder to know what to do…HELP!

Best Answer

We are using Flash Builder but this should work for the eclipse plugin too. In the Flex Build Path configuration for the project set the output folder to the target folder where you have your web server pick up the SWF you are building. Set the Output folder URL to point to the context that launches the SWF and you should be good to go. Example:


Output folder: c:\java\tomcat\webapps\myapp
Output folder URL: http://localhost:8080/myapp

As an aside we have also found that using IE to test in makes things simpler as it tends to have less funnies with cached SWFs then Firefox or Chrome.