Tuesday, May 19, 2009

GAE integration with BlazeDS in Eclipse

Let me write down the steps for integrating BlazeDS with Google App Engine in Eclipse. Before that here is the list of things you will need.

1)Eclipse 3.3(I use this one, any other version should also be fine provided you have other plugins)
2)Flex Builder 3 plugin for eclipse
3)BlazeDS files(JARs and XMLs)
4)Google App Engine plugin for eclipse

Ok lets get started...
Create a Google App Engine Project. Enable Flex Nature for it.
Put project_name/war folder for Root Folder in Flex Builder configuration for the project.
Root URL : The URL where the Google App is running.
Root Context : Leave it blank.

Make sure you are running the server and validate the configuration.


Copy the XMLs from BlazeDS Project into WEB-INF/flex folder, heres the list of them

services-config.xml
proxy-config.xml
remoting-config.xml
messaging-config.xml

Copy the JARs into WEB-INF/lib folder, heres the list.
backport-util-concurrent.jar
commons-httpclient-3.0.1.jar
commons-logging-1.1.jar
concurrent.jar
commons-codec-1.3.jar
flex-messaging-common.jar
flex-messaging-core.jar
flex-messaging-opt.jar
flex-messaging-proxy.jar
flex-messaging-remoting.jar

Add xalan.jar also as I had faced the servlet initialisation problem without it.
MessageBrokerServlet failed to initialize due to runtime exception: Exception: java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model:

Add


to the appengine-web.xml

Add AMF Servlet to the web.xml



Make sure you have war/classes/META-INF/jdo-config.xml

Disable JMX by making the value false in services-config.xml



Disable the system redeploy by making the value 'false' in services-config.xml
Enabling this creates a thread when you redeploy the application, which is not allowed by GAE



These steps are enough to have the Application running.