Sunday, March 20, 2011

Richfaces showcase on Amazon's Elastic Beanstalk

Richfaces 4 is around the corner and it runs pretty much same in both Tomcat and JBoss. The major difference is that with Tomcat, you have to bundle in your .war a JSF implementation which could be Mojarra or MyFaces. I don't have a preference on JSF implementation at this stage.  Given that Richfaces runs without problem on Tomcat, I thought I should take AWS Elastic Beanstalk for a ride. As it turns out deploying is as simple as deploying it to your local tomcat instance which is a good thing but it also differs a bit.

In following screen shot, you can see that  I have chosen Richfaces showcase application (showcase.war) which I want to deploy on a 32-bit Linux OS running Tomcat 6. Once app is deployed, it should be deployed on http://prabhat.elasticbeanstalk.com (I have shut down my instance so link wont work).



When I deployed my app, I expected my app to be available at http://prabhat.elasticbeanstalk.com/showcase in line with what I get when I deploy the app locally which is http://localhost:8080/showcase . But Beanstalk renames the .war and deploys it as /usr/share/tomcat6/webapps/ROOT which is why it's available under root context . This is important to know because in the next step of configuration, you would  need to supply the URL which can be used for health check. I initially provided /showcase and I ran into problem. Following is what should be:



Other noteworthy differences or rather limitations are that currently Beanstalk configuration does not give you options to edit JVM parameters initially. Once you have instance up and running, it does give you an option to edit JVM configurations as well pass five application specific parameters but the name of parameters has to be PARAM1, PARAM2 ... May be this will be fixed in future versions or it's already available and I don't know. The latter is likely given that I did not spend a whole lot of time on it.  Anyway, here is screen shot of app running on Beanstalk.







2 comments:

Vihag Gupta said...

Hey,
I have been trying to deploy a richfaces application onto elastic beanstalk, it deploys but is never available, are there any configurations that i need to take care of before I deploy?

Prabhat Jha said...

What URL are you hitting? You should look into the log to see what context it is getting deployed.