Tuesday May 05, 2009
Sea Change Affinity - Why JRuby/GlassFish ?
At Rails Conf
2009, Jay
McGaffigan from Sea
Change talked about why they choose JRuby/GlassFish for their
product Affinity.
Here are some of the reasons he quoted:
Posted by Arun Gupta in web2.0 | Comments[1]
|
|
|
|
|
Monday May 04, 2009
Rails Conf 2009 - Day 1 Trip Report
Rails Conf 2009 started this morning. The first day consists of morning
and afternoon tutorials.
I attended Nick Sieger's JRuby
on Rails tutorial, the slides are available.
A survey in the room showed:
| run
lambda { |env| [ 200, { 'Content-Length' => '2', 'Content-Type' => 'text/html', }, ["hi"] ] } |
| ~/samples/railsconf/sinatra/basic-rack
>~/tools/jruby/bin/jruby
-S rackup [2009-05-04 13:40:18] INFO WEBrick 1.3.1 [2009-05-04 13:40:18] INFO ruby 1.8.6 (2009-03-16) [java] [2009-05-04 13:40:18] INFO WEBrick::HTTPServer#start: pid=90964 port=9292 127.0.0.1 - - [04/May/2009 13:40:27] "GET / HTTP/1.1" 200 2 0.0160 127.0.0.1 - - [04/May/2009 13:40:27] "GET /favicon.ico HTTP/1.1" 200 2 0.0060 127.0.0.1 - - [04/May/2009 13:40:30] "GET /favicon.ico HTTP/1.1" 200 2 0.0100 |
| App
= lambda { |env| [ 200, { 'Content-Length' => '2', 'Content-Type' => 'text/html', }, ["hi"] ] } |
| ~/samples/railsconf/sinatra/basic-rack
>~/tools/jruby/bin/jruby
-S rackup app.rb [2009-05-04 13:43:57] INFO WEBrick 1.3.1 [2009-05-04 13:43:57] INFO ruby 1.8.6 (2009-03-16) [java] [2009-05-04 13:43:57] INFO WEBrick::HTTPServer#start: pid=90990 port=9292 127.0.0.1 - - [04/May/2009 13:44:09] "GET / HTTP/1.1" 200 2 0.0110 |
| class
BasicRack def call(env) body = "Hello from a class" [ 200, { 'Content-Length' => body.size.to_s, 'Content-Type' => 'text/html', }, [body] ] end end run BasicRack.new |

