Skip to main content

Glassfish JRuby gem 0.3.0 released

Posted by vivekp on June 23, 2008 at 8:14 PM PDT

I just released GlassFish gem 0.3.0. This is a bug
fix release with few enhancements.

The issues fixed in this release are these and
these

There is one enhancement that I would like to mention here is that the Rails logger is wired to GlassFish gem logger so when
you run your Rails application using
jruby -S glassfish_rails yourappdir it will not only print GlassFish v3
gem logs but also Rails log.

Here is the log printed when a sample Rails application cookbook is deployed:

[prettify]
$jruby -S glassfish_rails cookbook/
Jun 23, 2008 7:02:47 PM com.sun.enterprise.glassfish.bootstrap.ASMain main
INFO: Launching GlassFish on HK2 platform
Jun 23, 2008 7:02:47 PM com.sun.enterprise.glassfish.bootstrap.ExtensibleClassLoader
INFO: Added file:/tools/jdk5/lib/tools.jar to shared classpath
Jun 23, 2008 7:02:47 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
INFO: Listening on port 3000
Jun 23, 2008 7:02:47 PM com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator configureSSL
WARNING: pewebcontainer.all_ssl_protocols_disabled
Jun 23, 2008 7:02:47 PM com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator configureSSL
WARNING: pewebcontainer.all_ssl_ciphers_disabled
Jun 23, 2008 7:02:47 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
INFO: Listening on port 3131
Jun 23, 2008 7:02:47 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
INFO: Listening on port 3838
Jun 23, 2008 7:02:47 PM com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter setContextRoot
INFO: Admin Console Adapter: context root: /admin
Jun 23, 2008 7:02:48 PM com.sun.grizzly.jruby.RailsAdapter startRubyRuntimePool
INFO: Starting Rails instances
Jun 23, 2008 7:02:52 PM
SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for full support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
Jun 23, 2008 7:02:53 PM com.sun.grizzly.jruby.RubyObjectPool$1 run
INFO: JRuby and Rails instance instantiation took : 4988ms
Jun 23, 2008 7:02:53 PM org.glassfish.scripting.rails.RailsDeployer load
INFO: Loading application cookbook at /
Jun 23, 2008 7:02:53 PM com.sun.enterprise.v3.server.AppServerStartup run
INFO: Glassfish v3 started in 5966 ms
[/prettify]

Accessing the application http://localhost:3000/recipes shows me the following Rails log that you would be printed at
log/development.log

[prettify]
Processing RecipesController#index (for 127.0.0.1 at 2008-06-23 19:02:57) [GET]

Jun 23, 2008 7:02:57 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
INFO:   Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo
SGFzaHsABjoKQHVzZWR7AA==--1fcc8bed80c5349246099b22244d1f5831fe8285

Jun 23, 2008 7:02:57 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
INFO:   Parameters: {"controller"=>"recipes", "action"=>"index"}

Jun 23, 2008 7:02:57 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
INFO: WARNING: You're using the Ruby-based MySQL library that ships with Rails. This library is not suited for production.
    Please install the C-based MySQL library instead (gem install mysql).

Jun 23, 2008 7:02:57 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
INFO:   SQL (0.000000)   SET NAMES 'utf8'

Jun 23, 2008 7:02:57 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
INFO:   SQL (0.001000)   SET SQL_AUTO_IS_NULL=0

Jun 23, 2008 7:02:57 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
INFO:   Recipe Load (0.010000)   SELECT * FROM `recipes`

Jun 23, 2008 7:02:57 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
INFO: Rendering template within layouts/application

Jun 23, 2008 7:02:57 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
INFO: Rendering recipes/index

Jun 23, 2008 7:02:57 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
INFO:   Recipe Columns (0.005000)   SHOW FIELDS FROM `recipes`

Jun 23, 2008 7:02:57 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
INFO:   Category Columns (0.005000)   SHOW FIELDS FROM `categories`

Jun 23, 2008 7:02:57 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
INFO:   Category Load (0.011000)   SELECT * FROM `categories` WHERE (`categories`.`id` = 2)

Jun 23, 2008 7:02:57 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
INFO: Completed in 0.18900 (5 reqs/sec) | Rendering: 0.13300 (70%) | DB: 0.03200 (16%) | 200 OK [http://localhost/recipes]
[/prettify]

To install simply do jruby -S gem install glassfish, if you have previous installation first uninstall it
using jruby -S gem uninstall glassfish and then install it.

Try it out and send your comments to forum or alias and report issues at the issue tracker.

Related Topics >>

Comments

My apologies but the good thing is that I am working on it. Let's see how soon I can make it work. Stay tuned...

I was hoping to see a -p option which would allow a port to be specified. This would make it easy to launch multiple applications on different ports. Is this feature in the works?

Thank you Vivek. This sounds great!