Skip to main content

Rails GlassFish Gem 0.3.1 now available

Posted by arungupta on June 25, 2008 at 6:39 AM PDT

Vivek href="http://weblogs.java.net/blog/vivekp/archive/2008/06/glassfish_jruby.html">released
0.3.0 version of GlassFish Gem for Rails (a total of 11 issues fixed
and resolved - href="http://rubyforge.org/tracker/?atid=21080&group_id=5450&func=browse">RubyForge
& href="https://glassfish.dev.java.net/issues/buglist.cgi?component=glassfish&subcomponent=jruby&issue_status=RESOLVED&resolution=FIXED&email1=vivekp&emailtype1=exact&emailassigned_to1=1&email2=&emailtype2=exact&emailreporter2=1&issueidtype=include&issue_id=&changedin=&votes=&chfield=resolution&chfieldfrom=2008-05-01&chfieldto=Now&chfieldvalue=FIXED&short_desc=&short_desc_type=fulltext&long_desc=&long_desc_type=fulltext&issue_file_loc=&issue_file_loc_type=fulltext&status_whiteboard=&status_whiteboard_type=fulltext&keywords=&keywords_type=anytokens&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&Submit+query=Submit+query">GlassFish
Issue Tracker) earlier. But that caused a regression
on href="https://glassfish.dev.java.net/issues/show_bug.cgi?id=4228">#4228.
And so matching the agility expected by Rails developers, he quickly href="http://weblogs.java.net/blog/vivekp/archive/2008/06/quick_update_to.html">released
0.3.1. And a wee bit smaller too - 2.68MB for 0.3.1
instead of 2.69MB for 0.3.0.



If you have an existing version of the gem, then you just need to
update it:


cellspacing="2">
style="font-family: monospace;">~/testbed/jruby-1.1 > style="font-weight: bold;">bin/jruby -S gem update glassfish
-r

JRuby limited openssl loaded. gem install jruby-openssl for full
support.

http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL

Updating installed gems...

Bulk updating Gem source index for: http://gems.rubyforge.org

Attempting remote update of glassfish

Successfully installed glassfish-0.3.1-universal-java

1 gem installed

Gems updated: glassfish style="font-family: monospace;">



If the gem has never been installed, then you install it as:


cellspacing="2">
style="font-family: monospace;">~/testbed/jruby-1.1.2
>bin/jruby -S gem
install glassfish


JRuby limited openssl loaded. gem install jruby-openssl for full
support.

http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL

Successfully installed glassfish-0.3.1-universal-java

1 gem installed



And make sure next time you have to update the gem instead of
installing from scratch ;) For that, just install the gem this time and
let us know your feedback on href="http://forums.java.net/jive/forum.jspa?forumID=138">GlassFish
Webtier Forum or Webtier
Alias
. If any of your Rails application do not work then
please file bugs at href="https://glassfish.dev.java.net/issues/enter_bug.cgi?issue_type=DEFECT">GlassFish
Issue Tracker ("V3" as "Found in Version:" and "jruby" as
"Subcomponent:").



The gem installation may require to set "JAVA_MEM=-Xmx800m" because of
the href="http://archive.jruby.codehaus.org/user/3454c9680806241353v3a74f554m88894de415003d9c%40mail.gmail.com">growing
memory
requirements. Otherwise you may get " style="font-family: monospace;">Exception in thread "main"
java.lang.OutOfMemoryError: Java heap space".



Try a href="http://blogs.sun.com/arungupta/entry/rails_2_1_on_glassfish">simple
scaffold application to see the output as shown below:

src="http://blogs.sun.com/arungupta/resource/ror/v3-gem-031-runners-output.png">



The startup output in the gem console (output from GlassFish) is:


cellspacing="2">
style="font-family: monospace;">~/testbed/jruby-1.1.2/samples/rails
>../../bin/jruby -S glassfish_rails runner

Jun 24, 2008 11:04:51 PM com.sun.enterprise.glassfish.bootstrap.ASMain
main

