30 minutes Flex test-drive for Java developers

Flex is being adopted by many Java shops, ISVs and OEMs to build applications inside and outside the firewall. However, I also realize that there are still many Java developers who are unfamiliar with Flex, and sometimes have misconceptions about the product. Flex integrates particularly well with Java back-ends, and the feedback from Java developers who have tried the product has consistently been excellent.

One problem is that there are dozens of new products we could try every single day, but we only have so much time… So, with all that in mind, I wrote this 30 minutes test-drive to give Java developers an understanding — with a minimal time commitment — of how Flex works and what it can do: all you have to do is deploy a WAR file in Tomcat or a J2EE application server of your choice. The samples focus primarily on using Flex with a Java back-end. The intended audience is Java developers with no prior knowledge of Flex.

Don’t hesitate to post your questions/comments and any suggestion you have to improve this test-drive. Thanks!

UPDATE (1/12/2007): I put together a Tomcat-based Test Drive Server that includes this Test Drive running out-of-the box. Read this post for more info.

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

63 Comments

  1. Posted September 5, 2006 at 6:20 pm | Permalink

    Great work!! Thanks

  2. Kris
    Posted September 6, 2006 at 2:07 pm | Permalink

    I am interested in Flex. It will be nice if Adobe could provide Developer only edition of Flex Data Services.

  3. christophe
    Posted September 6, 2006 at 2:22 pm | Permalink

    Kris,
    As indicated in the test-drive, FDS express is free for development and deployment on one CPU. (The Flex SDK is free for any kind of deployment).
    Christophe

  4. flybart
    Posted September 6, 2006 at 11:07 pm | Permalink

    Great work.thank u .

  5. J
    Posted September 6, 2006 at 11:58 pm | Permalink

    Example 8 is throwing ConcurrencyExceptions all over the place.

  6. christophe
    Posted September 7, 2006 at 5:40 am | Permalink

    J,
    Were you trying to modify the product id? The way the back-end component (ProductService.java) is written doesn’t allow the primary key to be changed. However, the bare-bone client application did allow you to change it. That’s why the server component was throwing a ConcurencyException (see ProductService.java) when it got a product id change. I made the change to prevent the modification of the product id in the client app and updated the war file.
    Christophe

  7. Ravisekhar Kopparthi
    Posted September 8, 2006 at 11:10 am | Permalink

    I tried to deploy it on tomcat 5.0.30 and got this error

    Sep 7, 2006 10:04:54 PM org.apache.catalina.startup.HostConfig deployWARs
    WARNING: Exception while expanding web application archive testdrive.war

    Also I am not able to unzip the war file for tomcat deployable .war file.

    Thanks
    Ravi

  8. Posted September 9, 2006 at 6:55 am | Permalink

    I am having the same problem as Ravi. Is the .war being served up with correct MIME-Type as I cannot extract or list the archive via ‘jar -xvf testdrive.war’ from the command line, or deploy it into Tomcat.

  9. christophe
    Posted September 9, 2006 at 10:03 am | Permalink

    Ravi and James,
    I initially tested the war on Tomcat 5.5. Based on your comments, I tried on 5.0.30. The problem comes from the configuration of JOTM in META-INF\context.xml: the UserTransaction configuration changed in Tomcat 5.5, and the 5.5-based config.xml in testdrive.war prevented the application from deploying on Tomcat 5.0.x. I added a version of testdrive.war on the testdrive page with a config.xml suited for Tomcat 5.0.x. Please delete testdrive.xml in conf\Catalina\localhost before deploying this version. Let me know if this fixes your problem.
    Thanks,
    Christophe

    More context: Note that the Flex Data Management Services leverage JTA and therefore require an implementation of JTA in your app server. If you are using an application server that implements the full J2EE stack, you are all set because you already have an implementation of JTA. JOTM is only used in the Tomcat versions of testdrive.war to add JTA support to Tomcat.

  10. Mike
    Posted September 9, 2006 at 6:51 pm | Permalink

    So how does flex differ from Lazlo. Although I find the UI rendering and effects quite cool, how can it interact with things outside the flash container – Entrust Applets, smart cards, other page elements etc…

  11. Daniel
    Posted September 10, 2006 at 9:14 am | Permalink

    Flex might be great, but Flex 2 requires that you have Flash Player 9 installed on your computer. The latest version of FP on Linux is 7.0.63.0, i.e., Flex 2 apps will not run on Linux. Why build applications for the web and only support Win/Mac? Great article though…

  12. Posted September 11, 2006 at 3:32 am | Permalink

    Hi,
    The testdrive.war doesn’t deploy on WebLogic Server 9.2, see error message below.

    Javadoc says your getRealPath() call is not valid when served from a .war file?

    (File.java:194)
    at flex.messaging.MessageBrokerServlet.getFlexWritePath(MessageBrokerSer
    vlet.java:232)
    at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:92
    )
    at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(St
    ubSecurityHelper.java:276)

  13. andrew
    Posted September 12, 2006 at 6:44 am | Permalink

    This worked great for me on tomcat 5.0.X – nice work! The problem I ran into is that it is not clear what aspects of the demo belong to FDS and the demo. It would be nice to have a skeleton app as a starting point for building a new FDS application (e.g. libraries, config files etc.). I couldn’t find this in the FDS install or anywhere for that matter.

  14. Posted September 18, 2006 at 2:15 am | Permalink

    Deployed here on Glassfish no problems, some great examples to go thru.

    Thanks!

  15. Rui
    Posted September 19, 2006 at 11:18 am | Permalink

    Thank you Chris. You did a great job for us, who are starting up.
    I noticed:
    1. your intro-page only shows links to the first 8 samples, for some reason the browser is lacking scroll bars…

    2. JBoss-4.0.4.GA shows an error at startup of testdrive, saying
    [ERROR] org.apache.catalina.core.ApplicationContext
    log INFO: FlexMxmlServlet: Starting Adobe Flex Web Tier Compiler. But all samples function OK.

    3. The samples using the Data Messaging Service, will only run on the PC where the server runs, all other PCs on our network will only see the application, but no data! (e.g.samples 6,7 and 8)

    Somehow I’m not configuring something the right way … Can you give me a hint?

    Thankx again,
    Rui Rosado

  16. Ray
    Posted September 26, 2006 at 2:08 am | Permalink

    Do you have an example where we store data in the session object so that we can use them in later requests

  17. Anthony
    Posted September 29, 2006 at 12:00 pm | Permalink

    I am trying to use the example as a basis to send messages from an EJB3 TimerService callback (in JBoss) and cannot get a reference to the MessageBroker (returns null).

    Is there any way to access the MessageBroker from the EJB container?

  18. Bharat
    Posted October 5, 2006 at 12:54 am | Permalink

    Hi Christophe,

    I am new to flex and wen services

    I have one problem with Sample2 i.e SampleWebService.mxml.

    In this example you have used web service to populate DataGrid in flex.

    My problem is that : what is returned by your web service to flex ??

    what have you used in web service .jsp page or servlet??

    could you please explain web service code…

    waiting for your reply
    Thank You
    Bharat

  19. Juliet
    Posted October 22, 2006 at 11:32 am | Permalink

    I tried your testDrive and it is a very nice UI interactive experince.

    Only one drawback I noticed is each time loading the page the client side CPU reaches to over 90%.

    Is this a known issue for flex?

    Thanks!

  20. Maximiliano
    Posted November 2, 2006 at 12:01 pm | Permalink

    Great examples & great work Christophe.
    flex 2 rocks!
    I think that FDS is very expensive except for FDS Express (for free).

    Can you explain the localization mechanism? the localization of my application messages and the components of the framework (validators, etc…)

    Thanks you in advance.

  21. Janet
    Posted November 13, 2006 at 8:43 am | Permalink

    Hey I’m trying to run the demo in JDeveloper. I can run sample 1 & 2 with no problem, but after that things don’t seem to be working. On 3 i get this error when i hit the ‘get data’ button:

    [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 500"]at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()at mx.rpc::Responder/fault() at mx.rpc::AsyncRequest/fault()at mx.messaging::ChannelSet/::faultPendingSends()at mx.messaging::ChannelSet/channelFaultHandler()at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()at flash.events::EventDispatcher/dispatchEvent()at mx.messaging::Channel/mx.messaging:Channel::connectFailed()at mx.messaging.channels::PollingChannel/mx.messaging.channels:PollingChannel::connectFailed()at mx.messaging.channels::AMFChannel/mx.messaging.channels:AMFChannel::statusHandler()

    any ideas?

  22. Dave
    Posted November 22, 2006 at 1:06 pm | Permalink

    I’m more of a Flex developer trying to learn to use Java. I was looking at sample 8. It works when I run yours but if I try to compile the java classes (product, productassembler, etc.) it compiles OK for me but will not run. I get errors that the class (ProductAssembler) cannot be instantiated. Could you tell me what arguments you passed to the java compiler for sample 8.

  23. loner
    Posted December 3, 2006 at 10:44 pm | Permalink

    I don’t open the testdrive.war

  24. Erich
    Posted December 11, 2006 at 10:47 am | Permalink

    Hello,

    I’m seeing sample7 throw NPE inside of FDS after approximately 20 minutes of idle time. Is this expected, or something we should tune out? Is there a heartbeat/NOOP timer we can turn on to keep FDS conns alive?

    (note that no timestamp is printed with the NPE, but it happens approx 20 minutes after I connect with sample7)

    Dec 11, 2006 11:16:42 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 9487 ms
    java.lang.NullPointerException
    at sun.nio.ch.WindowsSelectorImpl$SubSelector.processFDSet(WindowsSelect
    orImpl.java:309)
    at sun.nio.ch.WindowsSelectorImpl$SubSelector.processSelectedKeys(Window
    sSelectorImpl.java:282)
    at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$2600(WindowsSelecto
    rImpl.java:245)
    at sun.nio.ch.WindowsSelectorImpl.updateSelectedKeys(WindowsSelectorImpl
    .java:427)
    at sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:142)

    at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:59)
    at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:70)
    at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:74)
    at flex.messaging.endpoints.rtmp.BaseNIORTMPServer.run(BaseNIORTMPServer
    .java:189)
    at java.lang.Thread.run(Thread.java:534)

    Thanks
    –Erich

  25. Erich
    Posted December 11, 2006 at 12:51 pm | Permalink

    Answering part of my own question, services-config.xml has this:

    20

    Boy, I’ve got lots of reading to do to figure out how all this stuff really plugs together…

    –Erich

  26. Erich
    Posted December 11, 2006 at 1:05 pm | Permalink

    oof, it ate the xml tags

    idle-timeout-minutes 20 idle-timeout-minutes

  27. Barry
    Posted December 29, 2006 at 2:57 pm | Permalink

    What are your options for getting data from the server in a J2EE app without using Flex Data Servises? Is RPC possible without FDS? Which of your samples in the test drive works without FDS?

  28. Barry
    Posted December 29, 2006 at 6:50 pm | Permalink

    I modified the CensusService.java file so that the performance axample will not be limited to 20,000 records (I just duplicate data if >20000 is requrested). I noticed that things bog down considerably for 1,000,000 records. It takes 20 seconds to generate the data and 3 minutes to render the table in flash (it is quite responsive to scroll once done rendering, however). I seem to recall reading that FDS supports implicit paging. Is it not enabled in this sample? How can I get it to work? Is explicit paging supported?

  29. shruthi
    Posted January 12, 2007 at 6:58 am | Permalink

    great example!!! its working fine with hsqldb.
    I want to change the DB to oracle i modified the ConnectionHelper.java file and related files to get the data from the oracle DB (i tried for appendixa example).the application is unable to connect to DB and giving the message
    [RPC Fault faultString="java.lang.UnsupportedClassVersionError : flex/testdrive/ConnectionHelper (Unsupported major.minor version 49.0)" faultCode="Server.Processing" faultDetail="null"]
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
    at mx.rpc::Responder/fault()
    at mx.rpc::AsyncRequest/fault()
    at ::NetConnectionMessageResponder/NetConnectionChannel.as$37:NetConnectionMessageResponder::statusHandler()
    at mx.messaging::MessageResponder/status()

    Could anyone please help me out with this…….

    thanks in advance.

  30. fazil
    Posted May 3, 2007 at 2:41 am | Permalink

    Hi ,

    I am trying to integrate the “Flex Data Management Services Tutorial for Java Developers
    By Christophe” with Jboss, but I am getting the following exception.
    [RPC Fault faultString="Unable to access UserTransaction in DataService." faultCode="Server.Processing" faultDetail="null"]
    at mx.data::ConcreteDataService/http://www.adobe.com/2006/flex/mx/internal::dispatchFaultEvent()
    at mx.data::CommitResponder/fault()
    at mx.rpc::AsyncRequest/fault()
    at ::NetConnectionMessageResponder/NetConnectionChannel.as$40:NetConnectionMessageResponder::statusHandler()
    at mx.messaging::MessageResponder/status()

    Please help me to fix this.

    Thanks and regards,
    Fazil.

  31. Posted July 4, 2007 at 11:15 pm | Permalink

    Youre really losing i. Frederikke Zenobia.

  32. Posted July 6, 2007 at 8:34 am | Permalink

    Hello! Good Site! Thanks you! kreazjfflfbhuw

  33. Posted July 14, 2007 at 1:18 am | Permalink

    I try to explain but you just dont understan. Olufunke Joby.

  34. Posted July 22, 2007 at 2:01 pm | Permalink

    Come and keep your comrade warm Doru Hendrikje.

  35. Jason
    Posted September 17, 2007 at 9:49 am | Permalink

    Awesome samples! I too am trying it out with JBoss (v4.2.1), and am getting the ‘Unable to access UserTransaction in DataService’ No luck in resolving it though. As far as I can tell, the transaction mgt service is running OK (in the log I see:
    12:46:44,221 INFO [TransactionManagerService] JBossTS Transaction Service (JTA version) – JBoss Inc.
    12:46:44,222 INFO [TransactionManagerService] Setting up property manager MBean and JMX layer
    12:46:44,406 INFO [TransactionManagerService] Starting recovery manager
    12:46:44,536 INFO [TransactionManagerService] Recovery manager started
    12:46:44,536 INFO [TransactionManagerService] Binding TransactionManager JNDI Reference
    )

  36. Posted September 19, 2007 at 9:51 am | Permalink

    they’ll have you suicidal,suicida. Essa Morty.

  37. codebrain
    Posted October 20, 2007 at 11:47 pm | Permalink

    Dear Chirstophe,

    Firstly thanks a lot for your test drive. I need something similar to sample 3. The product class/object contains another complex type how do I access it. Please help.

  38. Posted October 21, 2007 at 12:28 pm | Permalink

    oh we didn’t care,we made it very clea. Masood Garfield.

  39. Posted February 10, 2008 at 7:15 pm | Permalink

    great post.thanx.keep up the good work.

  40. Mi-Song
    Posted March 18, 2008 at 4:44 am | Permalink

    ㅇㅇㅇ

  41. Posted August 22, 2008 at 5:13 pm | Permalink

    Great work.thank u .

  42. Posted August 22, 2008 at 5:14 pm | Permalink

    thanks a lot ;)…

  43. Posted August 22, 2008 at 5:14 pm | Permalink

    teşekkürker ;)

  44. Posted August 28, 2008 at 10:46 pm | Permalink

    Thanks a lot

  45. Posted August 28, 2008 at 10:48 pm | Permalink

    thanks you very good

  46. Posted August 28, 2008 at 11:36 pm | Permalink

    very nice

  47. Posted November 20, 2008 at 9:18 pm | Permalink

    What are your options for getting data from the server in a J2EE app without using Flex Data Servises? Is RPC possible without FDS? Which of your samples in the test drive works without FDS?

  48. Posted August 22, 2009 at 2:48 pm | Permalink

    thank you for this topic.

  49. Posted September 26, 2009 at 8:51 am | Permalink

    thats really so interesting…

  50. Posted September 26, 2009 at 8:52 am | Permalink

    yes i think so.

