Flex 4 Sample Application using a Java Back-End, BlazeDS 4 and Flash Builder 4 Data Wizards

I put together a new Test Drive environment to allow you to explore the development of Flex 4 applications with a Java back-end using the new “Data-Centric Development” features of Flash Builder 4. These features include service introspection, value object and service stub generation, etc. This Test Drive is still work in progress: it currently consists of a single application called InSync (a complete Flex 4 rewrite of my contact management sample application), but I think it’s already valuable to understand the impact of the new Flash Builder 4 data features. Insync also demonstrates some of the new features of Flex 4: skinning, skinnable components, layout managers, etc.

Watch the video below to get familiar with the Test Drive environment and the sample application:

Installation Instructions

  1. Download flex-java-testdrive.zip, and unzip the file in your root directory.
  2. Open a Command Window or Shell, navigate to /flex-java-testdrive/tomcat/bin, and start Tomcat (for instance: catalina run).
  3. Open a browser and access http://localhost:8400/testdrive/InSync/InSync.html.

Importing the projects in Flash Builder 4

  1. In Flash Builder 4, click File > Import > General > Existing Projects into Workspace.
  2. Specify flex-java-testdrive/projects as the root directory and click finish.
  3. Explore the projects: InSync is the Flex project and java-testdrive is the Java project for the server-side classes.

In the InSync project, the classes in the services and valueObjects packages have been generated automatically by Flash Builder 4. My next blog post will show you how to generate these classes based on existing Java services deployed in BlazeDS.

NOTE: Because BlazeDS 4 hasn’t yet been released, this version of the Test Drive uses a nightly build of BlazeDS 4.

