Compiling the BlazeDS source code takes a lot more than one might expect. A mix of bad instructions from Adobe and general craziness that is Windows XP is to blame.
The problem was that ‘ant’ was failing during the building BlazeDS and giving errors like the following when I ran ‘ant main’ like the instructions told me to do:
- build.xml:69: The following error occurred while executing this line: modules\common\build.xml:100: Unable to rename old file (flex-messaging-common.jar) to temporary file
I had more luck if I manually called each of the ant tasks (ie. ant clean; ant sdk; ant common; ant common; ant core; ant core; ant proxy; ant remoting; ant opt; ant apps; ant createMMSFile). Don’t ask me why I had to run ‘ant common’ and ‘ant core’ twice, it wouldn’t work otherwise. But when I finally ran ‘ant package’ at the end, to create the ‘blazeds.war’ file I need, I got the following error:
- mxmlc task failed
The solution to the first problem involves manually calling each ant task. The solution to the second problem involves editing the ‘ant.bat’ file and increasing the default memory limit. The following is a guide to how I got a working build.
1) Download the source zip file from the BlazeDS website (http://download.macromedia.com/pub/opensource/blazeds/blazeds_src_3-0-0-544.zip)
2) Open up the ‘readme.txt’ and follow the first two requirement sections, but do NOT run ‘ant’ yet!
- Basically, download ant if you don’t have it, download the necessary JUNIT and ant-collab jars, and set up the environment variables
3) Insert the following line at the top of your ‘ant.bat’ file:
- set ANT_OPTS=-XX:MaxPermSize=256m
4) Run the following sequence of ‘ant’ build commands
- ant clean
- ant sdk
- ant common (twice if it fails the first time)
- ant core (twice if it fails the first time)
- ant proxy
- ant remoting
- ant opt
- ant apps
- ant createMMSFile
- ant package
5) Now you can use the newly built ‘blazeds.war’ ‘ds-console.war’ and ‘samples.war’ in the ‘dist’ directory of your BlazeDS source root directory.
For more information: