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

45 Responses to Spring/BlazeDS Integration Test Drive: M2 Update Available

  1. Andy.Liu March 11, 2009 at 10:47 am #

    So cool!
    Thank you for your nice example.

  2. shree March 11, 2009 at 11:28 am #

    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 March 11, 2009 at 1:00 pm #

    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 March 11, 2009 at 1:32 pm #

    Great! Thanks.

  5. Prashanth March 11, 2009 at 2:06 pm #

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

  6. Derek S March 11, 2009 at 3:40 pm #

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

  7. Prashanth March 11, 2009 at 3:41 pm #

    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 March 11, 2009 at 5:36 pm #

    excellent work! SB

  9. James Ward March 12, 2009 at 1:00 pm #

    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. Christophe March 12, 2009 at 3:24 pm #

    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. James Ward March 12, 2009 at 6:55 pm #

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

    -James

  12. Cameron Collins March 12, 2009 at 10:36 pm #

    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. cinsel sohbet March 15, 2009 at 1:26 pm #

    Thanks you…

  14. Rossen March 15, 2009 at 5:43 pm #

    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 March 16, 2009 at 2:16 am #

    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. araç sorgulama March 17, 2009 at 5:00 pm #

    Thanks you…

  17. Rahul March 20, 2009 at 10:30 am #

    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. draco March 31, 2009 at 3:27 am #

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

  19. anil April 1, 2009 at 4:40 am #

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

  20. Alex April 3, 2009 at 2:36 pm #

    This is fantanstic!

    Thanks a million.
    Alex

  21. tang April 7, 2009 at 12:52 am #

    thanks….
    I am learning…

  22. Sergey RUS April 7, 2009 at 2:47 pm #

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

  23. Sergey RUS April 7, 2009 at 2:51 pm #

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

  24. Sergio April 9, 2009 at 7:18 am #

    ТО 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 April 10, 2009 at 9:22 am #

    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. James Lopes April 21, 2009 at 8:52 am #

    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 May 2, 2009 at 3:15 am #

    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 May 11, 2009 at 1:33 pm #

    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 May 31, 2009 at 9:38 am #

    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 July 29, 2009 at 6:46 am #

    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. Артур August 18, 2009 at 3:00 pm #

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

  32. Григорий October 18, 2009 at 12:28 pm #

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

  33. Pawan Gupta February 22, 2010 at 6:46 am #

    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 March 11, 2010 at 8:40 am #

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

    Regards,

    Jim.

  35. Daniel May 7, 2010 at 4:27 am #

    Could I use this integration in test-drive-m2 without ROOT tomcat container ? My app not estabilish a conection with the service remote, I don’t know why, but tomcat start very well .. Somebody help me?

  36. Barani Kumar V July 11, 2010 at 5:56 am #

    Hi Christophe Coenraets,
    I am Barani Kumar .
    I am using flex_test_drive ,all example programe is working fine
    I am created one more class (Department , DepartmentDAO,IDepartmentDAO) and I have added service in config/web_application…xml
    Its not accepting destination , when try run application its throws exception like destination id not found

    Tell me how to use tomcat and service

  37. Ben Jones March 2, 2011 at 8:13 am #

    I’m impressed, I must say. Rarely do I find a blog that’s both educative and entertaining, and let me tell you, you have hit the nail on the head. Your thoughts are outstanding.

  38. t5 slimming pills April 4, 2011 at 8:13 am #

    Great article, very well thought out and put together keep up the good work.

  39. Salini September 12, 2011 at 5:57 am #

    Is there any way to remove put the Remoteobject endpoint attribute some where else other than hardcoding the same in flezx application

  40. Hidayath July 18, 2013 at 2:07 am #

    Hi Christophe, wonderful sample!!!

    We have problem with tomcat 7 and BlazeDS 4

    Could you please make it for Tomcat 7? Thanks a lot

Trackbacks/Pingbacks

  1. Download the Flex and Spring Integration Refcard - April 6, 2009

    […] 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. Flex with Java « Aditya’s Blog - April 23, 2009

    […] http://coenraets.org/blog/2009/03/springblazeds-integration-test-drive-m2-update-available/ […]

  3. Integrating Spring with BlazeDS on TOMCAT « Aditya’s Blog - April 29, 2009

    […] http://coenraets.org/blog/2009/03/springblazeds-integration-test-drive-m2-update-available/ […]

  4. RC1 of Spring BlazeDS Integration is Available | ITHighlight.Com - May 7, 2009

    […] 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 […]

  5. What is generated in MyEclipse 8.6 Spring Flex Scaffolding? | Genuitec - August 29, 2014

    […] spring-flex-testdrive conventions including, an Event driven action script architecture for created, updated, and deleted […]

Leave a Reply

css.php