Thursday Jul 02, 2009

Rails on GlassFish - "most performant of all", "simpler and just works", "blazing speed"


Here are some quotes about running Rails applications on GlassFish from user@jruby mailing list:

I find the glassfish gem to be the most performant of all -- and I don't need to war-up my app.

I also have some mongrel cluster stuff, but glassfish is simpler and just works.

Voila...blazing speed, can handle lots of traffic. Note that I am also cominging into apache from a dyndns name. So, whatever IP I have, I can go straight to execution on the glassfish gem and NO warring up! What could be easier deployment, or a faster execution?

It's running fantasticly and performing like nothing I've seen before :) Completely stable memory, no wirings or anything bad for 5 days now.. (with several ab/htperf stresstests).

It's always exciting to get good endorsements of our efforts in the GlassFish team :)

Other similar stories for using Rails/GlassFish in production are described at rubyonrails+stories.

Technorati: glassfish v3 gem rubyonrails stories jruby

Wednesday Apr 29, 2009

TOTD #81: How to use nginx to load balance a cluster of GlassFish Gem ?

nginx (pronounced as "engine-ex") is an open-source and high-performance HTTP server. It provides the common features such as reverse proxying with caching, load balancing, modular architecture using filters (gzipping, chunked responses, etc), virtual servers, flexible configuration and much more.

nginx is known for it's high performance and low resource consumption. It's a fairly popular front-end HTTP server in the Rails community along with Apache, Lighttpd, and others. This TOTD (Tip Of The Day) will show how to install/configure nginx for load-balancing/front-ending a cluster of Rails application running on GlassFish Gem.
  1. Download, build, and install nginx using the simple script (borrowed from dzone):

    ~/tools > curl -L -O http://sysoev.ru/nginx/nginx-0.6.36.tar.gz
    ~/tools > tar -xzf nginx-0.6.36.tar.gz
    ~/tools > curl -L -O http://downloads.sourceforge.net/pcre/pcre-7.7.tar.gz
    ~/tools > tar -xzf pcre-7.7.tar.gz
    ~/tools/nginx-0.6.36 > ./configure --prefix=/usr/local/nginx --sbin-path=/usr/sbin --with-debug --with-http_ssl_module --with-pcre=../pcre-7.7
    ~/tools/nginx-0.6.36 > make
    ~/tools/nginx-0.6.36 > sudo make install
    ~/tools/nginx-0.6.36 > which nginx
    /usr/sbin/nginx

    OK, nginx is now roaring and can be verified by visiting "http://localhost" as shown below:


  2. Create a simple Rails scaffold as:

    ~/samples/jruby >~/tools/jruby/bin/jruby -S rails runner
    ~/samples/jruby/runner >~/tools/jruby/bin/jruby script/generate scaffold runlog miles:float minutes:integer
    ~/samples/jruby/runner >sed s/'adapter: sqlite3'/'adapter: jdbcsqlite3'/ <config/database.yml >config/database.yml.new
    ~/samples/jruby/runner >mv config/database.yml.new config/database.yml
    ~/samples/jruby/runner >~/tools/jruby/bin/jruby -S rake db:migrate
  3. Run this application using GlassFish Gem on 3 separate ports as:

    ~/samples/jruby/runner >~/tools/jruby/bin/jruby -S glassfish
    Starting GlassFish server at: 192.168.1.145:3000 in development environment...
    Writing log messages to: /Users/arungupta/samples/jruby/runner/log/development.log.
    Press Ctrl+C to stop.

    The default port is 3000. Start the seond one by explicitly specifying the port using "-p" option ..

    ~/samples/jruby/runner >~/tools/jruby/bin/jruby -S glassfish -p 3001
    Starting GlassFish server at: 192.168.1.145:3001 in development environment...
    Writing log messages to: /Users/arungupta/samples/jruby/runner/log/development.log.
    Press Ctrl+C to stop.

    and the last one on 3002 port ...

    ~/samples/jruby/runner >~/tools/jruby/bin/jruby -S glassfish -p 3002
    Starting GlassFish server at: 192.168.1.145:3002 in development environment...
    Writing log messages to: /Users/arungupta/samples/jruby/runner/log/development.log.
    Press Ctrl+C to stop.

    On Solaris and Linux, you can run GlassFish as a daemon as well.
  4. Nginx currently uses a simple round-robin algorithm. Other load balancers such as nginx-upstream-fair (fair proxy) and nginx-ey-balancer (maximum connections) are also available. The built-in algorithm will be used for this blog. Edit "/usr/local/nginx/conf/nginx.conf" to specify an upstream module which provides load balancing:
    1. Create a cluster definition by adding an upstream module (configuration details) right before the "server" module:

      upstream glassfish {
              server 127.0.0.1:3000;
              server 127.0.0.1:3001;
              server 127.0.0.1:3002;
          }

      The cluster specifies a bunch of GlassFish Gem instances running at the backend. Each server can be weighted differently as explained here. The port numbers must exactly match as those specified at the start up. The modified "nginx.conf" looks like:



      The changes are highlighted on lines #35 through #39.
    2. Configure load balancing by specifying this cluster using "proxy_pass" directive as shown below:

      proxy_pass http://glassfish;

      in the "location" module. The updated "nginx.conf" looks like:



      The change is highlighted on line #52.
  5. Restart nginx by using the following commands:

    sudo kill -15 `cat /usr/local/nginx/logs/nginx.pid`
    sudo nginx
Now "http://localhost" shows the default Rails page as shown below:



"http://localhost/runlogs" now serves the page from the deployed Rails application.

Now lets configure logging so that the upstream server IP address and port are printed in the log files. In "nginx.conf", uncomment "log_format" directive and add "$upstream_addr" variable as shown:

    log_format  main  '$remote_addr - [$upstream_addr] $remote_user [$time_local] $request '
                      '"$status" $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  logs/access.log  main;

