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.











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……
Great work!! Thanks
[...] 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. [...]
I am interested in Flex. It will be nice if Adobe could provide Developer only edition of Flex Data Services.
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
Great work.thank u .
Example 8 is throwing ConcurrencyExceptions all over the place.
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
[...] 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. [...]
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
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.
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.
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…
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…
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)
…
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.
Thanks!
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
Do you have an example where we store data in the session object so that we can use them in later requests
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?
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
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!
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.
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?
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.
I don’t open the testdrive.war
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
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
oof, it ate the xml tags
idle-timeout-minutes 20 idle-timeout-minutes
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?
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?
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.
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.
Cialis st….
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.
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.
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.
ㅇㅇㅇ
Buy rohypnol….
Epharmacywatch com where to buy rohypnol please. Buy rohypnol….
Seroquel xr….
Seroquel xr….
Great work.thank u .
thanks a lot ;)…
teşekkürker ;)
Thanks a lot
thanks you very good
very nice
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….
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?