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.

  • Pingback: Matt Chotin()

  • Great work!! Thanks

  • Pingback: MadeInFlex » Blog Archive » Test-drive para desarrolladores Java()

  • Kris

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

  • christophe

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

  • flybart

    Great work.thank u .

  • J

    Example 8 is throwing ConcurrencyExceptions all over the place.

  • christophe

    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.

  • Pingback: Architect’s Linkblog » Blog Archive » 11 Links for 9/7/06()

  • Ravisekhar Kopparthi

    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.


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

  • christophe

    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.

    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.

  • Mike

    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…

  • Daniel

    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, i.e., Flex 2 apps will not run on Linux. Why build applications for the web and only support Win/Mac? Great article though…

  • 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?

    at flex.messaging.MessageBrokerServlet.getFlexWritePath(MessageBrokerSer
    at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:92
    at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(St

  • andrew

    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.

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


  • Rui

    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

  • Ray

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

  • Anthony

    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?

  • Bharat

    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

  • Juliet

    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?


  • Maximiliano

    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.

  • Janet

    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?

  • Dave

    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.

  • loner

    I don’t open the testdrive.war

  • Erich


    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
    at sun.nio.ch.WindowsSelectorImpl$SubSelector.processFDSet(WindowsSelect
    at sun.nio.ch.WindowsSelectorImpl$SubSelector.processSelectedKeys(Window
    at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$2600(WindowsSelecto
    at sun.nio.ch.WindowsSelectorImpl.updateSelectedKeys(WindowsSelectorImpl
    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
    at java.lang.Thread.run(Thread.java:534)


  • Erich

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


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


  • Erich

    oof, it ate the xml tags

    idle-timeout-minutes 20 idle-timeout-minutes

  • Barry

    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?

  • Barry

    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?

  • shruthi

    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.

  • fazil

    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,

  • Pingback: Cialis st.()

  • Youre really losing i. Frederikke Zenobia.

  • Hello! Good Site! Thanks you! kreazjfflfbhuw

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

  • Come and keep your comrade warm Doru Hendrikje.

  • Jason

    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

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

  • codebrain

    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.

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

  • great post.thanx.keep up the good work.

  • Mi-Song


  • Pingback: Buy rohypnol.()

  • Pingback: Seroquel xr.()

  • Great work.thank u .

  • thanks a lot ;)…

  • teşekkürker ;)

  • Thanks a lot

  • thanks you very good

  • very nice

  • Pingback: Free gay italian teen galleries.()

  • 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?

  • thank you for this topic.

  • thats really so interesting…

  • yes i think so.

  • yes so so.!

  • Awesome samples! I too am trying it out with JBoss

  • yes so…

  • when??

  • yes that s really good…

  • i dont like so much…

  • thank you for this topic

  • great sharing…

  • great video thanks…

  • ooo good admin thank you

  • great video

  • i dont like so much…

  • ethan

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

  • great video thanks…

  • thats good very well

  • awsome video, great resource

  • yes !!

  • kalıp bizim işimizdir

  • 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

  • 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

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

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

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

  • Güzel çalışma ellerinize sağlık Başarılarının devamını dilerim

  • güzel çalışmalar elinize sağlık arkadaşlar


  • Very niceee

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


  • You can order by phone or email to our company. At your service 6 days a week for your orders and questions.

  • Oladejo Joshua Jay
  • yuvaraj singh

    Thanks for sharing this informative content ,
    Leanpitch provides online training in Devops during this lockdown period everyone can use it wisely.
    Devops Online Training