Also change the log format to "main" by uncommenting "access_log logs/access.log main;" line as shown above (default format is "combined"). Accessing "http://localhost/runlogs" shows the following lines in "logs/access.log":

127.0.0.1 - [127.0.0.1:3000] - [29/Apr/2009:15:27:57 -0700] GET /runlogs/ HTTP/1.1 "200" 3689 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1" "-"
127.0.0.1 - [127.0.0.1:3001] - [29/Apr/2009:15:27:57 -0700] GET /favicon.ico HTTP/1.1 "200" 0 "http://localhost/runlogs/" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1" "-"
127.0.0.1 - [127.0.0.1:3002] - [29/Apr/2009:15:27:57 -0700] GET /stylesheets/scaffold.css?1240977992 HTTP/1.1 "200" 889 "http://localhost/runlogs/" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1" "-"

The browser makes multiple requests (3 in this case) to load resources on a page and they are nicely load-balanced on the cluster. If an instance running on port 3002 is killed, then the access log show the entries like:

127.0.0.1 - [127.0.0.1:3000] - [29/Apr/2009:15:28:53 -0700] GET /runlogs/ HTTP/1.1 "200" 3689 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1" "-"
127.0.0.1 - [127.0.0.1:3002, 127.0.0.1:3000] - [29/Apr/2009:15:28:53 -0700] GET /favicon.ico HTTP/1.1 "200" 0 "http://localhost/runlogs/" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1" "-"
127.0.0.1 - [127.0.0.1:3001] - [29/Apr/2009:15:28:53 -0700] GET /stylesheets/scaffold.css?1240977992 HTTP/1.1 "200" 889 "http://localhost/runlogs/" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1" "-"

The second log line shows that server running on port 3002 did not respond and so it automatically fall back to 3000, this is nice!

But this is inefficient because a back-end trip is made even for serving a static file ("/favicon.ico" and "/stylesheets/scaffold.css?1240977992"). This can be easily solved by enabling Rails page caching as described here and here.

More options about logging are described in NginxHttpLogModule and upstream module variables are defined in NginxHttpUpstreamModule.

Here are some nginx resources:
Are you using nginx to front-end your GlassFish cluster ?

Apache + JRuby + Rails + GlassFish = Easy Deployment! shows similar steps if you want to front-end your Rails application running using JRuby/GlassFish with Apache.

Hear all about it in Develop with Pleasure, Deploy with Fun: GlassFish and NetBeans for a Better Rails Experience session at Rails Conf next week.

Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. A complete archive of all tips is available here.

Technorati: rubyonrails glassfish v3 gem jruby nginx loadbalancing clustering

Friday Mar 20, 2009

TOTD # 76: JRuby 1.2, Rails 2.3, GlassFish Gem 0.9.3, ActiveRecord JDBC Adapter 0.9.1 - can they work together ?


Oh, what a week for the JRuby, Rails, and GlassFish enthusiasts!

JRuby 1.2, Rails 2.3GlassFish Gem 0.9.3, and ActiveRecord JDBC Adapater 0.9.1 - all released earlier this week. This is an opportune moment to run the integration tests to ensure the latest JRuby and GlassFish versions work nicely with each other.

First, lets see whats there to get exicted in each release.

JRuby 1.2 introduces a new versioning scheme by jumping from 1.1.6 -> 1.2. JRUBY-3649 is an important fix for the Windows users. Improved Ruby 1.9 support, 3-6x faster parsing, and preliminary android support are some other highlights. 1052 revisions and 256 bugfixes since 1.1.6 (89 days ago) means close to 12 revisions / day and 3 bugfixes/day!

Rails 2.3 has a bunch of highlights ranging from Rack integration, nested forms, attributes, and transactions, reconnecting lost MySQL connections, Application controller renamed (make sure to "rake rails:update:action_controller" to update from an older version), faster boot time in dev mode using lazy loading, and many others. The Release Notes provide all the detailed information.

The GlassFish Gem with features like running as daemon,  rake-style configuration of JVM options, ability to "sudo install" gem and run as normal user and multi-level logging are all gearing towards adding more production-quality features. My favorite here is running as daemon since that brings the Gem one step closer to the Rails community.

Lets get back to running our tests #1, #2, #3, #4, and #5 for these released versions.

First, lets unzip JRuby 1.2 and install Rails 2.3, GlassFish Gem 0.9.3, and other gems as:

~/tools/jruby-1.2.0 >./bin/jruby -S gem install rails glassfish activerecord-jdbcmysql-adapter
JRuby limited openssl loaded. gem install jruby-openssl for full support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
Successfully installed activesupport-2.3.2
Successfully installed activerecord-2.3.2
Successfully installed actionpack-2.3.2
Successfully installed actionmailer-2.3.2
Successfully installed activeresource-2.3.2
Successfully installed rails-2.3.2
Successfully installed rack-0.9.1
Successfully installed glassfish-0.9.3-universal-java
Successfully installed activerecord-jdbc-adapter-0.9.1
Successfully installed jdbc-mysql-5.0.4
Successfully installed activerecord-jdbcmysql-adapter-0.9.1
11 gems installed
Installing ri documentation for activesupport-2.3.2...
Installing ri documentation for activerecord-2.3.2...
Installing ri documentation for actionpack-2.3.2...
Installing ri documentation for actionmailer-2.3.2...
Installing ri documentation for activeresource-2.3.2...
Installing ri documentation for rack-0.9.1...
Installing ri documentation for glassfish-0.9.3-universal-java...
Installing ri documentation for activerecord-jdbc-adapter-0.9.1...
Installing ri documentation for jdbc-mysql-5.0.4...
Installing ri documentation for activerecord-jdbcmysql-adapter-0.9.1...
Installing RDoc documentation for activesupport-2.3.2...
Installing RDoc documentation for activerecord-2.3.2...
Installing RDoc documentation for actionpack-2.3.2...
Installing RDoc documentation for actionmailer-2.3.2...
Installing RDoc documentation for activeresource-2.3.2...
Installing RDoc documentation for rack-0.9.1...
Installing RDoc documentation for glassfish-0.9.3-universal-java...
Installing RDoc documentation for activerecord-jdbc-adapter-0.9.1...
Installing RDoc documentation for jdbc-mysql-5.0.4...
Installing RDoc documentation for activerecord-jdbcmysql-adapter-0.9.1...

