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.

80 Responses to 30 minutes Flex test-drive for Java developers

  1. Dreamer September 5, 2006 at 6:20 pm #

    Great work!! Thanks

  2. Kris September 6, 2006 at 2:07 pm #

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

  3. christophe September 6, 2006 at 2:22 pm #

    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 September 6, 2006 at 11:07 pm #

    Great work.thank u .

  5. J September 6, 2006 at 11:58 pm #

    Example 8 is throwing ConcurrencyExceptions all over the place.

  6. christophe September 7, 2006 at 5:40 am #

    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 September 8, 2006 at 11:10 am #

    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. James Webster September 9, 2006 at 6:55 am #

    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 September 9, 2006 at 10:03 am #

    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 September 9, 2006 at 6:51 pm #

    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 September 10, 2006 at 9:14 am #

    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. Tore September 11, 2006 at 3:32 am #

    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 September 12, 2006 at 6:44 am #

    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. Chris September 18, 2006 at 2:15 am #

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

    Thanks!

  15. Rui September 19, 2006 at 11:18 am #

    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 September 26, 2006 at 2:08 am #

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

  17. Anthony September 29, 2006 at 12:00 pm #

    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 October 5, 2006 at 12:54 am #

    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 October 22, 2006 at 11:32 am #

    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 November 2, 2006 at 12:01 pm #

    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 November 13, 2006 at 8:43 am #

    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 November 22, 2006 at 1:06 pm #

    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 December 3, 2006 at 10:44 pm #

    I don’t open the testdrive.war

  24. Erich December 11, 2006 at 10:47 am #

    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 December 11, 2006 at 12:51 pm #

    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 December 11, 2006 at 1:05 pm #

    oof, it ate the xml tags

    idle-timeout-minutes 20 idle-timeout-minutes

  27. Barry December 29, 2006 at 2:57 pm #

    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 December 29, 2006 at 6:50 pm #

    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 January 12, 2007 at 6:58 am #

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

    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. Frederikke Zenobia July 4, 2007 at 11:15 pm #

    Youre really losing i. Frederikke Zenobia.

  32. ohcewwjwxq July 6, 2007 at 8:34 am #

    Hello! Good Site! Thanks you! kreazjfflfbhuw

  33. Olufunke Joby July 14, 2007 at 1:18 am #

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

  34. Doru Hendrikje July 22, 2007 at 2:01 pm #

    Come and keep your comrade warm Doru Hendrikje.

  35. Jason September 17, 2007 at 9:49 am #

    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. Essa Morty September 19, 2007 at 9:51 am #

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

  37. codebrain October 20, 2007 at 11:47 pm #

    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. Masood Garfield October 21, 2007 at 12:28 pm #

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

  39. secretboy February 10, 2008 at 7:15 pm #

    great post.thanx.keep up the good work.

  40. Mi-Song March 18, 2008 at 4:44 am #

    ㅇㅇㅇ

  41. sohbet August 22, 2008 at 5:13 pm #

    Great work.thank u .

  42. chat August 22, 2008 at 5:14 pm #

    thanks a lot ;)…

  43. çet August 22, 2008 at 5:14 pm #

    teşekkürker ;)

  44. webmaster August 28, 2008 at 10:46 pm #

    Thanks a lot

  45. chat August 28, 2008 at 10:48 pm #

    thanks you very good

  46. mirc August 28, 2008 at 11:36 pm #

    very nice

  47. lapto battery November 20, 2008 at 9:18 pm #

    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. pırlanta August 22, 2009 at 2:48 pm #

    thank you for this topic.

  49. .net September 26, 2009 at 8:51 am #

    thats really so interesting…

  50. kapalı çarşı September 26, 2009 at 8:52 am #

    yes i think so.

  51. kalıp September 26, 2009 at 8:53 am #

    yes so so.!

  52. hırdavat September 26, 2009 at 8:54 am #

    Awesome samples! I too am trying it out with JBoss

  53. makina September 26, 2009 at 8:55 am #

    yes so…

  54. fenerbahçe September 26, 2009 at 8:55 am #

    when??

  55. canlı tv September 26, 2009 at 8:56 am #

    yes that s really good…

  56. eczane September 26, 2009 at 8:57 am #

    i dont like so much…

  57. msn 9 September 30, 2009 at 9:39 am #

    thank you for this topic

  58. alyans dunyasi November 5, 2009 at 4:58 am #

    great sharing…

  59. alyans dunyasi November 5, 2009 at 5:03 am #

    great video thanks…

  60. Program Yükle November 29, 2009 at 6:33 am #

    ooo good admin thank you

  61. sohbet December 8, 2009 at 11:11 am #

    great video

  62. ninjaproxy December 8, 2009 at 11:12 am #

    i dont like so much…

  63. ethan December 24, 2009 at 10:10 am #

    I love the style of the look and feel, but I don’ t like the coding style with flex, too much properties and tags,

  64. matbaa August 8, 2010 at 7:44 am #

    great video thanks…

  65. kablo tv October 9, 2010 at 12:15 pm #

    thats good very well

  66. bursa evden eve November 23, 2010 at 2:36 pm #

    awsome video, great resource

  67. takım çelikleri April 10, 2011 at 8:00 am #

    yes !!

  68. kalıp April 10, 2011 at 8:01 am #

    kalıp bizim işimizdir

  69. maviajansmatbaa September 16, 2011 at 11:39 am #

    really liked your presentation on QCON a few weeks ago. I could really tell you are very good at what you do. My compliment for that.

    I have a question though: I some environments like banks etc Flash plugin is disabled in the browser (security wise). How can we still use this technology wit

  70. dlyanic September 17, 2011 at 4:50 am #

    I think this is one of the most important info for me. And i’m glad reading your article. But should remark on few general things, The site style is perfect, the articles is really great : D. Good job, cheers

  71. Shirlee Muse October 23, 2011 at 3:53 pm #

    The embedded video shows some lame 101 uses to get a Wedding dress piece.

  72. Motrat Mustafa muzike December 27, 2011 at 5:24 pm #

    My spouse and i still can’t quite think that I could often be one of those studying the important points found on your site. My family and I are seriously thankful for the generosity and for presenting me possibility pursue the chosen career path. Thanks for the important information I acquired from your website.

  73. イザベルマラン September 15, 2013 at 3:12 am #

    価格範囲 など $60 Sketchers に イザベル marant $300 バージョン。 機能 拡張可能な側面 使用できる とき、より多くを必要とする ルーム。再生回数回 は いくつか 上、非常に最高
    され、に、快適な とスタイリッシュな、側 は に、定式化、華やかな
    側。 彼らは可能性があります を 探して 美しい特に とき 身に着けて 、 夏サンドレス。

Trackbacks/Pingbacks

  1. Matt Chotin - September 5, 2006

    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. MadeInFlex » Blog Archive » Test-drive para desarrolladores Java - September 6, 2006

    [...] 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. Architect’s Linkblog » Blog Archive » 11 Links for 9/7/06 - September 7, 2006

    [...] 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. Cialis st. - June 7, 2007

    Cialis st….

    Cialis st….

  5. Buy rohypnol. - July 12, 2008

    Buy rohypnol….

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

  6. Seroquel xr. - July 19, 2008

    Seroquel xr….

    Seroquel xr….

  7. Free gay italian teen galleries. - September 8, 2008

    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….

Leave a Reply