INFO: Launching GlassFish on HK2 platform

Jun 24, 2008 11:04:51 PM
com.sun.enterprise.glassfish.bootstrap.ASMainHK2 findDerbyClient

INFO: Cannot find javadb client jar file, jdbc driver not available

Jun 24, 2008 11:04:52 PM
com.sun.enterprise.v3.services.impl.GrizzlyProxy start

INFO: Listening on port 3000

Jun 24, 2008 11:04:52 PM
com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator
configureSSL

WARNING: pewebcontainer.all_ssl_protocols_disabled

Jun 24, 2008 11:04:52 PM
com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator
configureSSL

WARNING: pewebcontainer.all_ssl_ciphers_disabled

Jun 24, 2008 11:04:52 PM
com.sun.enterprise.v3.services.impl.GrizzlyProxy start

INFO: Listening on port 3131

Jun 24, 2008 11:04:52 PM
com.sun.enterprise.v3.services.impl.GrizzlyProxy start

INFO: Listening on port 3838

Jun 24, 2008 11:04:52 PM
com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter setContextRoot

INFO: Admin Console Adapter: context root: /admin

Jun 24, 2008 11:04:52 PM com.sun.grizzly.jruby.RailsAdapter
startRubyRuntimePool

INFO: Starting Rails instances

Jun 24, 2008 11:04:58 PM 

SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for
full support.

http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL

Jun 24, 2008 11:04:59 PM com.sun.grizzly.jruby.RubyObjectPool$1 run

INFO: JRuby and Rails instance instantiation took : 6600ms

Jun 24, 2008 11:04:59 PM org.glassfish.scripting.rails.RailsDeployer
load

INFO: Loading application runner at /

Jun 24, 2008 11:04:59 PM com.sun.enterprise.v3.server.AppServerStartup
run

INFO: Glassfish v3 started in 7945 ms style="font-family: monospace;">



and then the console is updated as more entries are added (output from
Rails):


cellspacing="2">
style="font-family: monospace;">Jun 24, 2008 11:05:25 PM
com.sun.grizzly.jruby.RailsAdapter$Logger log style="font-family: monospace;">
INFO: style="font-family: monospace;">


Processing
DistancesController#index (for 0:0:0:0:0:0:0:1%0 at 2008-06-24
23:05:25) [GET]




Jun 24, 2008
11:05:25 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo
style="font-family: monospace;">
SGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlNTdhMGYxNjkxOTk5ZjI1ZjI4 style="font-family: monospace;">
OGZjODZjZjcxN2QyNzQ=--cbf4578767e5887d4b62bd249e7624dcb7d1cf90 style="font-family: monospace;">


Jun 24, 2008
11:05:25 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
Parameters: {"controller"=>"distances", "action"=>"index"}
style="font-family: monospace;">


Jun 24, 2008
11:05:25 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
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).
style="font-family: monospace;">


Jun 24, 2008
11:05:25 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
SQL (0.001000)   SET NAMES 'utf8'
style="font-family: monospace;">


Jun 24, 2008
11:05:25 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
SQL (0.001000)   SET SQL_AUTO_IS_NULL=0
style="font-family: monospace;">


Jun 24, 2008
11:05:25 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
Distance Load (0.003000)   SELECT * FROM `distances`
style="font-family: monospace;">


Jun 24, 2008
11:05:25 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:
Rendering template within layouts/distances
style="font-family: monospace;">


. . . style="font-family: monospace;">
style="font-family: monospace;">
Jun 24, 2008
11:05:48 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
Parameters:
{"authenticity_token"=>"519436f2248515d901051acafe0726dfd88746f0",
"distance"=>{"miles"=>"4", "run_at(1i)"=>"2008",
"run_at(2i)"=>"6", "run_at(3i)"=>"24",
"run_at(4i)"=>"07", "run_at(5i)"=>"00"},
"commit"=>"Create", "controller"=>"distances",
"action"=>"create"}
style="font-family: monospace;">


Jun 24, 2008
11:05:48 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
Distance Columns (0.009000)   SHOW FIELDS FROM
`distances`