If you have a previous version of GlassFish gem installed, then update it as:

~/tools/jruby-1.1.6 >./bin/jruby -S gem update glassfish
JRuby limited openssl loaded. gem install jruby-openssl for full support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
Updating installed gems
Updating glassfish
Successfully installed glassfish-0.9.3-universal-java
Gems updated: glassfish

Similarly ActiveRecord gem can be updated as:

~/tools/jruby-1.1.6 >./bin/jruby -S gem update activerecord
JRuby limited openssl loaded. gem install jruby-openssl for full support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
Updating installed gems
Updating activerecord-jdbc-adapter
Successfully installed activerecord-jdbc-adapter-0.9.1
Updating activerecord-jdbcmysql-adapter
Successfully installed activerecord-jdbcmysql-adapter-0.9.1
Updating activerecord-jdbcsqlite3-adapter
Successfully installed jdbc-sqlite3-3.6.3.054
Successfully installed activerecord-jdbcsqlite3-adapter-0.9.1
Updating merb_activerecord
Successfully installed merb_activerecord-1.0.0.1
Gems updated: activerecord-jdbc-adapter, activerecord-jdbcmysql-adapter, jdbc-sqlite3, activerecord-jdbcsqlite3-adapter, merb_activerecord

Running test #1 encounters JRUBY-3502, basically "db:create" is not working with JRuby 1.2.0, Rails 2.3.2 and MySQL ActiveRecord JDBC Adapter. However "db:create" works if JRuby 1.2.0 and Rails 2.2.2 are used. Alternatively SQLite3 ActiveRecord JDBC Adapter may be used. So first lets install SQLite3 JDBC adapter as:

~/tools/jruby-1.2.0 >./bin/jruby -S gem install activerecord-jdbcsqlite3-adapter
JRuby limited openssl loaded. gem install jruby-openssl for full support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
Successfully installed jdbc-sqlite3-3.6.3.054
Successfully installed activerecord-jdbcsqlite3-adapter-0.9.1
2 gems installed
Installing ri documentation for jdbc-sqlite3-3.6.3.054...
Installing ri documentation for activerecord-jdbcsqlite3-adapter-0.9.1...
Installing RDoc documentation for jdbc-sqlite3-3.6.3.054...
Installing RDoc documentation for activerecord-jdbcsqlite3-adapter-0.9.1...

Now lets recreate our application without specifying "-d mysql" switch as:

~/tools/jruby-1.2.0/samples/rails >../../bin/jruby -S rails runner
      create 
      create  app/controllers
      create  app/helpers
. . .
      create  log/production.log
      create  log/development.log
      create  log/test.log

In the generated "config/database.yml", change the database adapter from:

development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

to

development:
  adapter: jdbcsqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

The changes are highlighted in bold. Run the remainder of test #1.

The supported Rails version on GlassFish v3 Prelude is Rails 2.1 so we'll stick with running a Rails 2.1 (instead of Rails 2.3.2) simple scaffold application but will use the latest JRuby 1.2.0. Running a Rails 2.3.2 on GlassFish v3 Prelude will encounter issue #7384. Please add your comments to the bug report if you are running GlassFish v3 Prelude in production and would like this bug to be fixed!

Rails 2.3.2 require workaround for a WAR-based deployment of a Rails application as expained here. This workaround is required only if you are using JRuby-Rack 0.9.1 or lower. A newer version of JRuby-Rack may solve these problems making these steps optional. The steps are anyway outlined below for convenience:
  1. Uncomment the following line from "config/initializers/session_initializers.rb":

    ActionController::Base.session_store = :active_record_store
  2. Do "jruby -S warble config" to generate the template "config/warble.rb", edit it and add the following line:

    config.webxml.jruby.session_store = 'db'
  3. In "config/environment.rb", add the following code:

     if defined?(JRUBY_VERSION)
     # hack to fix jruby-rack's incompatibility with rails edge
     module ActionController
       module Session
         class JavaServletStore
           def initialize(app, options={}); end
           def call(env); end
         end
       end
     end
    end 

    just above the line "Rails::Initializer.run do |config|".
Always refer to JRuby/Rails 2.3.2 wiki for the latest information on these steps.

The deployment goes fine after making the changes but bringing up the scaffold page in the browser shows the following error message:


So commented the "jndi" and "driver" entry from "config/database.yml" such that the bundled MySQL JDBC Adapter is used instead. And then the test passes.

Here is a status report after running all the tests:

Test # Description Status
#1 Simple Scaffold using GlassFish Gem PASS (with workaround in JRUBY-3502)
#2 Simple Scaffold using GlassFish v3 Prelude PASS
#3 Simple Scaffold using GlassFish v3 FAIL (used workaround mentioned in JRUBY-3502,  issues #7266, #7270, #7271 still need to be fixed). PASS if the Application and Controller name are different.
#4 Simple Scaffold as WAR-based application on GlassFish v2.1 FAIL (issue #7385), PASS (with workaround in issue JRUBY-3515)
#5 Redmine using GlassFish Gem PASS

It's certainly exciting to know that @grantmichaels is already using the latest version of GlassFish Gem and Rails in production :)

JRuby/GlassFish Wiki provide a list of other known JRuby/Rails/GlassFish deployments in production. Leave a comment on this blog if you are using it as well and we'll be happy to add your name!

The complete set of tests are available using the tags rubyonrails+glassfish+integrationtest. So to answer the title of this blog - YES, JRuby 1.2.0, Rails 2.3.2, GlassFish Gem 0.9.3, ActiveRecord JDBC Adapater 0.9.1 all work together with the restrictions stated above. GlassFish v3 is a moving target and the bugs will be fixed soon. JRUBY-3515 is what delayed this entry otherwise would've posted it much earlier ;-)

Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. A complete archive of all tips is available here.

