Accelerate Spring Flex development with Skyway + BlazeDS (Part 1/2)
This blog/tutorial covers the basics to getting started with spring-flex development in Skyway. The spring-flex framework uses Adobe’s open source BlazeDS project, which is the remoting and messaging foundation for connecting a Flex-based front-end to Java back-end services. Skyway is used to accelerate the Spring development by providing a visual environment to generate all the necessary Spring configuration files and CRUD operations in a SpringSource certified Spring MVC application. The tutorial then goes on to tweak the Skyway generated configuration files to support Flex Remoting to produce the list view above that calls the Skyway generated Spring service.
This blog is divided into 2 parts:
- Part 1: Setup & CRUD
- Part 2: Adding Spring Flex
What you’ll need first
Before creating the project, there are a handful of items you’ll need to setup your Skyway Flex Builder environment.
- Download BlazeDS: I downloaded the BlazeDS turnkey ready-to-use distribution, which comes with a version of tomcat. The BlazeDS installation guide was very helpful after the download.
- Get FlexBuilder: You’ll need something to compile your mxml into swf. There’s a 60 day trial of FlexBuilder 3. IMPORTANT: per M. Zach’s comments, it is essential to download Eclipse Ganymede (3.4 – for Java Developers) first, then install the FlexBuilder 3 plug-ins on top of that install, and finally install the Skyway Builder plug-ins.
- Get Skyway: Install the Skyway plug-ins on top of the FlexBuilder Eclipse instance. Download the Community Edition, or test drive the full featured Commercial Edition.
- Server & DB: Create your server and datasource connections inside Eclipse. If you need help, Skyway has a sandbox setup guide that can help. Point the server to the BlazeDS tomcat installation.
- References: Have the references section at the end of this blog handy. They are great resources for deeper understanding on any topic discussed here.
Create the Project & CRUD
There are several ways to create a Flex Project with Skyway’s generation capabilities. If you have an existing Flex Project, follow the recipe on setting up and Eclipse Dynamic Web Project. For new projects, the cleanest way I found to set up the project is to create a Skyway Project and then add the Flex Nature described here:
- New Skyway Project: File > New > Skyway Project. Name it BodyBuilder. Accept all defaults and click Finish.
- Add Flex Nature: Right-click the created BodyBuilder-Web project, and select Flex Project Nature > Add Flex Project Nature. Modify the defaults as described in the following:
- Clean up the Errors: You may get some errors in the Problems tab after adding the Flex Nature (also see M. Zach’s comments below):
- Server SDK: Directory does not contain a Flex SDK. To resolve, right-click the Web project > Properties > Flex Compiler. Choose Use default SDK in the Flex SDK version. This will then create another error about Cannot create HTML wrapper. Just follow the instructions in the error:right-click and choose Recreate HTML Templates.
- Web library project archive commons-codec-1.3.jar conflicts with another archive also mapped to the WEB-INF/lib folder: This is due to Skyway’s default library classpath container management. The easiest way to resolve is to go to the Web Project > WebContent/WEB-INF/lib folder and delete all the jars that do NOT start with flex-*.
- Create the Domain Object: This is the start of CRUD Scaffolding. If you aren’t familiar with Skyway’s CRUD Scaffolding capabilities, please take a look at the short How To on CRUD App Scaffolding for more details.
- Right-click the Spring DSL artifact under the BodyBuilder project, and select New > Model Package. Name it com.bodybuilder.domain.
- Right-click that Model Package, and select New > Domain Object. Name it Contestant. Add any fields to the Contestant Domain Object, making sure a primary key is specified. It may look something like the following image (click to enlarge):

- Scaffold CRUD: With a few short clicks, all the necessary Java and Spring MVC artifacts will be generated to support Create, Read, Update, and Delete operations on this domain object. Right-click the Contestant visual Domain Object, and select Scaffolding > Scaffold CRUD.
Add Spring Flex
Tags: blazeDS, Code Generation, ria, Scaffolding, skyway, Skyway Builder 6.3, spring-flex











December 17th, 2009 at 11:55 am
[...] Spring Flex development with Skyway + BlazeDS (Part 2/2) by Dave on December 17, 2009 In Part 1 of Accelerate Spring Flex development with Skyway + BlazeDS, I covered prerequisites, development [...]
December 20th, 2009 at 9:01 am
Hi Dave,
first of all thank you for setting up this tutorial. I can imagine that is not easy to find a way for the very first time. So thank you for your tutorial!
I followed your instructions, here are my comments:
Perhaps it helps to mention, that it does not work to install Skywaybuilder Plugin on Flexbuilder, nor to install Flexbuilderplugin on Skywaybuilder due to the changed folder structure.
So its essential to install Eclipse Java EE first, then the Flexbuilder Plugin and then the Skywaybuilder Plugin.
Then for the point “Add Flex Project nature” its not enough to accept the default (after a clean install) you have to
- select “J2EE” Server under ServerType and
- check the checkbox under “use remote object access service” and
- choose “LiveCycle Data Services” and click next:
- configure the location of the Flex War File by browsing for example to C:\web\bin\blazeds\blazeds.war.
Under Part I 3. Clean up the Errors it would be easier to change all settings in one step as follows
Flex Compiler: Choose to use default SDK Version
If using the turnkey version which uses port 8400 the following changes have to be made:
Flex Build Path: (this is missing)
Change Output folder to http://localhost:8400/BodyBuilder-Web
Flex Server:
Change Root URL to “http://localhost:8400/BodyBuilder-Web”
change Contect root to “/BodyBuilder-Web”
Under 3.2. it enough to delete the “Common codecs”
For a Flex developper it would be esier to mention, that after CRUD scaffolding
- to click on the generated “ContestantDAO”
- click on “Database Configuration” and choose the desired Database Connection
- hit save and click on “BodyBuilder Web” and “Run as”/ “Run on Server” to check if everything is ok so far.
Hope this will help somenone.
Cheers!
M. Zach
December 22nd, 2009 at 6:16 pm
Thanks for the extra details M. Zach, i was unable to use this blog- post until i found the extradetails you kindly added… :-)
December 23rd, 2009 at 9:15 am
Thank you Isreal and M. Zack. Dave (the author of this blog post) is on vacation this week, but he’ll take a look at the instructions when he returns. We’ll update whatever needs to be updated.
There’s also a forums thread on the Skyway Builder forums where the integration with Flex is being discussed.
http://www.skywayperspectives.org/portal/web/guest/174/message_boards/message/75376
December 29th, 2009 at 11:03 am
M. Zack, thank you for the comments!! I will update my blog with your updates.