Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

How to set up Eclipse for Flex / Java / LCDS projects

Avatar

Level 1

I've browsed through the LCDS documentation but found very little about how to actually set up Eclipse / Flash Builder to develop real LCDS applications where you write both Flex code (run on the client) and Java code (deployed to the server).

When creating a new project, there is a checkbox "Create combined Java/Flex project using WTP" (if you have WTP installed) which sounded promising but I honestly couldn't get it working. There was almost no documentation and if there was, it was misleading (see for instance "Using Flash Builder 4" where it says you always have to specify root folder and root URL - but these two settings are missing for combined Java/Flex projects). Also, when I started the default Tomcat server from withing FB, I could navigate to the final URL using my browser but it was only showing some HTTP 404 information (so the server was up and running but the bindings were somehow broken).

I eventually gave up and was looking for some other solution.


If you browse LCDS documentation, there are sections where they say something like "you now have to compile the .java file into a .class file and deploy it to your server" - and they give instructions on how to use 'javac' on command line. I guess that's not how the real development looks.

Right now, I'm thinking that maybe the right way is to create a Flex project for the client and Java project for the server (not J2EE project, just simple Java) and then somehow automate the process of deploying .class files (or compiling JAR file and deploying it).

What setup are you, experienced devs, using for real-world LCDS projects? And folks from Adobe, if you are listening, some documentation on the actual tooling around server-side development would be more than welcome. I found some hints in this article: http://www.adobe.com/devnet/livecycle/articles/data_management_apps.html but there should be more, much more.

Thanks,

Borek

4 Replies

Avatar

Level 2

Here are 2 good articles that can get you started on setup of a LCDS/Flex/WTP project and debugging. The first article is titled, "Creating a combined Flex/Java project in Flex Builder w/o LCDS/BlazeDS" by Mihai CORLAN.  Do not be fooled by the title, it does show how to setup the project with BlazeDS or LCDS.

Avatar

Level 1

I have seen these links before, tried to followed the instructions from the first article but with no success (the problem about resource could not be found was reported by several other folks in the comments). Mihai seems to be responding so I might try again and ask about specific problems as I encounter them.

So, kasmit, is the combined project the recommended route? What if the server and client code are written by different teams? Wouldn't it be better to have the Java project separate? If so, are there any guidelines on how to actually setup Eclipse to support this? Anyone can share their experience?

Thank you very much,

Borek

Avatar

Level 2

I think the simplest way to work with Flex, Java, and LCDS in Eclipse is by creating an Eclipse Java project and then adding a Flex Project to it. This will let you work in the single project and use the Flash perspective (Flash Builder) for your LCDS client code and the Java perspective for your  Java code. I don't think you need to go the WTP route. You DO need to use the Flash Builder plug-in rather than Flash Builder stand-alone.

Here's the basic process:

1. Create a Java project in Eclipse.

2. In your Java project, you can optionally set the output location to be a linked directory in your LCDS web app. For example, maybe you want to save POJO classes in the WEB-INF/classes directory of your web application. This is an option when you configure the source and output directories for your project:

  - Select the Allow Output Folders For Source Folders option when configuring your project.

  - Select Browse next to the Default Output Folder field.

  - Select the project directory name. Select Create New Folder.

  - Select Advanced > Link To Folder In File System.

  - Browse to the location where you want to save output and click OK.

Similarly, if you will be exporting your output to a JAR file, you can save the JAR file to the WEB-INF/lib directory of your LCDS web application.

3. In the Package Explorer, right click the name of your new Java project, and select Add/Change Project Type and then select Add Flex Project.

4. Set up your Flex J2EE/LCDS project just as you normally would.

Now when you toggle between the Java and Flash perspectives, you can work on your Java and Flex code in the same project. When you build your Java project, the output will go in whatever output directory you defined, such as lcds_root/tomcat/webapps/lcds-samples/WEB-INF/classes.

The Using LCDS doc describes how you can also link your config files into your Flex project to make it easy to define your destinations, etc. from Flash Builder. It is covered here:

http://help.adobe.com/en_US/LiveCycleDataServicesES/3.1/Developing/WSc3ff6d0ea77859461172e0811f00f6e...

Avatar

Level 1

Thanks for your response. I currently use a similar setup, just have the Java and Flex projects as two separate ones.

BTW, what you described would work in FB Standalone plus some plugins installed too.