Technorati: totd rubyonrails glassfish v3 gem jruby sampleapp activerrecord redmine integrationtest

Sunday Mar 15, 2009

TOTD # 74: JRuby and GlassFish Integration Test #5: JRuby 1.2.0 RC2 + Rails 2.x.x + GlassFish + Redmine


TOTD #70, #71, #72, #73 shows four integration tests that can ensure that the latest JRuby and GlassFish versions work nicely with each other.

#70 showed how to create a trivial Rails application and run it using GlassFish Gem#71 showed how the same application can be deployed on GlassFish v3 Prelude#72 showed how to deploy the same application on GlassFish v3. #73 showed how to deploy a Rails application as WAR file and use the JDBC connection pooling framework available in GlassFish.

The next set of tests ensure that some commonly used open source Rails applications can be easily run using this setup. The first one is Redmine - 0.8 is the stable release now. Redmine was first tried on GlassFish a few months ago. The steps have simplified since then :)

Lets begin integration test #5.
  1. Download Redmine 0.8 ...

    /samples/jruby/redmine >svn co http://redmine.rubyforge.org/svn/branches/0.8-stable redmine-0.8
    A    redmine-0.8/test
    A    redmine-0.8/test/unit
    A    redmine-0.8/test/unit/document_test.rb
    A    redmine-0.8/test/unit/token_test.rb
    . . .
    A    redmine-0.8/public/stylesheets/scm.css
    A    redmine-0.8/public/stylesheets/application.css
    A    redmine-0.8/public/favicon.ico
     U   redmine-0.8
    Checked out revision 2580.
  2. Copy "config/database.yml.example" to "config/database.yml" and then generate/migrate the database:

    ~/samples/jruby/redmine/redmine-0.8 >../jruby-1.2.0RC2/bin/jruby -S rake db:create
    (in /Users/arungupta/samples/jruby/redmine/redmine-0.8)
    ~/samples/jruby/redmine/redmine-0.8 >../jruby-1.2.0RC2/bin/jruby -S rake db:migrate
    (in /Users/arungupta/samples/jruby/redmine/redmine-0.8)
    == 1 Setup: migrating =========================================================
    -- create_table("attachments", {:force=>true})
       -> 0.0880s
    -- create_table("auth_sources", {:force=>true})
       -> 0.1430s
    . . .
    == 100 AddChangesetsUserId: migrating =========================================
    -- add_column(:changesets, :user_id, :integer, {:default=>nil})
       -> 0.0980s
    == 100 AddChangesetsUserId: migrated (0.0990s) ================================

    == 101 PopulateChangesetsUserId: migrating ====================================
    == 101 PopulateChangesetsUserId: migrated (0.0030s) ===========================

  3. Redmine is a Rails 2.1.x application so install Rails 2.1.x using JRuby 1.2 and run the application as:

    ~/samples/jruby/redmine/redmine-0.8 >../jruby-1.2.0RC2/bin/jruby -S glassfish
    Mar 13, 2009 11:14:59 AM com.sun.enterprise.glassfish.bootstrap.ASMainStatic findDerbyClient
    INFO: Cannot find javadb client jar file, jdbc driver not available
    Mar 13, 2009 11:14:59 AM APIClassLoaderService createAPIClassLoader
    INFO: APIClassLoader = java.net.URLClassLoader@59fb8de1
    . . .
    Mar 13, 2009 11:15:10 AM com.sun.grizzly.pool.DynamicPool$1 run
    INFO: New instance created in 10,175 milliseconds
    Mar 13, 2009 11:15:10 AM com.sun.enterprise.v3.server.AppServerStartup run
    INFO: GlassFish v3  startup time : Static(356ms) startup services(11456ms) total(11812ms)

    Very simple and seamless!
The application is now accessible at "http://locahost:3000". The following screen dumps are captured by traversing through different parts of the application:















The next blog will show the last test in this series. The current set of tests are available using the tags rubyonrails+glassfish+integrationtest.

Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. A complete archive of all tips is available here.

Technorati: totd rubyonrails glassfish v3 gem jruby sampleapp redmine integrationtest

Sunday Mar 08, 2009

TOTD # 72: JRuby and GlassFish Integration Test #3: JRuby 1.2.0 RC2 + Rails 2.2.x + GlassFish v3


TOTD #70 and #71 shows the first two integration tests that I typically run to ensure that the latest JRuby and GlassFish versions work nicely with each other.  #70 showed how to create a trivial Rails application and run it using GlassFish Gem. #71 showed how the same application can be deployed on GlassFish v3 Prelude.

The third test (explained in this blog) ensures that the same application can be easily deployed using GlassFish v3. GlassFish v3 will be available later this year with full support for Java EE 6.

JRuby 1.2.0 RC2 is now released. Test #1 passed, Test #2 gives the following error:

Caused by: java.lang.NumberFormatException: For input string: "0RC2"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
        at java.lang.Integer.parseInt(Integer.java:456)
        at java.lang.Integer.parseInt(Integer.java:497)
        at com.sun.grizzly.jruby.RailsAdapter$JRubyVersion.<init>(RailsAdapter.java:137)
        at com.sun.grizzly.jruby.RailsAdapter$JRubyVersion.<init>(RailsAdapter.java:131)
        at com.sun.grizzly.jruby.RailsAdapter.<init>(RailsAdapter.java:110)
        at com.sun.grizzly.jruby.RubyRuntime.<init>(RubyRuntime.java:48)
        ... 22 more

However running the same application using JRuby trunk (rev 9372) shows the following output:



So test #2 passes with trunk but fails with RC2 bits. The final release of 1.2 will not have any characters and so this test will pass with the final JRuby 1.2 bits.

