Friday, April 16, 2010

Adobe Flex Configuration/ Blaze DS/ Eclipse

Hi All,

This is the post on "Configuration of Adobe Flex with Java using Blaze DS". I tried to specify step by step instructions what i did successfully on my machine.
My environment details are:
1. Windows XP,
2. Adobe Flex Builder-3,
3. Tomcat 5.5
4. BlazeDS

Here are the step-by-step instructions:
1. Extract the blazeds into Tomcat webapps folder.

2. Make a copy of the blazeDS onto the same Tomcat webapps folder and named as "FlexPractice".
My local drive path is:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\blazeds. and
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\FlexPractice.

3. Delete all the folder under FlexPractice excluding WEB-INF and FlexPractice-debug.

4. Create a web project in eclipse anywhere in your local hard drive. This will be required to create Java classes that will be placed in FlexPractice project of Tomcat later on. We need to do this as my Flex builder is not supporting to create java classes so I need to make it another workspace and copying the class files in the WEB-INF folder of "FlexPractice" project.

5. Create a Flex Project in Flex builder anywhere in your local hard drive. Keep the name of the project same as created under Tomcat. In my case it FlexPractice. In all I am having 3 projects :(, One under tomcat webapps folder. Second in for creating project for java classes and third Flex project in Flex builder.

5. Under FlexPractice project of FlexBuilder, right click on project and create folder --> Click on Advanced and link to the WEB-INF\flex directory of FlexPractice project under Tomcat webapps.

6. When a Flex Project is created in FlexBuilder, the IDE create a file called .mxml. Here is the entry:



7. Create a Java class as specifed below in the image-



8. Put this java class (.class file) under TOMCAT FlexPractice WEB-INF\classes with complete package hierachy. In my case the path is like:
... Tomcat 5.5\webapps\FlexPractice\WEB- INF\classes\com\practice\flex\sample\remoteobjects\RemoteServiceHandler.class

9. Modify your remoting-config.xml file like -


10. This completes the setup and first program. Now you need to run FlexPractice.mxml file from FlexBuilder and it will display a page with a button on it. Clicking on which shows an Alert.

No comments:

Post a Comment