Even though it shows "JRuby on Rails" component but it includes
everything, including GlassFish v3 Gem & MySQL server, in it.

Further in the installation process, change the database user name
from default "jrubystack" to "root". Take all other defaults through out
the installation process.

After the installation is completed, the following program menu is
added

After the bundle is installed, it's ready to use - MySQL server is
started, a default application is created in "C:\\Users\\Arun Gupta\\BitNami
JRubyStack projects\\jrubystack" and hosted using
GlassFish v3 gem at "http://localhost:3000". Here is the output
shown in the console window started by JRubyStack:

Thursday Feb 07, 2008

GlassFish
v3 Gem allows JRuby-on-Rails application to be launched in GlassFish
v3 server. It provides a robust alternative to WEBrick and
Mongrel
for development and deployment of your JRuby-on-Rails applications.

UPDATE (Feb 14): A 0.1.1 version of the gem is released which will change the installation process.

Once the gem is installed, "glassfish_rails"
script is available in JRUBY_HOME/bin
directory. The exact same commands work for installing the gem in JRuby
1.1RC1 as well.

How to deploy an
application on Gem ?

TOTD
#24 shows how to develop a JRuby-on-Rails applications with
JRuby 1.0.3 and JRuby 1.1 RC1 and tested using WEBrick.
To deploy these applications on the newly installed gem, use the
following command:

The
default number of concurrent requests that can be handled by an
application deployed Gem is
1. If your application hosted on the Gem needs to handle concurrent
requests then you need to specify the command-line option "-J-Djruby.runtime=NNN",
where NNN is
the number of expected concurrent requests. For example, if your
application needs to handle 4 concurrent requests then the command to
host your application will look like:

jruby -J-Djruby.runtime=4 -S glassfish_rails hello

How to host multiple
applications ?
Multiple applications can be hosted on GlassFish gem by modifying the
default port number on which the Gem is started. The ports that need to
be changed are: "http-listener-1", "http-listener-2"
and "admin-listener".

For now, the port numbers need to be modified by manually editing "jruby-1.0.3/lib/ruby/gems/1.8/gems/GlassFish-0.1.0-java/domains/domain1/config/domain.xml"
file. Search for the string in first column, replace the port attribute
of that XML element with the value in second column and the third
column shows the default value:

Search String

New Port

Default

http-listener-1

8081

8080

http-listener-2

8182

8181

admin-listener

4849

4848

Any subsequent application deployed on GlassFish
gem will now be hosted on
http://localhost:8081/<context-root>/<controller>/<view>
where <context-root> is the name of your Rails
application.

The Gem is now using the latest v3 codebase, including
Grizzly JRuby module 1.6.1.

2 Rails instances are created instead of the default one.
So now 2 requests can be invoked in parallel and they both will be
served instead of returning a blank page for the pending request. This
explains/resolves the issue reported here.

Friday Dec 21, 2007

JRuby 1.0.3 was recently
released and so was Rails
2.0. I decided to try JRuby 1.0.3 + Rails 2.0 and realized
that a few additional steps (because of Rails 2.0) are required to get
a trivial Hello World
applcation up and running. Here are the steps:

JRuby 1.0.x (I used
JRuby 1.0.2
and lets say installed in JRUBY_HOME). Make sure
JRUBY_HOME/bin is in your path.

Build the Gem

As explained in
Jerome's
entry, you can check out complete GlassFish v3 workspace or just the
Gem code. Here is how you'll check out only the Gem code on a Windows
machine using Tigris Subversion client:

Install Mephisto as described
here. The two steps are
summarized below for convenience:

Copy 'MEPHISTO_HOME/config/database.example.yml'
to 'MEPHISTO_HOME/config/database.yml'. There is no need to
specify the JDBC adapter
ActiveRecord 0.5 onwards and that allows to use the default
database configuration file.

Now you can start the application with script/server, visit
http://mydomain.com/admin, and log in with admin / test.

For help, visit the following:
Official Mephisto Site - http://mephistoblog.com
The Mephisto Community Wiki - http://mephisto.stikipad.com/
The Mephisto Google Group - http://groups.google.com/group/MephistoBlog