Now, lets begin the integration test #3.
  1. Download and unzip the latest GlassFish v3, b39 is the latest at time of this writing. Fire up GlassFish v3 as:

    ~/tools/glassfish/v3/b39/glassfishv3/glassfish >./bin/asadmin start-domain
    Name of the domain started: [domain1] and
    its location: [/Users/arungupta/tools/glassfish/v3/b39/glassfishv3/glassfish/domains/domain1].
    Admin port for the domain: [4848].
  2. Add JRUBY_HOME as "jvm-option" using the following command:

    ~/tools/glassfish/v3/b39/glassfishv3/glassfish >./bin/asadmin create-jvm-options -DJRUBY_HOME="/Users/arungupta/tools/jruby-1.2.0RC2"
    created 1 option(s)

    Command create-jvm-options executed successfully.

    This tells the GlassFish runtime to pick JRuby and related libraries from the directory specified in JRUBY_HOME.
  3. Deploy the application as:

    ~/tools/jruby-1.2.0RC1/samples/rails >~/tools/glassfish/v3/b39/glassfishv3/bin/asadmin deploy runner

    Command deploy executed successfully.
  4. Accessing "http://localhost:8080/runner/runners" gives the error:

    ActionController::RoutingError (No route matches "s" with {:method=>:get}):
        /Users/arungupta/tools/jruby-1.2.0RC1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/routing/recognition_optimisation.rb:66:in `recognize_path'
        /Users/arungupta/tools/jruby-1.2.0RC1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/routing/route_set.rb:386:in `recognize'
        /Users/arungupta/tools/jruby-1.2.0RC1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:182:in `handle_request'
        /Users/arungupta/tools/jruby-1.2.0RC1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:110:in `dispatch_unlocked'
        /Users/arungupta/tools/jruby-1.2.0RC1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:123:in `dispatch'
        /Users/arungupta/tools/jruby-1.2.0RC1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:in `dispatch'
        /Users/arungupta/tools/jruby-1.2.0RC1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:132:in `dispatch_cgi'
        /Users/arungupta/tools/jruby-1.2.0RC1/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:39:in `dispatch'
        file:/Users/arungupta/tools/glassfish/v3/b39/glassfishv3/glassfish/modules/grizzly-jruby.jar!/rack/adapter/rails.rb:82:in `serve_rails'
        file:/Users/arungupta/tools/glassfish/v3/b39/glassfishv3/glassfish/modules/grizzly-jruby.jar!/rack/adapter/rails.rb:109:in `call'
        file:/Users/arungupta/tools/glassfish/v3/b39/glassfishv3/glassfish/modules/grizzly-jruby.jar!/jruby/rack/rails.rb:81:in `call'
        file:/Users/arungupta/tools/glassfish/v3/b39/glassfishv3/glassfish/modules/grizzly-jruby.jar!/rack/handler/grizzly.rb:55:in `call'
        :1

    This resulted in filing issue #7266.
  5. GlassFish v3 allows an application to be deployed/redeployed on a different context root by specifying "--contextroot" switch. Lets try to deploy the app using a different context root as shown below:

    ~/tools/jruby-1.2.0RC1/samples/rails >~/tools/glassfish/v3/b39/glassfishv3/bin/asadmin deploy --contextroot runlog --force=true runner

    Command deploy executed successfully.

    Even though the application is deployed successful, but now "http://localhost:8080/runlog/runners" and "http://localhost:8080/runner/runners" give a 404. This resulted in filing issue #7270 and issue# 7271. The context root strippping does not happen correctly if a Rails application is deployed. But the good news is that a fix is already in progress. A workaround is to create exactly the same application with a different name.
  6. Recreate the application using a name different from the controller. Lets use the name "runlog" and redeploy the application as:

    ~/tools/jruby-1.2.0RC2/samples/rails >~/tools/glassfish/v3/b39/glassfishv3/bin/asadmin deploy runlog

    Command deploy executed successfully.

    After adding few entries the page at "http://localhost:8080/runlog/runners" looks like:


So test #3 fails if the Application and Controller name are same but passes if they are different. Our original application did not run so test #3 failed.

Later blogs will show the remainder of tests. The current set of tests are available using the tags rubyonrails+glassfish+integrationtest.

Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. A complete archive of all tips is available here.

Technorati: totd rubyonrails glassfish v3 jruby gem integrationtest

Wednesday Mar 04, 2009

TOTD # 71: JRuby and GlassFish Integration Test #2: JRuby 1.2.0 RC1 + Rails 2.2.x + GlassFish v3 Prelude


TOTD #70 shows the first integration integration tests that I typically run to ensure that the latest JRuby and GlassFish versions work nicely with each other.  The second test (explained in this blog) ensures that the same application can be deployed using GlassFish v3 Prelude.

GlassFish v3 Prelude allows Rails applications to be deployed natively, i.e. without any packaging.