Comments

  1. N shen says:

    Could you demo on how to use RemoteObject on this example? thx

  2. ex3108 says:

    Hi Christophe,

    Thanks for sharing this cool way to bind server side object with Flex componenet. Could the same DataGrid be linke to two different service operations base on clicking on different button?

    thx
    ex3108

  3. Jeff says:

    I have my AS3 code generation working from BlazeDS spring beans but running into an issue and not sure if its a configuration issue or a limitation of the Data Services in Flash Builder. If my service returns an array of Shape(s) but Shape is the base class, really it can be a Circle or Square (i.e. simple polymorphism example coming). I found out how to get the Circle and Square to generate via the configure return type but that creates 3 classes which are not related to one another in any way.

    Is this a limitation of Flash Builder data services?

    (maybe this will be answered in another blog post later)

  4. Mickel says:

    Mr. Coenraets:

    Great Demo as usual. Can you please do a demo using the Annotation-based ORM framework approach?

    Again, great job on the new demo.

    Thanks,
    Mickel

  5. John says:

    Thanks very much for the sample! The application runs great on my Mac except for the ability to turn on the camera and take a picture. When I try to turn the camera on, I get a request to allow and I approve it but the camera never actually turns on. The screen remains black. I can click on the take a picture icon and that makes a sound, but it doesn’t actually capture any image other than the black screen. Any thoughts?

    Thanks,
    John

  6. herber says:

    cant follow the whole story…when i import those project i get errors and cant compile; anyway i am able to reach http://localhost:8400/testdrive/InSync/InSync.html.. the errors seems to be because of import flex.messaging.config.ConfigMap and another import… I cant reach the flex.messaging package …
    What have to be configured to reach the flex classes with the java project?

    Many wishes

  7. Hii ,

    Thanks for nice example , plz also put data base of this project , and why dont you put tomcat saprate , so that it can download fast.

    Thanks

  8. Shannon says:

    thank you for all the helpful information, I will definitely put this information to use!

  9. wyne says:

    http://lifeinsurancemn.org/

    People use life insurance for many different reasons. For example, to protect their family, to cover a home mortgage, to fund buy sell agreement, to pay off debt and settle estate taxes. The amount of covergae you need will vary depending on the purpose of your policy. A general rule of thumb is 8 to 10 times your annual income will provide your family with adequate protection.

  10. Flex 4 applications seem really cool. Chris thanks for sharing this.

  11. Wyne says:

    MINI CANVAS

    transform photos into works of art by printing them onto high quality real fibre artist cotton canvas prints.

  12. Manoj Kumar Garwa says:

    HI, I am new guy with flash builder 4.I am trying to connect flex application through java using blazeds as shown in your video but still getting a problem.when i connect by clicking on Data->Connect to BlazeDS.it ask for username and password so i clicked on No Password Required and than OK.after click on ok it shows following error:
    RDS Server Message
    Error executing RDS Command.Status Code 500, Reason : Internal Server Error.

    I have already replaced web.xml of BlazeDS to web.xml of my working directory by setting useAppserverSecurity to false and uncommented to RDS server declaration and mapping.

    can you pls solve this problem

  13. gh says:

    ghngng

  14. The most important thing to remember when considering health and life insurance
    is that you have to do your research. An informed consumer protects himself and is not vulnerable to the insurance companies. When researching health and life insurance coverage it is wise to use as many resources as possible.

  15. By reading we enrich the mind; by conversation we polish it.

  16. adrian s says:

    I have just noticed that there are 2 separate locations of the java database .class files:
    1) C:\flex-java-testdrive\projects\java-testdrive\src\flex\samples\contact\*.class
    2) c:\flex-java-testdrive\tomcat\webapps\testdrive\WEB-INF\classes\flex\samples\contact\*.class

    And if you modify something in path 1) then y0u have to copy the .class files into path 2) your self other wise the change will not be visible.

    Is there a way to have the WEB-INF updated it self when you edit from sources located on path 1) directly ?

    Thanks,

  17. I keep getting an error when I try to do this. The window keeps closing when I try to download….Is anyone else having this problem?

  18. yumiko says:

    My name is Yumiko and I work at the company related to IT in Japan.

    The reason why I am writing this email to you is I’d like to ask some questions about BlazeDS.

    In the processing of something,
    As for data, push is done from the server side to the client(Flash).
    It uses streaming.

    That time,
    When a browser is shut,
    Data that does push keeps collecting, until the session cuts.

    Is the judgment of “Tough push to the client, There is because a browser is shut doing push ahead. ” possible?
    Or, Is the setting that can judge it necessary?

    By the way, The session time-out is not 0.

    Please teach to me who doesn’t haveknowledge.

  19. mohan says:

    hi,

    I got a problem while executing the application ie unable to open service-config.xml.
    please help this problem.

    Thanks

  20. Ganzorig says:

    Hello, Coenraets. Great demo. I’m trying to work on the source code and deploy it to my own server. But I do have one problem. How do I use your Database in hsqldb. I saw that there’s a h2-1.2.131.jar, which is very likely to contain information about the DB (I mean DDL). So how do I use it in my hsqldb? Thanks in advance.

  21. A few things i will not recognized is that if in all honesty how you happen to be no more a legitimate much more smartly-preferred as compared to you may be at this time. You might be very clever. You realize as a result considerably in relation to this particular subject matter, created me personally for my part consider it coming from so many varied angles. The like people aren’t fascinated besides it is something related to Lady crazy! Your own personal things great. All the time take care of it up!

  22. Tim says:

    Hello,
    The TabNavigator on your demo, is there a way to set a background image on the same .
    I tried to set it through css style, skin it – nothing works.

    Is this possible ? if possible any snippets please.
    Thanks in advance,

  23. Sun says:

    The link to download the code is broken!

  24. Cristiano says:

    Hello Christophe,

    You did a great job in your blog. I’m trying to download the zip file: flex-java-testdrive.zip and it’s not opening the link. Can you tell how can I get this zip file from your blog ?

    Best Regards,

    Cristiano Borges

  25. Jesus Bravo says:

    Hi Christopher!

    I tried to download the flex-java-testdrive.zip file through the link above, and it through me a 404 error message. Do you think I could get the source files for your example somewhere else?

    Thanks,

    Jesus Bravo

  26. Cristiano says:

    Hello Christophe,

    I need so much your example: flex-java-testdrive.zip to go ahead in my studies and in my project.
    Can you send for me your file: flex-java-testdrive.zip by my email: crisbol27@hotmail.com ?

    Warm Regards and Thanks in adavance,

    Cristiano Borges

  27. Jarno says:

    From where I can download sample project? Current link is dead.

  28. Anon says:
  29. Ahmed says:

    Hi, Christophe Coenraets
    Please, i can’t download flex-java-testdrive.zip ……………… URL not found.
    thanks

Trackbacks

  1. [...] – Flex 4 Sample Application using a Java Back-End, BlazeDS 4 and Flash Builder 4 Data Wizards [...]

  2. [...] Christophe Coenraets Rich Internet Applications, Flex, AIR, Java Skip to content BioUsing Flex with Spring « Flex 4 Sample Application using a Java Back-End, BlazeDS 4 and Flash Builder 4 Data Wizards [...]

  3. [...] Flex 4 Sample Application using a Java Back-End, BlazeDS 4 and … [...]

  4. [...] Flex 4 Sample Application using a Java Back-End, BlazeDS 4 and … [...]

  5. [...] Christophe Coenraets: I have blogged about the new data-centric features in Flash Builder 4 here and here. One question people often ask me is: “Can I use this feature if I use a Framework [...]

Speak Your Mind

*