| ~/samples/railsconf/sinatra/basic-rack
>~/tools/jruby/bin/jruby -S gem install shotgun JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Successfully installed configuration-0.0.5 Successfully installed launchy-0.3.3 Successfully installed shotgun-0.2 3 gems installed Installing ri documentation for launchy-0.3.3... Installing RDoc documentation for launchy-0.3.3... |
| ~/samples/railsconf/sinatra/basic-rack
>~/tools/jruby/bin/jruby -J-Djruby.fork.enabled=true -S shotgun [2009-05-04 13:55:46] INFO WEBrick 1.3.1 [2009-05-04 13:55:46] INFO ruby 1.8.6 (2009-03-16) [java] == Shotgun starting Rack::Handler::WEBrick on localhost:9393 [2009-05-04 13:55:46] INFO WEBrick::HTTPServer#start: pid=91089 port=9393 |
| class
BasicRack def call(env) body = if env["PATH_INFO"] == "/foo" "in foo" else "in other" end [ 200, { 'Content-Length' => body.size.to_s, 'Content-Type' => 'text/html', }, [body] ] end end run BasicRack.new |
| class
BasicRackApp def call(env) body = "hello from app" [ 200, { 'Content-Length' => body.size.to_s, 'Content-Type' => 'text/html', }, [body] ] end end class MyMiddleware def initialize(app) @app = app end def call(env) @app.call(env) end end use MyMiddleware run BasicRackApp.new |
| use Rack::CommonLogger |
|
def call(env) status, headers, body = @app.call(env) body.map! { |part| part.upcase} [status, headers, body] end |
| require
'sinatra' |
| ~/samples/railsconf/sinatra/basic-sinatra
>~/tools/jruby/bin/jruby
-rubygems basic-sinatra.rb == Sinatra/0.9.1.1 has taken the stage on 4567 for development with backup from WEBrick [2009-05-04 14:40:14] INFO WEBrick 1.3.1 [2009-05-04 14:40:14] INFO ruby 1.8.6 (2009-03-16) [java] [2009-05-04 14:40:14] INFO WEBrick::HTTPServer#start: pid=91396 port=4567 |
| require
'rubygems' require 'sinatra' not_found do 'hi from other' end get '/foo' do 'hi from foo' end |
| require
'rubygems' require 'sinatra' get '/env' do env.inspect end |
| require
'rubygems' require 'sinatra' get '/' do end post '/' do end put '/' do end delete '/' do end |
| require
'rubygems' require 'sinatra' get '/' do content_type "application/json" { "foo" => "goo" }.to_json end |
| <html> <body> Hello form Sinatra + ERB </body> </html> |
| require
'rubygems' require 'sinatra' get '/' do erb :index end |
| require
'rubygems' require 'sinatra' require 'haml' get '/' do haml :index end |
| %html %body %h1 Hello from HAML |
| require
'rubygems' require 'sinatra' require 'haml' get '/' do erb :index end use_in_file_templates! __END__ @@ index <html> <body> Hello form Sinatra + ERB in file </body> </html> |
| require
'rubygems' require 'sinatra' require 'haml' get '/' do erb :index end get '/foo' do erb :foo end use_in_file_templates! __END__ @@ index <html> <body> Hello form Sinatra + ERB in file </body> </html> @@ foo <h1>FOO!</h1> |
| require
'rubygems' require 'sinatra' require 'haml' helpers do end |
| require
'rubygems' require 'sinatra' require 'haml' module helpers def self.dosomething(arg) end end get '/' do Helpers.dosomething end |
TOTD #81: How to configure "database.yml" to be used with both JRuby and MRI ?
In JRuby-on-Rails
tutorial at Rails
Conf 2009, Nick
Sieger shared a nice little tip on how to configure
"database.yml" to be usable with both JRuby and MRI:
| <% jdbc = defined?(JRUBY_VERSION) ? 'jdbc' : ''
%> development: adapter: <%= jdbc %>mysql encoding: utf8 reconnect: false database: myapp_development pool: 5 username: root password: socket: /tmp/mysql.sock # ... |
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Friday May 01, 2009
JRuby, Rails, and GlassFish Bootcamp - San Francisco, May 19/20, 2009
![]() |
Would you like to power up your Rails
applications using JRuby
and GlassFish ?
And learn that from the engineers who develop the technology. If yes, then we have organized a bootcamp for you! |
Posted by Arun Gupta in web2.0 | Comments[0]
|
|
|
|
|
Thursday April 30, 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. |
| ~/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 |

| ~/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 |
| ~/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. |
| ~/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. |
| ~/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. |
| upstream
glassfish { server 127.0.0.1:3000; server 127.0.0.1:3001; server 127.0.0.1:3002; } |

| proxy_pass http://glassfish; |

| sudo
kill -15 `cat /usr/local/nginx/logs/nginx.pid` sudo nginx |

| 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; |
| 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" "-" |
| 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" "-" |
Posted by Arun Gupta in web2.0 | Comments[8]
|
|
|
|
|
Monday April 27, 2009
GlassFish, NetBeans, and Project Kenai at Rails Conf 2009
Did you know that ...
![]() |
|
![]() |
Develop
with pleasure, Deploy with Fun: GlassFish and NetBeans for a better
Rails experience Tuesday, May 5th, 2009, 1:50pm Pavilion 1 |
| And you'll get to meet Project Kenai team, they form the foundation for Sun's connected developer experience. Read about their participation here and meet them to learn about NetBeans and Kenai integration. | ![]() |
Posted by Arun Gupta in General | Comments[5]
|
|
|
|
|
Wednesday April 22, 2009
LOTD #21: Production Deployment Tips for running Rails on GlassFish v2 using Windows
SeaChange
Affinity uses Rails and GlassFish
as their deployment platform. One of their core developers posted
tips based upon their experience so far and they are
available at:
Rails
on GlassFish v2 using Windows
Here are some of the quotes:
Glassfish can really
handle a heavy load
and
handling 400
simultaneous users under a supremely heavy load, the
memory was holding great
All previous links in this series are archived at LOTD.
Technorati: lotd
glassfish
jruby
rubyonrails
windows
Posted by Arun Gupta in web2.0 | Comments[0]
|
|
|
|
|
Thursday April 02, 2009
Silicon Valley Rails Meetup, Mar 2009 - Slides & Pics
I presented at Silicon Valley Rails Meetup yesterday.
The official attendance says 79 and the kitchen area (for the
presentation) was indeed packed!
The
demo gods were hovering very much around and required me to reboot the
machine - live during the presentation. Have you ever rebooted Mac
because of a slow performance, smack in the middle of a demo ? ;-)
Here is a quote from the meetup:
The big win with
glassfish is that it gives you the same environment in deployment and
development.
The slides are available here.
And some pointers to get more information:


Posted by Arun Gupta in web2.0 | Comments[7]
|
|
|
|
|
Tuesday March 31, 2009
ISV & OEMs Webinar Replay: GlassFish- and MySQL-Backed Applications with Netbeans and JRuby-on-Rails
I presented a webinar for ISV and OEMs on "Developing
GlassFish- and MySQL-Backed Applications with NetBeans and
JRuby-on-Rails" last
week.

The slides and a complete recording
of the webinar are now available here.
Technorati: webinar
glassfish
mysql netbeans
jruby rubyonrails
Posted by Arun Gupta in web2.0 | Comments[3]
|
|
|
|
|
Monday March 30, 2009
GlassFish at Silicon Valley Rails Meetup
![]() |
Want to know how NetBeans
and GlassFish
provide a better Rails experience ? I'll be speaking at Silicon Valley Rails Meetup on Mar 31st (tomorrow), 7pm, more details here. It will also be a brief preview of my upcoming Rails Conf talk. |

Posted by Arun Gupta in web2.0 | Comments[1]
|
|
|
|
|
Monday March 23, 2009
This is a re-run of an earlier
webinar.
Would you like to know how JRuby,NetBeans, GlassFish, and MySQL can power your Rails
applications ?

This informative
technical webinar explains the fundamentals of JRuby and how
the NetBeans IDE makes developing/debugging/deploying Rails
applications on GlassFish quick, fun and cost-effective.
The webinar starts 10am PT on Mar 31st, 2009 and can be accessed from a
browser.
Register here.
Technorati: jruby
rubyonrails
glassfish
netbeans
mysql webinar
Posted by Arun Gupta in web2.0 | Comments[2]
|
|
|
|
|
Friday March 20, 2009
Oh, what a week for the JRuby, Rails, and GlassFish enthusiasts!
JRuby
1.2, Rails
2.3, GlassFish
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... |
| ~/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 |
| ~/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 |
| ~/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... |
| ~/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 |
| development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 |
| development: adapter: jdbcsqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 |
| ActionController::Base.session_store = :active_record_store |
| config.webxml.jruby.session_store = 'db' |
| 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 |
| 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 |
Posted by Arun Gupta in web2.0 | Comments[1]
|
|
|
|
|
Monday March 16, 2009
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.
| /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. |
| ~/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) =========================== |
| ~/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) |







