Debug Server/Client LCDS Java Helloworld in Flex Builder


Install Flex Builder
Install LCDS Data Services
Install WTP in Flex Builder

Here’s a simple project that shows you how to create a simple Hello World for Flex + Java via LCDS. I’ll also show you how to debug the server [java] code as we move along.

File->New->Flex Project

  • For application server type select J2EE
  • User remote object access
  • LiveCycle Data Services
  • Create combined Java/Flex project using WTP
  • 01 Setup

    Select the target runtime. You will need to click ‘New’ to create one if none are available.

    02 Server

    Create a new target runtime if needed.

    03 Tomcat

    04 Tomcat

    05 Server

    Be sure to change your Output URL to match the LCDS [tomcat] config (defaults to 8400)
    06 Setup


    Again, make sure the URLs are using the correct port

    07 Debug Server

    Project->Properties->Flex Server

    08 URL Context

    Okay, are setup is complete now we’re ready to code.

    Here’s the MXML

    <mx:Application xmlns:mx="" layout="absolute">

    import mx.controls.Alert;

    private function sayHello():void

    private function onFault(event:FaultEvent):void

    private function onSayHelloToResult(event:ResultEvent):void
    { as String);


    <mx:RemoteObject id="testService" fault="onFault(event)" destination="helloDest">
    <mx:method name="sayHelloTo" result="onSayHelloToResult(event)"/>

    <mx:TextInput id="txtName" x="10" y="10"/>
    <mx:Button click="sayHello()" x="178" y="10" label="Go"/>

    Note the destination=”helloDest” line, we’ll have to configure a LCDS destination with this name in a few steps…

    Create a simple java class to test against:

    public class HelloWorld {
    	public String sayHelloTo(String name)
    		return "Hello " + name;

    And finally, we need to setup the destination

    To do so, edit \WebContent\WEB-INF\flex\remoting-config.xml, adding the following

    <destination id="helloDest">

    That’s it, now we are ready to test.

    Set a breakpoint on the on ‘return “Hello ” + name;‘ line in you’re java code.

    Launch the server in debug mode

    09 Server

    Now, launch the flex app [in debug mode if you want to debug the front end as well].

    Type your name in the input box and click ‘Go.’

    You’ll see your breakpoint being caught, both server [java] side and client side 🙂

    Flex Project Archive

    Install WTP in Flex Builder

    A quick walkthrough on installing the Web Tools Platform (WTP) in Flex Builder.

    Help->Software Updates->Find and Install

    Help Software Update

    Search for new features to install

    Search for New

    Select the [Europa] discovery site


    Select ‘Web and JEE development’

    You may need to click ‘Select Required’