Lets begin integration test #2.
  1. Download and unzip GlassFish v3 Prelude. Fire up GlassFish v3 Prelude as:

    ~/tools/glassfish/v3/glassfishv3-prelude/glassfish >./bin/asadmin start-domain
    Name of the domain started: [domain1] and
    its location: [/Users/arungupta/tools/glassfish/v3/glassfishv3-prelude/glassfish/domains/domain1].
    Admin port for the domain: [4848].
  2. Add JRUBY_HOME as "jvm-option" using the following command:

    ~/tools/glassfish/v3/glassfishv3-prelude/glassfish >./bin/asadmin create-jvm-options -DJRUBY_HOME="/Users/arungupta/tools/jruby-1.2.0RC1"
    created 1 option(s)

    Command create-jvm-options executed successfully.

    This tells the GlassFish runtime to pick JRuby and related libraries from the directory specified in JRUBY_HOME.
  3. Deploy the application as:

    ~/tools/jruby-1.2.0RC1/samples/rails >~/tools/glassfish/v3/glassfishv3-prelude/bin/asadmin deploy runner

    Command deploy executed successfully.

  4. The application should now be accessible on "http://localhost:8080/runner/runners". But instead the logs (located in "domains/domain1/logs/server.log) shows the following exception:

    Caused by: java.lang.NumberFormatException: For input string: "0RC1"
            at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
            at java.lang.Integer.parseInt(Integer.java:456)
            at java.lang.Integer.parseInt(Integer.java:497)
            at com.sun.grizzly.jruby.RailsAdapter$JRubyVersion.<init>(RailsAdapter.java:137)
            at com.sun.grizzly.jruby.RailsAdapter$JRubyVersion.<init>(RailsAdapter.java:131)
            at com.sun.grizzly.jruby.RailsAdapter.<init>(RailsAdapter.java:110)
            at com.sun.grizzly.jruby.RubyRuntime.<init>(RubyRuntime.java:48)
            ... 30 more

    This is filed as issue #7235 in GlassFish Issue Tracker.
  5. Lets try with the JRuby trunk.
    1. Check out JRuby trunk and build the workspace as shown below

      ~/workspaces >svn co http://svn.codehaus.org/jruby/trunk/jruby/
      A    jruby/bench
      A    jruby/bench/bench_tak.rb
      A    jruby/bench/bench_struct.rb

      . . .

      A    jruby/.settings/org.eclipse.jdt.core.prefs
      A    jruby/.settings/org.eclipse.jdt.ui.prefs
       U   jruby
      Checked out revision 9347.
      ~/workspaces >cd jruby/
      ~/workspaces/jruby >ant
      Buildfile: build.xml

      init:

      jar:

      . . .

      _update_scm_revision_:
            [jar] Building jar: /Users/arungupta/workspaces/jruby/lib/jruby.jar
            [jar] Warning: selected jar files include a META-INF/INDEX.LIST which will be replaced by a newly generated one.

      BUILD SUCCESSFUL
      Total time: 1 minute 21 seconds
    2. Install Rails

      ~/workspaces/jruby >./bin/jruby gem install rails
      JRuby limited openssl loaded. gem install jruby-openssl for full support.
      http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
      Successfully installed rake-0.8.4
      Successfully installed activesupport-2.2.2
      Successfully installed activerecord-2.2.2
      Successfully installed actionpack-2.2.2
      Successfully installed actionmailer-2.2.2
      Successfully installed activeresource-2.2.2
      Successfully installed rails-2.2.2
      7 gems installed
      Installing ri documentation for rake-0.8.4...
      Installing ri documentation for activesupport-2.2.2...
      Installing ri documentation for activerecord-2.2.2...
      Installing ri documentation for actionpack-2.2.2...
      Installing ri documentation for actionmailer-2.2.2...
      Installing ri documentation for activeresource-2.2.2...
      Installing RDoc documentation for rake-0.8.4...
      Installing RDoc documentation for activesupport-2.2.2...
      Installing RDoc documentation for activerecord-2.2.2...
      Installing RDoc documentation for actionpack-2.2.2...
      Installing RDoc documentation for actionmailer-2.2.2...
      Installing RDoc documentation for activeresource-2.2.2...
  6. Delete the previously added jvm-option as

    ~/tools/glassfish/v3/glassfishv3-prelude/glassfish >./bin/asadmin delete-jvm-options -DJRUBY_HOME="/Users/arungupta/tools/jruby-1.2.0RC1"
    deleted 1 option(s)

    Command delete-jvm-options executed successfully.

    and add a new jvm-option pointing to the the new JRUBY_HOME as

    ~/tools/glassfish/v3/glassfishv3-prelude/glassfish >./bin/asadmin create-jvm-options -DJRUBY_HOME="/Users/arungupta/workspaces/jruby"
    created 1 option(s)

    Command create-jvm-options executed successfully.
  7. Deploy the application as:

    ~/tools/jruby-1.2.0RC1/samples/rails >~/tools/glassfish/v3/glassfishv3-prelude/bin/asadmin deploy --force=true runner

    Command deploy executed successfully.

    The "NumberFormatException" as seen above is shown again in this case.

    If the application is deployed correctly then "http://localhost:8080/runner/runners" will show the scaffold page. The final JRuby 1.2 release will not have any text letters in the version and so you'll be able to deploy a Rails application using JRuby 1.2 (final release) on GlassFish v3 Prelude.
But for now our test #2 has failed.

Subsequent blogs will show the remainder of tests. The current set of tests are available using the tags rubyonrails+glassfish+integrationtest.

Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. A complete archive of all tips is available here.

Technorati: totd rubyonrails glassfish v3 jruby gem integrationtest

Tuesday Mar 03, 2009

TOTD # 70: JRuby and GlassFish Integration Test# 1: JRuby 1.2.0 RC1 + Rails 2.2.x + GlassFish Gem


JRuby 1.2.0 RC1 is out for a while!

I typically run a series of tests to ensure that any publicly released version of JRuby works nicely with GlassFish. The main goal of running these tests is to discover any blocking bugs before users do. This particular set of tests are being run little late as RC1 was released on Feb 24th. But I'll describe all the steps clearly in the next few blog entries so that you can try them out yourself.

JRuby team runs a whole slew of tests before releasing any bits. Similarly we run a bunch of tests before releasing GlassFish Gem. These tests, as mentioned earlier, are only to ensure that the latest release of JRuby works nicely with the latest bits of GlassFish.

The first basic test is to check if a simple Rails application can be run using the latest GlassFish Gem. The steps are described next.

First, lets create a database user and grant privileges required by our application:

~/tools >sudo mysql
Welcome to the MySQL monitor.  Commands end with ; or \\g.
Your MySQL connection id is 30
Server version: 5.1.30 MySQL Community Server (GPL)

Type 'help;' or '\\h' for help. Type '\\c' to clear the buffer.

mysql> create user duke@localhost identified by 'glassfish';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on runner_development.\* to duke@localhost identified by 'glassfish';
Query OK, 0 rows affected (0.03 sec)

mysql> grant all on runner_production.\* to duke@localhost identified by 'glassfish';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit;
Bye

The "runner_development" and "runner_production" databases will be created later. And the database are dropped and created fresh for every test run.

Now lets try to create our first Rails application using JRuby and run it using GlassFish gem:
  1. Download and unzip JRuby 1.2.0 RC1.
  2. Install Rails and GlassFish Gem as:

    ~/tools/jruby-1.2.0RC1 >./bin/jruby -S gem install rails glassfish
    JRuby limited openssl loaded. gem install jruby-openssl for full support.
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
    Successfully installed activesupport-2.2.2
    Successfully installed activerecord-2.2.2
    Successfully installed actionpack-2.2.2
    Successfully installed actionmailer-2.2.2
    Successfully installed activeresource-2.2.2
    Successfully installed rails-2.2.2
    Successfully installed rack-0.9.1
    Successfully installed glassfish-0.9.2-universal-java
    8 gems installed
    Installing ri documentation for activesupport-2.2.2...
    Installing ri documentation for activerecord-2.2.2...
    Installing ri documentation for actionpack-2.2.2...
    Installing ri documentation for actionmailer-2.2.2...
    Installing ri documentation for activeresource-2.2.2...
    Installing ri documentation for rack-0.9.1...
    Installing ri documentation for glassfish-0.9.2-universal-java...
    Installing RDoc documentation for activesupport-2.2.2...
    Installing RDoc documentation for activerecord-2.2.2...
    Installing RDoc documentation for actionpack-2.2.2...
    Installing RDoc documentation for actionmailer-2.2.2...
    Installing RDoc documentation for activeresource-2.2.2...
    Installing RDoc documentation for rack-0.9.1...
    Installing RDoc documentation for glassfish-0.9.2-universal-java...
  3. Create a new app as:

    ~/tools/jruby-1.2.0RC1/samples/rails >../../bin/jruby -S rails runner -d mysql
    JRuby limited openssl loaded. gem install jruby-openssl for full support.
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
          create 
          create  app/controllers
          create  app/helpers
          . . .
          create  log/server.log
          create  log/production.log
          create  log/development.log
          create  log/test.log
  4. Install MySQL JDBC ActiveRecord adapter as:

    ~/tools/jruby-1.2.0RC1/samples/rails >../../bin/jruby -S gem install activerecord-jdbcmysql-adapter
    JRuby limited openssl loaded. gem install jruby-openssl for full support.
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
    Successfully installed activerecord-jdbc-adapter-0.9
    Successfully installed jdbc-mysql-5.0.4
    Successfully installed activerecord-jdbcmysql-adapter-0.9
    3 gems installed
    Installing ri documentation for activerecord-jdbc-adapter-0.9...
    Installing ri documentation for jdbc-mysql-5.0.4...
    Installing ri documentation for activerecord-jdbcmysql-adapter-0.9...
    Installing RDoc documentation for activerecord-jdbc-adapter-0.9...
    Installing RDoc documentation for jdbc-mysql-5.0.4...
    Installing RDoc documentation for activerecord-jdbcmysql-adapter-0.9...

    More details on configuring this adapter here.
  5. Create a simple scaffold:

    ~/tools/jruby-1.2.0RC1/samples/rails/runner >../../../bin/jruby script/generate scaffold runner distance:float time:integer
    JRuby limited openssl loaded. gem install jruby-openssl for full support.
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
          exists  app/models/
          exists  app/controllers/
          . . .
          create    test/fixtures/runners.yml
          create    db/migrate
          create    db/migrate/20090226171752_create_runners.rb
  6. Edit "config/database.yml" to use the JDBC adapter and specify database username/password. Change:

    development:
      adapter: mysql
      encoding: utf8
      database: runner_development
      pool: 5
      username: root
      password:
      socket: /tmp/mysql.sock

    to

    development:
      adapter: jdbcmysql
      encoding: utf8
      database: runner_development
      pool: 5
      username: duke
      password: glassfish
      socket: /tmp/mysql.sock

    The change is highlighted in bold letters.
  7. Create and migrate the database as:

    ~/tools/jruby-1.2.0RC1/samples/rails/runner >../../../bin/jruby -S rake db:create
    (in /Users/arungupta/tools/jruby-1.2.0RC1/samples/rails/runner)
    ~/tools/jruby-1.2.0RC1/samples/rails/runner >../../../bin/jruby -S rake db:migrate
    (in /Users/arungupta/tools/jruby-1.2.0RC1/samples/rails/runner)
    ==  CreateRunners: migrating ==================================================
    -- create_table(:runners)
       -> 0.1330s
       -> 0 rows
    ==  CreateRunners: migrated (0.1340s) =========================================

    The default RAILS_ENV is DEVELOPMENT so there is no need to specify any addtional arguments.
  8. And then run the application as:

    ~/tools/jruby-1.2.0RC1/samples/rails/runner >../../../bin/jruby -S glassfish
    Feb 26, 2009 10:30:10 AM com.sun.enterprise.glassfish.bootstrap.ASMainStatic start
    INFO: Cache not present, will revert to less efficient algorithm
    Feb 26, 2009 10:30:10 AM com.sun.enterprise.glassfish.bootstrap.ASMainStatic findDerbyClient
    INFO: Cannot find javadb client jar file, jdbc driver not available
    Feb 26, 2009 10:30:10 AM APIClassLoaderService createAPIClassLoader
    INFO: APIClassLoader = java.net.URLClassLoader@14a66e3f
    no resource bundle found for version, using default GlassFish version
    Feb 26, 2009 10:30:11 AM AppServerStartup run
    INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
    Feb 26, 2009 10:30:11 AM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
    INFO: Listening on port 3000
    Feb 26, 2009 10:30:11 AM com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider setGuiContextRoot
    INFO: Admin Console Adapter: context root: /_____admingui
    Feb 26, 2009 10:30:11 AM com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter setStateMsg
    INFO: The Admin Console Application is not yet installed.
    Feb 26, 2009 10:30:11 AM com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider setGuiContextRoot
    INFO: Admin Console Adapter: context root: /_____admingui
    Feb 26, 2009 10:30:11 AM org.glassfish.scripting.rails.RailsDeployer load
    INFO: Loading application runner at /
    Feb 26, 2009 10:30:11 AM com.sun.grizzly.jruby.RailsAdapter <init>
    INFO: Jruby version is: 1.2.0RC1
    Feb 26, 2009 10:30:11 AM com.sun.grizzly.jruby.rack.RackApplicationChooser detectRails
    INFO: Detected Rails application
    Feb 26, 2009 10:30:11 AM com.sun.grizzly.jruby.rack.RackApplicationChooser detectRails
    INFO: Rails not in thread-safe mode, starting in single-thread mode
    Feb 26, 2009 10:30:11 AM com.sun.grizzly.pool.DynamicPool logDynamicStatus
    INFO: Pool started without dynamic resizing enabled. Pool will not attempt to determine the upper and lower bounds that it should be using, and will stay at 1
    Feb 26, 2009 10:30:16 AM  
    SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for full support.
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
    Feb 26, 2009 10:30:18 AM  
    INFO: RAILS_ROOT /Users/arungupta/tools/jruby-1.2.0RC1/samples/rails/runner
    Feb 26, 2009 10:30:18 AM  
    INFO: PUBLIC_ROOT /Users/arungupta/tools/jruby-1.2.0RC1/samples/rails/runner/public
    Feb 26, 2009 10:30:19 AM com.sun.grizzly.pool.DynamicPool$1 run
    INFO: New instance created in 7,074 milliseconds
    Feb 26, 2009 10:30:19 AM com.sun.enterprise.v3.server.AppServerStartup run
    INFO: GlassFish v3  startup time : Static(525ms) startup services(7962ms) total(8487ms)
    Feb 26, 2009 10:30:19 AM com.sun.enterprise.glassfish.bootstrap.ASMainStatic start
    INFO: Started cache creation
    Feb 26, 2009 10:30:20 AM com.sun.enterprise.glassfish.bootstrap.ASMainStatic start
    INFO: Finished cache creation
    Feb 26, 2009 10:30:34 AM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO: 

    After adding few entries, the output at "http://localhost:3000/runners" looks like:



    So we are able to create a trivial Rails application and run it using GlassFish Gem, that passes Test#1.
The subsequent blogs will show the remainder of tests.

Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. A complete archive of all tips is available here.

Technorati: totd rubyonrails glassfish v3 jruby gem integrationtest

Tuesday Feb 03, 2009

LOTD #16: Hotspot Flags, JRuby Version String, and JRuby/MRI Benchmark


This post shares 3 links that were recently published.

The first one is about the Favorite Hotspot JVM Flags by Charlie. See how you can use them for tweaking performance or investigating runtime metrics.

The second one is about using JRuby Version String. It explains the detailed meaning of the version string printed by "jruby --version". If you read it carefully then you know the date, hardware, platform, SVN revision and even state of Charlie's local git-svn clone.

The third and the last one is about benchmark results between MRI and JRuby with the following summary:

From my tests it appears that MRI is faster in single threaded mode, but JRuby makes up for the loss big time in the multi-threaded tests. It's also interesting to see that the multi-threaded mode gives MRI(green threads) a performance boost, but it's nowhere close to the boost that JRuby(native threads) can squeeze out from using multiple threads.

Read Igor's report for more results.

And while you are reading this entry, did you know that GlassFish Gem 0.9.2 was recently released ? Use it for running your Rails applications seamlessly :)

