Spring/BlazeDS Integration Test Drive: M2 Update Available

UPDATE: This version of the Test Drive is now obsolete. I posted a new version of the Test Drive for the RC1 build of the Spring / BlazeDS integration project here.

I updated my Test Drive for the M2 build of the Spring / BlazeDS integration project.

The Test Drive now includes a sample demonstrating the integration with Spring Security (the key new feature in M2). The Spring configuration file has also been updated to use the new simplified XML-namespace-based configuration.

Installation Instructions:

  1. Download the Spring / Flex TestDrive here: http://coenraets.org/downloads/spring-flex-testdrive-M2.zip
  2. Unzip it in your root directory
  3. Navigate to /spring-flex-testdrive/tomcat/bin and start Tomcat (for instance: catalina run)
  4. Open a browser and access http://localhost:8080
  5. Follow the instructions

As always, I’d love to hear your feedback and your ideas to improve this Test Drive.

Christophe

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • LinkedIn
  • StumbleUpon
  • Twitter
This entry was posted in Flex, LiveCycle Data Services. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

34 Comments

  1. Andy.Liu
    Posted March 11, 2009 at 10:47 am | Permalink

    So cool!
    Thank you for your nice example.

  2. shree
    Posted March 11, 2009 at 11:28 am | Permalink

    I am new to Flex. I downloaded and ran your testdrive and it works great out of the box.
    How can I import Flex and Java projects together into same Flex Builder workspace (I installed Java plugins in Flex Builder already) and play with them to understand more clearly. I also want to use Tomcat 5.5 as the server in Flex Builder.

  3. christophe
    Posted March 11, 2009 at 1:00 pm | Permalink

    Shree,
    There are several approaches to create a project for a Flex application that works with Java. A very simple approach is defined at http://localhost:8080/fb-project-setup.htm (start the test drive server first). Another setup is to combine the Flex and Java projects: Mihai has some instructions here: http://corlan.org/2008/06/05/creating-a-combined-flexjava-project-in-flex-builder-wo-lcdsblazeds/.
    Christophe

  4. Venu
    Posted March 11, 2009 at 1:32 pm | Permalink

    Great! Thanks.

  5. Prashanth
    Posted March 11, 2009 at 2:06 pm | Permalink

    Awesome. Thanks a lot Christophe. I will check it out.

  6. Derek S
    Posted March 11, 2009 at 3:40 pm | Permalink

    Congrats on M2! This testdrive will help everyone learn by example. Thanks!

  7. Prashanth
    Posted March 11, 2009 at 3:41 pm | Permalink

    I removed the TomcatLoginCommand configuration from services-config.xml and the security still works. I think this was from the old M1 integration.

    When you do a ro.channelSet.login(username, password) what is actaully happenning with this whole integration. Can you please explain the flow of logic from Flex Client -> BlazeDS -> Spring Security?

    thanks & Rgds
    Prashanth

  8. stef
    Posted March 11, 2009 at 5:36 pm | Permalink

    excellent work! SB

  9. Posted March 12, 2009 at 1:00 pm | Permalink

    Hi Christophe,

    I had a few problems when I created projects from the source code provided.

    1) flexlib.swc was missing from the Flex projects using SuperTabNavigator. This was easily resolved but you might want to just include it.

    2) When I overwrite the Java classes with my own, I get the following error:
    Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class flex.spring.samples.product.ProductDAO]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given

    Any ideas on that one?

    Thanks.

    -James

  10. Posted March 12, 2009 at 3:24 pm | Permalink

    Hi James,
    1) Yes, I will include flexlib.swc in the next rev. In the meantime, if other people have that problem, it’s available here: http://code.google.com/p/flexlib/. Download flexlib-.2.4.zip and copy flexlib.swc (/bin) in the lib directory of your project.
    2) Does your class have a no-arg constructor? If not, add one and it should work. It looks like a CGLIB proxies requirement. Notice that it will only happen when using security.

    Christophe

  11. Posted March 12, 2009 at 6:55 pm | Permalink

    Thanks Christophe. Adding a no-arg constructor to the ProductDAO fixed the problem.

    -James

  12. Cameron Collins
    Posted March 12, 2009 at 10:36 pm | Permalink

    Brilliant! After getting over the Spring curve (the test drive was essential to get over the summit) every thing is running smooth. Now I’m geeking out on Spring.

    >Cameron

  13. Posted March 15, 2009 at 1:26 pm | Permalink

    Thanks you…

  14. Rossen
    Posted March 15, 2009 at 5:43 pm | Permalink

    If the ProductDAO were to implement an interface for the methods being intercepted for security resons – in this case “find*”, then Spring AOP would use JDK dynamic proxies instead of CGLIB. A simple way to do that is to rename the ProductDAO to JdbcProductDAO and use ProductDAO as the interface.

    Rossen

  15. Mohammed
    Posted March 16, 2009 at 2:16 am | Permalink

    Many thanks Christophe,
    the test drive is working well with me. Only I faced problems when starting developing my own application based on your code. Fighting for more than 8 hours I got it work but when using usecured services. Unfortunately, I got the following error when I press the “Get Data” button calling a secured service method:

    faultCode:Server.Processing faultString:’No destination with id ’securedCubeService’ is registered with any service.’ faultDetail:’null’

    What did I do wrong? Another wondering is how you pointed to the service-config.xml? I see that you used own empty testdrive-servlet in the web.xml.
    Peace!
    Mohammed

  16. Posted March 17, 2009 at 5:00 pm | Permalink

    Thanks you…

  17. Rahul
    Posted March 20, 2009 at 10:30 am | Permalink

    Hi Christophe,
    I am new to flex. I am trying out a simple HelloWorld sample for BlazeDs integration with Spring which is accessed from Flex client. I have declared the remoting as mentioned below in file web-application-config.xml, but somehow flex client is not able to access the service.

    The code for flex client looks like following.

    ?xml version=”1.0″ encoding=”utf-8″?>

    web.xml – In this file I have declared dispatcher servlet, context-param and ContextListener.
    helloworld-servlet.xml – only namespace declaration. No spring beans declared in this file.
    WEB-INF/conf/web-application-config.xml – Declares Service bean and tags for exposing the service through BlazeDS.

    Am I missing something? Please help.
    Thanks and Regards,
    Rahul

  18. Posted March 31, 2009 at 3:27 am | Permalink

    will follow it,and firmly study;you are great Christophe

  19. anil
    Posted April 1, 2009 at 4:40 am | Permalink

    There is some issues with the zip archive file.
    Please check it.

  20. Alex
    Posted April 3, 2009 at 2:36 pm | Permalink

    This is fantanstic!

    Thanks a million.
    Alex

  21. tang
    Posted April 7, 2009 at 12:52 am | Permalink

    thanks….
    I am learning…

  22. Sergey RUS
    Posted April 7, 2009 at 2:47 pm | Permalink

    ТО christophe:
    Download blazeds dev guide, there is full tutorial about integration with tomcat.

  23. Sergey RUS
    Posted April 7, 2009 at 2:51 pm | Permalink

    Why there is no spring-flex dependencies in maven =(

  24. Sergio
    Posted April 9, 2009 at 7:18 am | Permalink

    ТО christophe: Which jdk version are you using? Cause i am using jdk 1.6u13 and when i compile the java source code the application stop working, then i have to copy the .class from yours project to mine and then it work´s again. Any idea?

  25. Jay Mann
    Posted April 10, 2009 at 9:22 am | Permalink

    This is excellent! Thanks Christophe.

    only problem is i loaded up your source code in eclipse and i get the error
    “Could not generate CGLIB subclass of class” for the securedProductService.

    It seems your source code in the zip for ProductDAO is missing the default no parameter constructor, but your class file has it.

    Also is there a way to make the bean stateful ie. scope=”session”

    Thanks,

    -J

  26. Posted April 21, 2009 at 8:52 am | Permalink

    I want to gain access to zip file content and display that content in a AIR application. From my research I have found that I’ll need to use a remote object to use for my needs a Java zipfile class, Ruby & .Net also have zipfile api but for now I’m using Java. My question can I use this Spring/BlazeDS integration in a desktop application.

    BlazeDS is for a web application, well any ideas.

    Thanks for any help

    James

  27. kwame
    Posted May 2, 2009 at 3:15 am | Permalink

    Hello Christophe,
    Your tutorial is very nice,
    1) but how do you resolve the problem of hibernate lazy-loading feature with SBI?
    Can you give me a step by step example?

    2)Are there tools (integrated with SBI) to generate as3 model entities from the entity beans?

  28. Chris
    Posted May 11, 2009 at 1:33 pm | Permalink

    There is a project called Gilead which will clean the bytecode instrumentation data out of your beans that were loaded from hibernate before sending to your flex client and re-insert this data upon return from the flex-client.

  29. francois
    Posted May 31, 2009 at 9:38 am | Permalink

    Hi, sorry for my english, I’m french so…

    I’m developping an application with Flex/BlazeDS/JEE.
    I watch your samples, but there is something I can’t understand.
    If I use BlazeDS, I use simples Services Classes for connect the Flex interface and the backoffice. But how I can to recup the login of the current user without the Object HTTPRequest ?

    I understand how I can to securize my service, but if by example the service give the user messages, how I can know witch user is without HttpRequest ?

  30. tim_lee
    Posted July 29, 2009 at 6:46 am | Permalink

    Congrats… you are doing a great job. Could you please respond to the following query?

    Our flex client needs to invoke server side spring bean. For each module we have seperate spring service bean.

    Whether it is best to have separate flex end point (remote object) to each spring bean to invoke methods or to create a single facade spring bean as an endpoint and invoke other spring bean methods through this facade bean.

    Whether creating multiple flex end points increases the performance or its an expensive process?

    Thanks in advance.

  31. Posted August 18, 2009 at 3:00 pm | Permalink

    Ого! Большое спасибо! Теперь на целый день есть работа! :)

  32. Posted October 18, 2009 at 12:28 pm | Permalink

    Я никогда не сомневался в Вашем интеллектуальном уровне, но поймите, не все такие как Вы. :)

  33. Posted February 22, 2010 at 6:46 am | Permalink

    Hi Chris,

    I am new to flex so am confused the interaction of flex with spring.Can you please let me know how do we send request from flex to spring layer and how do we handle exception.

    Thanks
    Pawan

  34. Jim
    Posted March 11, 2010 at 8:40 am | Permalink

    Lovely, everything works like a charm. Helped my a lot when starting with Flex integration on an existing Spring application. Thank you!

    Regards,

    Jim.

4 Trackbacks

  1. By Download the Flex and Spring Integration Refcard on April 6, 2009 at 10:44 am

    [...] Another great resource for learning how to integrate Flex and Spring is Christophe Coenraets’ Spring BlazeDS Integration Test Drive. It contains a bunch of great examples that will help you better understand how to get everything [...]

  2. By Flex with Java « Aditya’s Blog on April 23, 2009 at 1:33 pm
  3. [...] from Adobe has just updated his excellent set of Spring BlazeDS Integration samples for M2 here Tagged with: [ blazeds, flex, spring ] You can follow any responses to this entry through the [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>