Home Index Changes Prefs Log in »
This is version 1. It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]

Container Config in GlassFish V3

As of today, GlassFish V3 supports four types of applications each served by a particular container :

  1. Web Applications
  2. Ruby on Rails using JRuby 0.9.9
  3. Phobos using the phobos runtime
  4. PHP using the resin quercus engine.

This page will describe all the steps necessary to install these containers prior to start deploying artifacts to them. In a future build, we will most likely install these containers as the deployment request is made but this is not implemented yet so for now, you have to do it manually.

Web Applications

The web container is bundled with the GlassFish v3 installation so there is nothing that needs to be done to run servlets and jsp. We have not tried yet JSF.

Ruby On Rails

First you need to download the JRuby latest release from http://jruby.codehaus.org/ and install it either in the glassfish's installation lib directory under the jruby directory or install it anywhere and have jruby.home property in /config/asenv.conf pointing to it.

After that you just need to download and deploy a RoR application, you should not have to modify the RoR application except for the database connectivity. Existing RoR apps use native drivers to access the database, however when running in Java this is not the best option so you usally need to modify the RoR application to change that. Let's review this taking mephisto as an example :

  1. Download Mephisto at http://mephistoblog.com/
  2. Install MySQL
  3. Expand the downloaded zip in say mephisto directory
  4. change the mephisto/config/database.yml to have the following bindings :
development:
    adapter: jdbc
    driver: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost:3306/mephisto
    username: dochez
    password: noway
  1. Of course, you need the MySQL JDBC driver in jruby/lib, you can find it at http://www.mysql.com/products/connector/j/index.html
  2. Configure MySQL for mephisto, this is described in mephisto's installation page at http://mephisto.stikipad.com/help/show/Installing+Mephisto
  3. add jdbc to the required packages of the application by adding the following to config/environment.rb
if RUBY_PLATFORM =~ /java/
  require 'rubygems'
  RAILS_CONNECTION_ADAPTERS = %w(jdbc)
end
  1. deploy the application
asadmin deploy --path mephisto
  1. browse : http://localhost:8080/mephisto

Phobos installations

Same as above, just install the binaries in lib/phobos or have phobos.home in asenv.conf pointing to your installation. Go the phobos documentation on how to configure phobos. Please note that we do not support yet the persistence bindings in Phobos, this should be done right after JavaOne 2007.

PHP

PHP installation is a bit more complicated mostly because the Resin Quercus engine is not available in a public maven reposistory. So you need to follow these steps :

  1. download quercus from http://quercus.caucho.com/
  2. explode the .war file you just downloaded : jar -xvf quercus...war
  3. download the GlassFish V3 connector from http://download.java.net/maven/glassfish/com/sun/enterprise/glassfish/gf-php-connector/10.0-SNAPSHOT/gf-php-connector-10.0-SNAPSHOT.jar and install it in lib directory
  4. from the exploded quercus directory do :
cp WEB-INF/lib/resin-util.jar <glassfish>/lib/jars/resin-util-3.1.jar
cp WEB-INF/lib/quercus.jar <glassfish>/lib/jars/quercus-3.1.jar
cp index.php <glassfish>/domains/domain1/docroot
  1. browse http://localhost:8080/index.php you should see a success message from quercus indicating a valid installation.

Warning : the PHP integration in GlassFish V3 is not complete and you will probably run into issues. We need to upgrade to Grizzly 1.5 and resolve a few other issues before this will be fully functional.

« Home Attachments Info Index Changes Prefs
This particular version was published on 07-May-07 16:28 PM, -0700 by Jerome Dochez