Posted by Arun Gupta in web2.0 | Comments[0]
|
|
|
|
|
Friday March 13, 2009
JRuby, Rails, and GlassFish - "Easiest Rails stack in the world"!!!
@grantmichaels
is one happy JRuby/Rails/GlassFish user. Here
are some of his comments ...
http://twitpic.com/22b5o
- the easiest rails stack in the world, jruby 1.2rc, rails 2.3rc,
glassfish v3 - (tweeted
here)
and
@arungupta had
wiped/restated one of my linodes to refront w/ nginx instead of
passenger and it took only 1-2 mins to setup jruby/glassfish
- (tweeted
here)
and
@arungupta can only have
praise for how simple it is to get a working, deployable
jruby/rack/glassfish stack for sinatra/rails/ramaze etc - (tweeted
here)
and
too easy to run
jruby/rack/glassfish behind nginx - going to bed a happy camper tonight
... (tweeted
here)
We are very happy to know that users find JRuby and GlassFish
easy-to-use for running their Rails applications!
Want to know who else is using GlassFish and Rails together ? Read
here.
Did you know that you even deploy your Merb and Grails applications on
GlassFish ? glassfish-scripting.dev.java.net
provides all the details.
Technorati: glassfish
jruby
rubyonrails
stories
Posted by Arun Gupta in web2.0 | Comments[4]
|
|
|
|
|
Wednesday March 11, 2009
TOTD
#70, #71,
#72
shows the first three 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. #72
showed how to deploy the same application on GlassFish v3.
The next test in the series is to ensure WAR-based deployment of a
Rails application continue to work on GlassFish v2. It also shows that
JNDI database connection pooling also work as expected. The latest
publicly
available build is GlassFish
v2.1.
Lets begin integration test #4.
| ~/tools/jruby-1.2.0RC2/samples/rails/runner
>../../../bin/jruby
-S gem install warbler JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Successfully installed warbler-0.9.12 1 gem installed Installing ri documentation for warbler-0.9.12... Installing RDoc documentation for warbler-0.9.12... |
| production: adapter: mysql encoding: utf8 database: runner_production pool: 5 username: root password: socket: /tmp/mysql.sock |
| production: adapter: jdbcmysql encoding: utf8 database: runner_production pool: 5 username: duke password: glassfish socket: /tmp/mysql.sock jndi: jdbc/runner_production driver: com.mysql.jdbc.Driver |
| ~/tools/jruby-1.2.0RC1/samples/rails/runner >../../../bin/jruby -S rake
db:create RAILS_ENV=production (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 RAILS_ENV=production (in /Users/arungupta/tools/jruby-1.2.0RC1/samples/rails/runner) == CreateRunners: migrating ================================================== -- create_table(:runners) -> 0.1150s -> 0 rows == CreateRunners: migrated (0.1170s) ========================================= |
| ~/tools/glassfish/v2.1/glassfish/ >cp ~/tools/mysql-connector-java-5.1.6/mysql-connector-java-5.1.6-bin.jar ./lib |
| ~/tools/glassfish/v2.1/glassfish/bin
>./asadmin
start-domain Starting Domain domain1, please wait. Default Log location is /Users/arungupta/tools/glassfish/v2.1/glassfish/domains/domain1/logs/server.log. Redirecting output to /Users/arungupta/tools/glassfish/v2.1/glassfish/domains/domain1/logs/server.log Domain domain1 started. Domain [domain1] is running [Sun GlassFish Enterprise Server v2.1 (9.1.1) (build b60e-fcs)] with its configuration and logs at: [/Users/arungupta/tools/glassfish/v2.1/glassfish/domains]. Admin Console is available at [http://localhost:4848]. Use the same port [4848] for "asadmin" commands. User web applications are available at these URLs: [http://localhost:8080 https://localhost:8181 ]. Following web-contexts are available: [/web1 /__wstx-services runner ]. Standard JMX Clients (like JConsole) can connect to JMXServiceURL: [service:jmx:rmi:///jndi/rmi://Macintosh-187.local:8686/jmxrmi] for domain management purposes. Domain listens on at least following ports for connections: [8080 8181 4848 3700 3820 3920 8686 ]. Domain supports application server clusters and other standalone instances. |
| ~/tools/glassfish/v2.1/glassfish/bin >./asadmin
create-jdbc-connection-pool --datasourceclassname
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --restype
javax.sql.DataSource --property
"User=duke:Password=glassfish:URL=jdbc\:mysql\://localhost/runner_production"
jdbc/runner_pool Command create-jdbc-connection-pool executed successfully. |
| ~/tools/glassfish/v2.1/glassfish/bin >./asadmin create-jdbc-resource
--connectionpoolid jdbc/runner_pool jdbc/runner_production Command create-jdbc-resource executed successfully. |
| ~/tools/jruby-1.2.0RC2/samples/rails/runner >../../../bin/jruby -S warble
config cp /Users/arungupta/tools/jruby-1.2.0RC2/lib/ruby/gems/1.8/gems/warbler-0.9.12/generators/warble/templates/warble.rb config/warble.rb |
| # Include all gems which are used by the
web application require "#{RAILS_ROOT}/config/environment" BUILD_GEMS = %w(warbler rake rcov) for gem in Gem.loaded_specs.values next if BUILD_GEMS.include?(gem.name) config.gems[gem.name] = gem.version.version end |
| config.gems += ["activerecord-jdbc-adapter"] |
| ~/tools/jruby-1.2.0RC2/samples/rails/runner >../../../bin/jruby -S warble mkdir -p tmp/war/WEB-INF/gems/specifications cp /Users/arungupta/tools/jruby-1.2.0RC2/lib/ruby/gems/1.8/specifications/rails-2.2.2.gemspec tmp/war/WEB-INF/gems/specifications/rails-2.2.2.gemspec mkdir -p tmp/war/WEB-INF/gems/gems . . . cp public/javascripts/prototype.js tmp/war/javascripts/prototype.js cp public/stylesheets/scaffold.css tmp/war/stylesheets/scaffold.css mkdir -p tmp/war/WEB-INF |
| ~/tools/jruby-1.2.0RC2/samples/rails/runner >~/tools/glassfish/v2.1/glassfish/bin/asadmin
deploy runner.war Command deploy executed successfully. |

Posted by Arun Gupta in web2.0 | Comments[4]
|
|
|
|
|
Today's Page Hits: 2381
Total # blog entries: 1009