Deploying Java Studio Creator 2U1 developed application to Glassfish
By winston on Aug 28, 2006
As Glassfish, the open sourced Java EE 5 Sun Application Server PE 9, is becoming popular, Java Studio Creator users are increasingly interested in deploying their web application to Glassfish. In the forth coming release of Creator, Glassfish will be directly supported. However, it may be possible to deploy the web application created using Sun Java Studio Creator 2U1. So I was looking at what it takes to deploy the Creator 2U1 application to Glassfish. As Marco pointed out, you can simply deploy the exported war file from Creator using Glassfish admin console. It works!
However, you have another option. That is to use latest and greatest JSF 1.2 built inside Glassfish, rather than the older version of JSF 1.1 bundled inside the exported war file. Note, JSF 1.2 is fully backward compatible. So the JSF application built with Creator 2U1 will work with the JSF 1.2 runtime bundled with Glassfish with out any modification.
In order to use the JSF 1.2 runtime do the following
- Export the war file using Project Navigator context menu item - Export War File
- Select J2EE 1.4 as the target container (doesn't matter even though Glassfish is a Java EE 5 container)
- Unzip the war file and remove the following jars from the folder WEB-INF/lib
- Zip the unzipped contents back as a war file and deploy it using Glassfish admin console
Note, you have to set up your datasources manually if any data connections are used in the Creator developed application. Also don't forget to manually copy the JDBC driver jars to the Glassfish lib directory. Read Chapter 2 of Glassfish Administration Guide to find details on how to set up the JDBC resources.
Suggestion: Use the Glassfish release V1 UR1 Build 08 or later, as the latest version of JSF 1.2 with many bug fixes are integrated in to this build.