Jun 24, 2008
11:05:48 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
SQL (0.000000)   BEGIN
style="font-family: monospace;">


Jun 24, 2008
11:05:48 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
Distance Create (0.000000)   INSERT INTO `distances`
(`miles`, `run_at`, `created_at`, `updated_at`) VALUES(4.0, '2008-06-24
14:00:00', '2008-06-25 06:05:48', '2008-06-25 06:05:48')
style="font-family: monospace;">


Jun 24, 2008
11:05:48 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
SQL (0.002000)   COMMIT
style="font-family: monospace;">


. . .

style="font-family: monospace;">
Jun 24, 2008
11:06:09 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
Parameters:
{"authenticity_token"=>"519436f2248515d901051acafe0726dfd88746f0",
"distance"=>{"miles"=>"3.5", "run_at(1i)"=>"2008",
"run_at(2i)"=>"6", "run_at(3i)"=>"23",
"run_at(4i)"=>"06", "run_at(5i)"=>"55"},
"commit"=>"Create", "controller"=>"distances",
"action"=>"create"}
style="font-family: monospace;">


Jun 24, 2008
11:06:09 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
Distance Columns (0.015000)   SHOW FIELDS FROM
`distances`




Jun 24, 2008
11:06:09 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
SQL (0.000000)   BEGIN
style="font-family: monospace;">


Jun 24, 2008
11:06:09 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
Distance Create (0.000000)   INSERT INTO `distances`
(`miles`, `run_at`, `created_at`, `updated_at`) VALUES(3.5, '2008-06-23
13:55:00', '2008-06-25 06:06:09', '2008-06-25 06:06:09')
style="font-family: monospace;">


Jun 24, 2008
11:06:09 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
SQL (0.001000)   COMMIT
style="font-family: monospace;">


Jun 24, 2008
11:06:09 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:
Redirected to http://localhost:3000/distances/5
style="font-family: monospace;">


. . . style="font-family: monospace;"> style="font-family: monospace;">


Jun 24, 2008
11:06:10 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
Parameters: {"controller"=>"distances", "action"=>"index"}
style="font-family: monospace;">


Jun 24, 2008
11:06:10 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
Distance Load (0.003000)   SELECT * FROM `distances`
style="font-family: monospace;">


Jun 24, 2008
11:06:10 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:
Rendering template within layouts/distances
style="font-family: monospace;">


Jun 24, 2008
11:06:10 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:
Rendering distances/index
style="font-family: monospace;">


Jun 24, 2008
11:06:10 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:  
Distance Columns (0.008000)   SHOW FIELDS FROM
`distances`




Jun 24, 2008
11:06:11 PM com.sun.grizzly.jruby.RailsAdapter$Logger log
style="font-family: monospace;">
INFO:
Completed in 0.05900 (16 reqs/sec) | Rendering: 0.03200 (54%) | DB:
0.01100 (18%) | 200 OK [http://localhost/distances]



Redmine
seems to have href="http://www.redmine.org/boards/1/topics/show/1187">issues
with Rails 2.1. I'll play with some other applications later. But have
you tried deploying your Rails application on GlassFish gem ? As
mentioned above, let us know your feedback on href="http://forums.java.net/jive/forum.jspa?forumID=138">GlassFish
Webtier Forum or Webtier
Alias
and file bugs on href="https://glassfish.dev.java.net/issues/enter_bug.cgi?issue_type=DEFECT">GlassFish
Issue Tracker.



Details about previous versions are available at href="http://blogs.sun.com/arungupta/entry/glassfish_v3_gem_0_2">0.2.0,
0.1.2,
0.1.1,
href="http://blogs.sun.com/arungupta/entry/glassfish_v3_ruby_gem_new">0.1.0.




Technorati: glassfish
v3 href="http://technorati.com/tag/rubyonrails">rubyonrails
jruby href="http://technorati.com/tag/ruby">ruby href="http://technorati.com/tag/gem">gem

Related Topics >>