7 Trackbacks

  1. By Matt Chotin on September 5, 2006 at 6:14 pm

    Flex Test Drive for Java Developers…

    Christophe has put together a 30-minute test drive for Java developers over on his blog. The goal is to give a quick intro to someone who is familiar with Java and doesn’t have a lot of time to invest. Check……

  2. [...] Test-drive para desarrolladores Java Si eres un desarrollador Java/J2EE, todavía no conoces Flex, o quizás no hayas tenido tiempo de probarlo, te aconsejo el siguiente post de Christophe Coenraets ( Adobe Flex Lead Evangelist ). En 30 minutos entenderás que es Flex y como se integra con tu backend de tu servidor de aplicaciones J2EE. [...]

  3. [...] Google Image Labeler: Collaborative Tagging Game – A new tool from Google to make image searching easier. Mostly it’s interesting for the approach of paying people to do a job that’s easy for humans but hard for computers (similar to Amazon’s Mechanical Turk and Distributed Proofreaders). Third-Party Testing: Risky Business? – Looks at two types of security tests (vulernability and penetration) and risks of each. No Bug Database – How about fixing bugs when they’re found instead of entering them into a database to rot? Testing: Coverage Reports Considered Dangerous – John Casey’s bad experience when relying on code coverage statistics to tell him if his unit tests were adequately testing his refactoring project. Finding Great Developers – Joel’s strategies for finding and recruiting top developers. 30 minutes Flex test-drive for Java developers – Christophe Coenraets from Adobe put together a demonstration of what Flex can do. It’s as simple as deploying a .war file in your favoirte J2EE app server. The Usual Suspects – An entertaining list of different types of “architects” you’ll run into (e.g. the PowerPoint architect, the Gartner Architect, the UML Architect). Wanting to become an MCA : Step 1 – Self Assessment and Step 2 – Filling in the forms – Simon blogs about his initial experiences with the MS Certified Architect application process. When “Near Enough” Isn’t – “Too often, the adequate blocks the best when it comes to problem solving.” The SOA Magazine – A new online magazine all about SOA, published bi-monthly. [...]

  4. By Cialis st. on June 7, 2007 at 10:57 am

    Cialis st….

    Cialis st….

  5. By Buy rohypnol. on July 12, 2008 at 7:18 pm

    Buy rohypnol….

    Epharmacywatch com where to buy rohypnol please. Buy rohypnol….

  6. By Seroquel xr. on July 19, 2008 at 4:02 pm

    Seroquel xr….

    Seroquel xr….

  7. By Free gay italian teen galleries. on September 8, 2008 at 4:39 am

    Candylist com free teen sex teen galleries nude….

    Free sex teen galleries. Free teen porn galleries. Free flat chested teen porn galleries. Free trixie teen photo galleries. Free teen foot club galleries. Free young teen sex galleries….

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>