Wednesday Feb 13, 2008

GlassFish v3 gem v0.1.1 for JRuby at RubyForge

GlassFish v3 gem v0.1.1 for JRuby at RubyForge

In my previous blog I had informed you all of the the GlassFish v3 gem v0.1.0. The first release was pushed out last week so that Charles Nutter to demo at the acts_as_conference held last weekend. The gem was very well received at the conference and based on the feedback provided by the attendees, have decided to release a new version to address many of the common issues that were reported.


Issues being addressed in v0.1.1

The following issues are being addressed in this version (v0.1.1) of the gem :

  • The name of the gem is being changed from GlassFish to glassfish. The rails naming convention for the gems is with all lower case or with names that contain underscore.
  • Support for the applications to be deployed at the Root Context ("/") of the server. The Webrick and Mongrel servers deploy the application to the root context by default.
  • Change the default port the server to be 3000 from 8080. Port 8080 has been the default http port of the GlassFish application server, but since we are targetting the Ruby on Rails market with this space, it is better to have the http port set to 3000. At this stage I have also changed the SSL port from the GlassFish default of 8181 to 3131 and the admin default port of 4848 to be 3838.
  • Provide command arguments to the script to specify the number of runtime to be created. In v0.1.0 of the gem one could specify the number of runtimes if it was passed in as a specified as a java system property. With this version use could use the command
    jruby -S glassfish_rails mephisto -n 2
    to create 2 rails instance.
  • Create instances of rails in parallel. This would speed up the startup of the v3 gem

Main issues I plan to address in v0.1.2
Some of the main items that I plan to work on as part of the gem v0.1.2 :
  • I have created the gem from the v3 code that was checked out on 02/08/2008. All the local changes are currently on my laptop. Would be working on getting these chages checked into the v3 code base and would publish steps on how to create a gem from the trunk. Currently there is a manual step involved in setting up the port. I would have to fix this before checking the code in the svn trunk.
  • As part of this release was planning to add support for specifying RAILS_ENV as a command argument. But was running into some issues. Would like to provide this in the next release.
  • Provide a way for users to provide a port portion as one of the command argument. This would involve making changes in the v3 code since currently the logic is in place to read the port from the config/domain.xml.
  • There is growing interest for Merb and plan to interact with Nick Sieger to see how we can add support for Merb in the gem.
Please note that this is not an exhaustive list and would continue to work on issues that are being reported on Glassfish Issue Tracker, JRuby JIRA and RubyForge.

If you have installed the previous version of the gem please uninstall the gem using the command
jruby -S gem uninstall GlassFish
Install the new version of the gem using the command :
jruby -S gem install glassfish

Sample output from executing the glassfish gem v0.1.1 on my Macbook pro :

My JRuby environment :
List of gems installed in my JRuby 1.0.3 environment

Command line argument support :
Command line argument support in GlassFish V0.1.1 gem

Start Mephisto application :
Launching the GlassFish v0.1.1 gem for Mephisto application

Mephisto web request
Mephisto application and Glassfish v0.1.1 gem

Resources :
GlassFish JRuby wiki
JRuby wiki

Thursday Dec 20, 2007

GlassFish Updatecenter module for JRuby 1.0.3

"JRuby on GlassFish" Updatecenter module (2.1) containing JRuby 1.0.3

Over the past weekend JRuby 1.0.3 was released and this time I wanted to ensure that we would have the GlassFish updatecenter module published at the earliest. This is version 2.1 of the module and would be available when you launch the updatetool from your GlassFish installation/updatecenter/bin directory of your GlassFish installation.


Contents of the JRuby on GlassFish 2.1 module

This JRuby update center module primarily consists of JRuby 1.0.3 and Goldspike revision 858. The JRuby 1.0.3 source bits that are part of this module, have been updated with the following gems :



Installing the JRuby on GlassFish module

Let us refer to GlassFish root directory location as $GLASSFISH_ROOT for the course of this blog. After installing GlassFish run the Update Center client

  $GLASSFISH_ROOT/updatecenter/bin/updatetool

Then you should see "JRuby on GlassFish" as one of the available modules.



Accept the license agreement to install this module. After the successful installation of this module, you would see a new directory "jruby" created under your GlassFish root directory. A screenshot of the directory structure after having installed the JRuby on GlassFish 2.1 module



If you had already installed the previous 2.0 module, updatetool would inform that there is an update available. In this case go to the "Available Updates" section and select JRuby on GlassFish 2.1 module and install it. In this case the directory structure would be


