Running Openbravo on Glassfish v3
By schmidtm on Feb 20, 2009
Last week i tried to run Openbravo 2.40 on Glassfish v3 (prelude version). Here i like to share my findings and how to get this setup running for those who follow. I neither explain how to install the necessary database nor the tomcat installation. The database was in my case PostgreSQL. I did the installation on a MacBook Pro/Intel running Mac OS X 10.5.6.
I had to get the "official" installation image for Openbravo on my platform (Mac OSX) which asks for the location of a pre-installed tomcat and login credentials for either a Oracle or PostgreSQL database. You have to run the standard installation process to get all schemas and data loaded into your preferred DB.
This can take up quite some time, but after this installation Openbravo could be found in tomcat's webapps directory: $TOMCAT_HOME/webapps/openbravo/openbravo.war. Trying to deploy this WAR-archive right away to Glassfish fails for reasons I'm going to explain below. Since there is one slight modification to Openbravo's deployment-descriptor (WEB-INF/web.xml) needed, we're unpack openbravo.war into it's own directory and deploy the application out of this directory.
The problem with the existing deployment-descriptor is, that it's written for Servlet 2.3 webcontainers like Glassfish v2 or tomcat. Glassfish v3 adheres to the Servlet 2.4 specification which is a bit picky about url-pattern. In principle this means you have to code this:
This is tracked, accepted and fixed as issue 7493 in Openbravo. Once this change makes it into Openbravo, this whole document becomes obsolete. But till then you have to apply this patch to WEB-INF/web.xml to rewrite the deployment descriptor.
After this modification, just deploy Openbravo using Glassfish's admin GUI using this trail: Applications/Web Applications/Deploy ...:
After a few seconds the new deployed application should show up in the list of your web-applications:
Now you should be able to login using Openbravo's default account Openbravo/openbravo :
which in turn take you to Openbravo's main dashboard: