1 Reply Latest reply on Aug 12, 2008 6:40 AM by checkerpig

    Debuging Blazeds in Flex Builder

    ChickenSupreme Level 1
      Hi all,

      Im not sure if anyone else has posted this but thought id quickly go through how to setup Flex Builder 3 (standalone) and blazeds (turnkey version that comes with a tomcat server) so that you can debug both Java and your Flex Project inside Flex Builder at the same time.

      1) Install all the plugins needed to be able to code Java in Flex Builder 3. Go to Help >> Sofware Updates >> Find and Install >> Search for new Features and install. Check "Europa Discovery Site" and click next. Under Java Development check "Java Development Tools". Click finish and follow the rest of the instructions to install the plugin and restart Flex Builder when asked to do so.

      2) Create a New java project. File >> New >> Java >> Java Project. Write blazeds-server (or whatever you want) under Project Name. Select "create project from existing source" and choose the WEB-INF folder under C:\blazeDS\tomcat\webapps\samples\WEB-INF (i unziped my blazeds turnkey into C:\blazeDS as you can see). Click finish.

      3)Create a Remote Java Application. In the Flex Development Perspective, go to Run >> Debug >> Other. Right Click on "Remote Java Application" and choose New. Choose a name for your debug profile. Browse for the project choose the blazeds-server project you created earlier. Choose Standard (Socket Attach) connection type. Host=localhost, Port=1044. In the common tab check "Debug" so that it displays under your favorites. Click apply and close.

      4) Modify catalina.bat. Open catalina.bat in notepad, located under blazeDS/tomcat/bin. Find and set the following lines as follows:
      set JPDA_TRANSPORT=dt_socket
      set JPDA_ADDRESS=1044
      save it

      5) If you havnt created a Flex Project for your blazeds follow the instructions here: http://www.adobe.com/devnet/livecycle/articles/blazeds_gettingstarted_03.html

      6) start your server by running (i use cygwin) ./catalina.bat jpda start

      7) you can now set break points in the java code in blazeds and then choose the debug profile from the debug drop down (you have to be in the "Debug" prespective to see it in the favorites). Then run your flex app.

      Now youre debuging both java and flex inside Flex Builder at the same time.....yeeepee dee dudaaaa.