Web application modes
JRuby on GlassFish update center module bundles Goldspike and it supports the 2 modes - "Standalone" and "Shared", of deploying a RubyOnRails (ROR) application to a GlassFish application server instance. For this blog we would be using the directory deployment feature of GlassFish.
  • "Standalone" mode implies that the resulting Web application archive (WAR) would be self contained, i.e. it would contain not only the application, but also the JRuby, Rails, Goldspike libraries.
  • "Shared" mode implies that the WAR would just contain the WEB-INF/web.xml file along with the application. The libraries required for the application to run successfully would be picked up from the classpath of the GlassFish application server instance.

Post Installation steps
If you plan to use the "Shared" mode you would have to perform one additional step. After the successful installation of the JRuby update center module copy the required libraries to the GlassFish library directory and restart the GlassFish application server instance (for these libraries to be picked up by the running instance). Run the following command to achieve this :
  ant -f $GLASSFISH_ROOT/jruby/install.xml setup-shared-env

Sample Applications
This module comes with 3 sample applications -
  • HelloWorldRailsApp - a simple hello world application
  • cookbook - sample created using instructions from O'Reilly OnLamp
  • mephisto - version 0.7.3 of Mephisto blogging
In each of these sample application directory there is a file GLASSFISH_README, which provides information on how to deploy and run the application.

Wednesday Dec 12, 2007

GlassFish Updatecenter module for JRuby 1.0.2

"JRuby on GlassFish" Updatecenter module containing JRuby 1.0.2

Since JRuby 1.0.2 has been released for some time it was time that the GlassFish updatecenter module was updated to make use of these JRuby bits. As of last week we now have a new version of the "JRuby in GlassFish" updatecenter module. This is version 2.0 of the module and would be available when you launch the updatetool from your GlassFish installation/updatecenter/bin directory of your GlassFish v2 Update Release installation.


Contents of the JRuby on GlassFish 2.0 module

This JRuby update center module primarily consists of JRuby 1.0.2 and Goldspike revision 808. The JRuby 1.0.2 source bits that are part of this module, have been updated with the following gems :



Installing the JRuby on GlassFish module

Let us refer to GlassFish root directory location as $GLASSFISH_ROOT for the course of this blog. After installing GlassFish V2 Update Release run the Update Center client

  $GLASSFISH_ROOT/updatecenter/bin/updatetool

Then you should see "JRuby on GlassFish" as one of the available modules.



Accept the license agreement to install this module. After the successful installation of this module, you would see a new directory "jruby" created under your GlassFish root directory. A screenshot of the JRuby module directory


The layout of the directory created by the update center module 2.0 is different from the previous module to help support multiple jruby installations.


Web application modes
Since this JRuby update center module bundles Goldspike we also support the 2 modes - "Standalone" and "Shared", of deploying a RubyOnRails (ROR) application to a GlassFish application server instance. For this blog we would be using the directory deployment feature of GlassFish.
  • "Standalone" mode implies that the resulting Web application archive (WAR) would be self contained, i.e. it would contain not only the application, but also the JRuby, Rails, Goldspike libraries.
  • "Shared" mode implies that the WAR would just contain the WEB-INF/web.xml file along with the application. The libraries required for the application to run successfully would be picked up from the classpath of the GlassFish application server instance.

Post Installation steps
If you plan to use the "Shared" mode you would have to perform one additional step. After the successful installation of the JRuby update center module copy the required libraries to the GlassFish library directory and restart the GlassFish application server instance (for these libraries to be picked up by the running instance). The commands to be used are :
  asadmin stop-domain domain1    (Stop the application server if it is running)
  cp $GLASSFISH_ROOT/jruby/jruby-1.0.2/lib/jruby-complete.jar $GLASSFISH_ROOT/lib
  cp $GLASSFISH_ROOT/jruby/goldspike/target/goldspike-1.4-SNAPSHOT.jar $GLASSFISH_ROOT/lib
  cp $GLASSFISH_ROOT/jruby/goldspike/target/commons-pool-1.3.jar $GLASSFISH_ROOT/lib
  asadmin start-domain domain1   (Start the application server instance)

Sample Applications
This module comes with 3 sample applications -
  • HelloWorldRailsApp - a simple hello world application
  • cookbook - sample created using instructions from O'Reilly OnLamp
  • mephisto - version 0.7.3 of Mephisto blogging
In each of these sample application directory there is a file GLASSFISH_README, which provides information on how to deploy and run the application.
About

pramodg

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today