All previous entries in this series are archived at LOTD.

Technorati: lotd glassfish v3 gem jruby ruby hotspot vm

Wednesday Dec 03, 2008

LOTD #15: Deploying Merb application on GlassFish v3 using Warbler


GlassFish v3 with Merb and Warbler explains how to use Warbler to deploy a Merb application on GlassFish v3. Here is a quote from the blog:

this lovely server had a gem which you can use to fire up a Glassfish server. Easy as pie and within no time at all we were developing our Merb app on Glassfish.

The blog requires some workaround for Warbler and Nick is planning to fix them in the next rev. And other workaround is required because of Webrat's recently introduced dependency on Nokogiri which does not run on JRuby yet.

In addition, TOTD #52 explains how to deploy a Merb application using GlassFish gem and TOTD #53 explains how to create a scaffold in Merb.

Submit your Merb/GlassFish bugs here, talk to us using GlassFish Forum, and get the latest information on JRuby wiki.

All previous entries in this series are archived at LOTD.

Technorati: lotd glassfish v3 gem warbler merb

Thursday Nov 20, 2008

TOTD #55: How to build GlassFish v3 Gem ?


GlassFish Gem is a light-weight and robust deployment solution for Ruby-on-Rails and Merb applications. The gem can be easily installed as:

gem install glassfish

for any JRuby runtime. Support for other Rack-based frameworks such as Sinatra is coming soon!

This Tip Of The Day (TOTD) explains how to build this gem if you like to understand the internals or hack it out:

svn co https://svn.dev.java.net/svn/glassfish-scripting/trunk/rails/v3/gem gem
cd gem
mvn -U clean install

And the generated gem is available at:

./target/dependency/glassfish/pkg/glassfish-0.9.0-universal-java.gem

Simple and easy!

TOTD #52 explains how gem can be used to run Rails or Merb applications.

Are you using GlassFish gem ? File bugs @ RubyForge and send feedback to GlassFish Webtier Forum.

Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. An archive of all the tips is available here.

Technorati:  totd glassfish v3 gem rubyonrails jruby
About

profile image
Arun Gupta is a technology enthusiast, a passionate runner, author, and a community guy who works for Oracle Corp.


Java EE 7 Samples

Stay Connected

Search

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