Miles to go ...

Arun Gupta is a Technology Evangelist for Web Services and Web 2.0 Apps at Sun. He was the spec lead for APIs in the Java platform, committer in multiple Open Source projects, participated in standard bodies and contributed to Java EE and SE releases.
Main | Next page »

http://blogs.sun.com/arungupta/date/20080927 Saturday September 27, 2008

LOTD #9: Advantages of JRuby over MRI


Andreas blogged about why he likes JRuby even though he dislikes Java.

JRuby is "It's just Ruby" with more than 50,000 tests to ensure MRI compliance. The blog highlights that there is no need to know Java, at all, to run JRuby. Here are some advantages that are described in the blog:

  1. JVM runtime optimization
  2. Efficient memory usage
  3. Native threads to spread work on multiple cores
  4. Great garbage collection to make memory usage more efficient
  5. JIT and AOT compilation
  6. Inegration with Java libraries
  7. Running Rails applications on existing Java application servers
  8. Documentation and specs
Read more details here.

Do you know Rails applications can be deployed (without any packaging) on GlassFish v3 ? Check out more details here.

Technorati: lotd jruby ruby rubyonrails glassfish

del.icio.us | furl | simpy | slashdot | technorati | digg

http://blogs.sun.com/arungupta/date/20080923 Tuesday September 23, 2008

LOTD #9: Slides for Deploying and Monitoring Ruby on Rails Tutorial @ Rails Conf Europe 2008


During Rails Conf Europe 2008 Day 1 I attended an excellent tutorial on Deploying and Monitoring Ruby on Rails. The session very clearly explained the several deployment options with Rails. My notes from the session are here and the slides are now available

Here are couple of snapshots from the slide:





The complete set of slides from Rails Conf Europe 2008 are available here.

Technorati: conf railsconf glassfish deployment rubyonrails berlin

del.icio.us | furl | simpy | slashdot | technorati | digg

http://blogs.sun.com/arungupta/date/20080911 Thursday September 11, 2008

Kenai - High Throughput and Scalable Rails on GlassFish



Kenai (pronounced 'keen-eye') is a fictional character from Disney's Brother Bear series. It's also a river, mountain range, national park, peninsula and a city in the southern coast of Alaska in the United States. But that's got nothing to do (as much as I know) with either Rails or GlassFish.




But Project Kenai was announced last week. It's a developer hub with SCM, issue tracking, forums and similar stuff you need for hosting your open source projects. And it is a Rails application deployed on GlassFish v2. 

Read all about it in an interview with the lead developer Nick Sieger. Fernando gave a great overview (slides here), with excellent tuning tips for Rails on GlassFish, in Rails Conf Europe last week.

Other Rails on GlassFish success stories are described here.

And if you want, enjoy this beautiful video of Kenai National Wildlife Refuge.



Technorati: rubyonrails jruby ruby glassfish stories kenai

del.icio.us | furl | simpy | slashdot | technorati | digg

http://blogs.sun.com/arungupta/date/20080908 Monday September 08, 2008

TOTD #44: JDBC Connection Pooling for Rails on GlassFish v3


TOTD #9 explained how to configure JDBC connection pooling for Rails application deployed on GlassFish v2. There are several benefits of using using the JDBC connection pools:

  • No need to create a new database connection for each Rails instance.
  • No need to specify your password in database.yml or create a hack to hide it.
  • No garbage collection of connection after each use.
And because of the above mentioned (and other reasons) an improved application performance, scalability and efficiency.
The only way to deploy a Rails application on GlassFish v2 is to create a WAR file using Warbler. That's a great option and is already used in production mode. GlassFish v3 takes that to the next level by allowing to deploy a Rails application without any further pacakging. This TOTD (Tip Of The Day explains how to achieve database connection pooling using GlassFish v3.
  1. Lets create a simple scaffold

    ~/samples/jruby >~/tools/jruby-1.1.3/bin/jruby -S rails jndi_rails2 -d mysql
    ~/samples/jruby/jndi_rails2 >~/tools/jruby-1.1.3/bin/jruby script/generate scaffold runner miles:float minutes:integer
    ~/samples/jruby/jndi_rails2 >~/tools/jruby-1.1.3/bin/jruby -S rake db:create
    ~/samples/jruby/jndi_rails2 >~/tools/jruby-1.1.3/bin/jruby -S rake db:migrate
  2. Install MySQL ActiveRecord JDBC adapter

    ~/samples/jruby/jndi_rails2 >~/tools/jruby-1.1.3/bin/jruby -S gem install activerecord-jdbcmysql-adapter
  3. Copy MySQL Connector/J jar to JAVA_HOME/lib/ext

    ~/samples/jruby/jndi_rails2 >sudo cp ~/tools/mysql-connector-java-5.1.6/mysql-connector-java-5.1.6-bin.jar /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/lib/ext
  4. Start GlassFish v3 server as ...

    ~/tools/glassfish/v3/b23/glassfishv3-prelude/glassfish >java -Xmx512m -DJRUBY_HOME=/Users/arungupta/tools/jruby-1.1.3 -jar modules/glassfish-10.0-SNAPSHOT.jar
  5. Setup JDBC connection pool
    1. Create JDBC connection pool

      ~/samples/jruby/jndi_rails2 >~/tools/glassfish/v3/b23/glassfishv3-prelude/glassfish/bin/asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --restype javax.sql.DataSource --property "User=duke:Password=duke:URL=jdbc\:mysql\://localhost/jndi_rails2_production" jdbc/jndi_rails2_pool 
    2. Create JDBC resource

      ~/samples/jruby/jndi_rails2 >~/tools/glassfish/v3/b23/glassfishv3-prelude/glassfish/bin/asadmin create-jdbc-resource --connectionpoolid jdbc/jndi_rails2_pool jdbc/jndi_rails2 
    3. Ping JDBC pool

      ~/samples/jruby >~/tools/glassfish/v3/b23/glassfishv3-prelude/glassfish/bin/asadmin ping-connection-pool jdbc/jndi_rails2_pool 
  6. Change the development database in config/database.yml to:

    development:
      adapter: jdbc
      jndi: jdbc/jndi_rails2
      driver: com.mysql.jdbc.Driver 
  7. Run your app as

    ~/samples/jruby >~/tools/glassfish/v3/b22/glassfishv3-prelude/glassfish/bin/asadmin deploy jndi_rails2
And chug along with your scaffold at http://localhost:8080/jndi_rails2/runners.

Technorati: totd rubyonrails jruby ruby glassfish v3 connectionpooling jndi jdbc mysql

del.icio.us | furl | simpy | slashdot | technorati | digg

http://blogs.sun.com/arungupta/date/20080905 Friday September 05, 2008

Rails Conf Europe 2008 - Day 3


Last day of Rails Conf Europe 2008 (Day 1 & Day 2), and it's finally over!

David Black's opening session talked about Ruby and Rails Symposium: Versions, Implementations, and the Future. Here is a brief summary of MRI Ruby versions:

  • Ruby 1.8.6
    • Bread and butter for many of us
  • 1.8.7
    • 1.8 with lots of backported 1.9 features
    • Help with migration to 1.9
    • Not gaining traction, is it ?
  • 1.9.0
    • First release of 1.9
    • Not particularly feature stable
    • Not in wide production use.
  • 1.9.1
    • Feature freeze 9/25
    • Release Christmas 2008 (planned)
    • Expected to be more stable
The talk showed some of the new features coming up in Ruby 1.9.x. An informal survey of audience indicated the following numbers:
  • 4 - How many are using 1.8.7 ?
  • 98% - How many are using 1.8.6 ?
  • 1 - How many are using 1.9.0 ?
  • 4 - Tried 1.8.7 and not switching
  • 3 - Tried 1.9 and not switching
  • 85% - Never tried 1.9
JRuby is an alternative implementation of Ruby that runs on Java VM.  And when prompted, I quoted all the JRuby numbers (75% memory improvement with upcoming Rails 2.2, 33,000 assertions from Ruby Spec and 22,000 tests for Ruby 1.8.6 compliance, Ongoing work on Ruby 1.9 compliance). JRuby "It's just Ruby" - knowing Java is not a pre-requisite to run JRuby for your Ruby or Rails applications!

In Developing Ruby and Rails applications with the NetBeans IDE talk, Erno & Petr showed all the cool features of Ruby/Rails editing, syntax highlighting, debugging, project creation, refactoring and many more. You can find all about it here.

Rails powered by GlassFish talk was well attended. The slides are available here and if you attended the session, please rate it here. I value your feedback. Some of the excerpts from the talk are:
Let us know by sending an email to webtier@glassfish.dev.java.net if you are using JRuby or GlassFish or JRuby and GlassFish in production. We'll be happy to feature you on blogs.sun.com/stories.

Rails 2.0.4 and 2.1.1 were released during the conference. Now I need to start working on all the different blogs promised earlier this week :)

Here are some pictures from Day 3:






And finally the complete photo album:




Next stop - Braaaazzzil!

Technorati: conf railsconf berlin rubyonrails

del.icio.us | furl | simpy | slashdot | technorati | digg

http://blogs.sun.com/arungupta/date/20080904 Thursday September 04, 2008

Rails Conf Europe 2008 - Day 2


Rails Conf Europe 2008 Day 1 was mostly about tutorials.

On Day 2, David Black gave the opening session. After some logistics he introduced the favorite son of Chicago - David Heinemeier Hansson. The theme of DHH's session was "Legacy Software". Now that Rails is 5 years old, the discussions of legacy is indeed meaningful. He showed some code from BaseCamp and showed how refactoring can deal with legacy. I love his statement "What you write today will become legacy". That is indeed so true especially given the fact that Rails community is now thinking about legacy. There is Rails 1.2.x, 2.0.x, 2.1 and 2.2 coming up - it was bound to happen. Overall a great session and love the honesty!

In JRuby: The Other Red Meat by Tom Enebo, the highlights were:

  • JRuby is "It's just Ruby". No prior knowledge of Java is required, at all, to run JRuby.
  • 22,000 tests and 33,000 assertions (from Ruby Spec) all pass to ensure 1.8.6 compliance.
  • 75% memory improvement with upcoming Rails 2.2. The numbers captured from the preso for 1000 requests and 10 concurrent users are:

    10 Rails instances Edge Rails
    Startup Memory 200 Mb 50 Mb
    Heap (at end) 233 Mb 55 Mb

    I'll explain in a detailed post later on how to generate these numbers
  • Several JRuby success stories
  • FFI support in JRuby that will make converting a C-based plugin to pure-Ruby a breeze
In Rails Software Metrics Roderick talked about different tools to generate metrics for Rails applications.
  • rake stats: Provides Code to Test Ratio (0.8 to 1.6 is a good range)
  • flog: Tracking code complexity (available as gem, useful for refactoring, elaborates on complexity)
  • rcov: Tracking test coverage (analyzes line coverage, available as gem)
  • heckle: Analyzes branch coverage (available as gem, dynamically mutates your code - flipping a branch should cause test failire, takes very long, not feasible for TDD)
  • saikuro: Cyclometic complexity (Decidedly scientific graph theory, available as gem, highlights overly complex methods, useful to spot refactoring methods)
  • metrics_fu: Set of Rake tasks to use with CruiseControl, Runs all of the before mentioned on a check-in. Anybody interested in integrating that with Hudson ?
The advise "A single metric is seldom useful, pair them to see what's going on." is certainly very practical.

Fernando explained in details in his session, Achieving High Throughput and Scalability with JRuby on Rails, on how to tune GlassFish for Rails applications. Look for his slides, they got real meat from a Rails application running on production with multiple concurrent requests.

At Five Runs exhibit, I found about FiveRuns monitoring on JRuby. That means you can generate all the performance monitoring data on GlassFish. And then there is nagios and stickshift for monitoring. That's a few blog posts for me later :)

Here are some of the sessions I plan to attend Day 2:

Here are some pictures from Day 2:






And you can see the gourmet lunch was not only beautifully decorated, it was equally luscious:



And finally the complete photo album so far:




Stay tuned for Day 3 blog!

Technorati: conf railsconf berlin rubyonrails

del.icio.us | furl | simpy | slashdot | technorati | digg

http://blogs.sun.com/arungupta/date/20080903 Wednesday September 03, 2008

Rails Conf Europe 2008 - End of Tutorial Day


Sep 2, 2008 was the Tutorials Day @ Rails Conf Europe. I attended Renegade's Guide to Hacking Rails Internals (partly) and Deploying and Monitoring Ruby on Rails. The first session did exactly what it says - explained the complete internals, digging deep into the code and how to hack them to meet your needs. I thoroughly enjoyed the second tutorial as it covered the deployment in detail and somewhat monitoring.

The first part covered the common Application Server and Web/Proxy Servers used for Rails deployment. It explained the different deployment scenarios and their pros/cons. The Application Servers (along with their detailed notes) are:

  • FastCGI
    • Use mod_fcgi
    • Proxy local and remove FastCGI instances
    • Oldest way of deploying Rails
    • Deprecated & Unstable (security problems in impl of Apache2, easy to get zombie processes, works for some)
    • Hard to debug
    • Dont' use in production
  • Mongrel
    • As an alternative to FastCGI
    • Complete HTTP-server that can load arbitrary Ruby-servlets
    • Built-in Rails support
    • Utility to manage several Mongrel clusters (mongrel_cluster)
    • Very robust, strict HTTP parser, easy to debug
    • Defacto standard deployment with Apache 2.2 and mod_proxy_balancer
    • Can be a bit difficult to setup
    • Not so easy on mass/virtual hosting
  • mod_rails (aka Phusion Passenger)
    • Similar to mod_php
    • Fairly new module of Apache 2.2
    • Allows Apache to control Rails instances
    • Apache starts/stop app instance depending on the app load
    • Very easy to setup
    • Able to run any RACK-compatible Ruby app
    • Pros
      • Touching a file "restart.txt" and Phusion automatically restarts all the Rails instances
      • All Rails instances are local to a machine
      • HTTP balancer is required to spawn across multiple machines
      • Fairly new but ready for production
      • Makes setup easier - on single machine
      • Multiple server still require load balancer
      • Suitable for mass hosting
  • JRuby, GlassFish & Co
    • Similar to mod_rails where multiple runtimes can run on a single machine
    • WAR-based deployments
    • Suitable for Java shops
    • Database connection pooling
I'll be talking all about Rails and GlassFish in my session tomorrow @ 1:40pm
Here are the requirements on Proxy servers:
  • Hide cluster backend from the user
  • Load-balancer backend instances
  • Recognize down hosts
  • Fair scheduler
And the different choices (along with their notes) are:
  • Apache2
    • Introduced mod_proxy_balancer
    • Can speak to multiple backends and balance requests
    • Can act as pure proxy or can also serve static files
    • Deliver static content
    • Pros
      • Very old, mature, stable
      • Many people know  how to work with Apache
      • Integrates well with other modules (SVN, DAV, etc)
    • Cons
      • Can be complicated to configure
      • The stock Apache is quite resource-hungry (12-15 KB, where nginx takes 3-5 KB and 20% faster serving of static files) compared to pure proxy solutions
  • nginx
    • Popular Russian web server with good proxy support (40% websites in Russia run nginx)
    • Can load-balance multiple backends and deliver static content
    • Quite popular with Mongrel as Rails backend
    • Simple configuration file - http://brainspl.at/nginx.conf.txt (nginx conf file)
    • Pros
      • Stable, Robust, Fast
      • Use fewer resources (CPU & RAM) than Apache proxy-mode & static files
      • Simple configuration file
      • Can directly talk to memcached - SSI
    • Cons
      • More documentation would be nice
      • No equivalent for many Apache modules
  • LightTPD
    • Lightweight and Fast web server
    • Balancing proxy server
    • Good FastCGI support
    • Used to be popular - until Mongrel came around
    • Nobody is using these days in production
    • Pros
      • Fast & lightweight
      • User fewer resources
      • Simpler configuration file
    • Cons
      • Unstable for some people
      • Slow development cycle
      • More docs would be nice
  • HA-Proxy (also applies to Pen and Pound)
    • Reliable, High performance TCP/HTTP-level balancer (SNMP or MySQL proxying too)
    • Proxying and content inspection
    • No content serving, just a proxy
    • Pros
      • Mature, stable & fast
      • TCP & HTTP Balancing
    • Cons
      • Few Rails examples
      • Usually not needed in Rails setup
After discussing all the options in detail, the recommendations were:
  • Small site - Apache 2.2 with mod_rails
  • Medium site - Apache 2.2 as front-end proxy + Mongrel or mod_rails as backend, Deliver static files with Apache.Not nginx because it does not depend on the extra power to deliver static files.
  • Large Rails site - Redundant load-balancer, redundant proxy/web, Mongrel/mod_rails
  • Heavy static files - Dynamic requests to Apache+mod_rails, static files nginx/lighttpd
  • Java Shop - WAR fles + integrate with existing Java landscape and infrastructure
Then it explained Capistrano, Webistrano, Macistrano and ran through a practical lab of using them.

The tutorial concluded by discussing monitoring. The two criteria for monitoring are:
  • Is it still running ?
  • What are the trends ?
The two main recommendations are:
  • Monit
    • Process-level monitoring
    • Checks PID-files, ports and perms
    • Reacts by executing a script and/or alerting
  • Munin
    • Host level monitoring tool
    • Master periodically ask nodes for local data
    • Check system resources and records historical data
    • Allows to recognize trends and make predictions
    • Alerting support
And other tools that were mentioned as well such as Nagios, Big Brother, New Relic RPM, FiveRuns and JMX. The slides will be published on Rails Conf website so watch this space.

The evening concluded with Q&A from Rails Core Members - DHH, Koz & Jeremy.

Here are some of the sessions I plan to attend tomorrow:
And then there is exhibitor hall as well so will see how much I can attend :) I have to miss the late afternoon and evening sessions/BoFs because of Berlin/Brandenberger JUG preso.

Here are some pictures from yesterday:


And finally the complete photo album so far:



The sessions/exhibit halls start today!

Technorati: conf railsconf berlin rubyonrails

del.icio.us | furl | simpy | slashdot | technorati | digg

http://blogs.sun.com/arungupta/date/20080902 Tuesday September 02, 2008

Follow Rails Conf Europe 2008


Would you like to follow the latest on Rails Conf Europe 2008 ? Here are some sources:

IRC: #railsconfeurope
Twitter: RailsConfEurope and RailsConfEU and railsconf
Facebook: RailsConf Europe
Flickr: railsconfeurope08
RSS: OreillyConferencesRailsconfEurope
News and Coverage
Dopplr: eurorailsconf08

And of course, official website!

Technorati: conf railsconf berlin rubyonrails

del.icio.us | furl | simpy | slashdot | technorati | digg

http://blogs.sun.com/arungupta/date/20080901 Monday September 01, 2008

Rails Conf Europe 2008 and Bratwurst-on-Rails

I arrived Berlin yesterday on a non-adventurous United flight from San Francisco, just the way I like it! The flight from Frankfurt was delayed 30 minutes but that's normal these days :)

The venue of RailsConf Europe 2008 is same as last year so street names/geography are somewhat familiar. But the conference hotel was sold out so am instead staying across the street. Visited Brandenburger Tor for a short duration after checking into the hotel. Also stopped by the Peugeot showroom on Unter den Linden and saw popular bear figurines in a side street. The evening ended with a social gathering celebrating the popular German culture of Bratwurst-on-Rails.

It's always exciting to meet my blog readers, thank you! Let me know if I'm missing any of your expectations.

The tutorial starts today and the conference starts tomorrow. If you are in Berlin, don't forget to attend the joint JUG and TU-Berlin talk. And my talk on "Rails powered by GlassFish" is scheduled on Thursday, Sep 4 @ 1:40pm.

The evening really eneded with a 40 minutes run and dinner in room service. The Jolly Hotel is really nice, newer rooms, courteous staff, delicious and very neatly prepared Club Chicken sandwich and prompt room service, definitely a good recommendation. However the fitness center is minimal with one ultra-loud treadmill and 3 other basic machines. The hotel staff informed that they are working on furnishing the fitness center (known as Wellness Center here). And there is only one American channel which is only talking about Storm Gustav and Republican National Convetion, Juno of Juneau since my arrival  :(

Anyway, enjoy the pictures so far!


And the complete album:


Technorati: conf railsconf berlin glassfish netbeans rubyonrails

del.icio.us | furl | simpy | slashdot | technorati | digg

http://blogs.sun.com/arungupta/date/20080829 Friday August 29, 2008

FREE Ticket to Rails Conf Europe 2008

Are you a Start up company interested in jump starting and meets the following criteria ?

  • In business six years or less
  • A maximum of 150 employees, including any affiliates
  • Based in a country in which the program is offered
  • A verifiable company presence (website, company profile, etc.)
  • Agree to accept the program's terms and conditions

Sun Startup Essentials program provided discounted hardware, partner hosting & storage, FREE support & Training, even connects with over 200 investors and much more. What are you waiting for ? Apply Today!

We'll throw in a FREE ticket to Rails Conf Europe 2008 - FREE as in FREE beer :) Read more details here.

And then if you are using GlassFish for Rails deployment, then I can give you a FREE 30-second promo in my talk.

And if you are in Berlin, then you might as well attend Berlin JUG event - which is also FREE.

And if you are using GlassFish in your startup, then we even provide FREE cloud computing - partnering with Layered Technologies!

Read more about Sun @ Rails Conf Europe 2008.

See you there!

Technorati: conf glassfish netbeans railsconf rubyonrails berlin startupessentials sun

del.icio.us | furl | simpy | slashdot | technorati | digg

http://blogs.sun.com/arungupta/date/20080828 Thursday August 28, 2008

Typo on GlassFish v3 - Ruby-on-Rails Blogging Engine



Typo is an open-source Blogging Engine written using Ruby-on-Rails framework. It provides a lean engine that makes blogging easy. It's main attribtues are ease of use, usability, beauty and excellent support of web standards.

I found out about this application from Sang "Passion" Shin's Lab 5543 (part of FREE 20-week course on Ruby-on-Rails started on Jul 15, 2008). But instead of using standard WEBrick/Mongrel deployment, I describe the steps to deploy this application using GlassFish v3 that supports native deployment of Rails applications. 
  1. Typo can be installed as Gem or from Sources. Installing as gem gives the following error:

    JRuby limited openssl loaded. gem install jruby-openssl for full support.
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
    Building native extensions.  This could take a while...
    /Users/arungupta/tools/rails20/jruby-1.1.3/lib/ruby/1.8/mkmf.rb:7: JRuby does not support native extensions. Check wiki.jruby.org for alternatives. (NotImplementedError)
            from /Users/arungupta/tools/rails20/jruby-1.1.3/lib/ruby/1.8/mkmf.rb:1:in `require'
            from extconf.rb:1
    ERROR:  Error installing typo:
            ERROR: Failed to build gem native extension.

    /Users/arungupta/tools/rails20/jruby-1.1.3/bin/jruby extconf.rb install typo


    Gem files will remain installed in /Users/arungupta/tools/rails20/jruby-1.1.3/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
    Results logged to /Users/arungupta/tools/rails20/jruby-1.1.3/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out

    This is discussed here. In the meanwhile, download and unzip Typo 5.1.2 as:

    ~/samples/jruby >unzip ~/Downloads/typo-5.1.2.zip
    Archive:  /Users/arungupta/Downloads/typo-5.1.2.zip
       creating: typo-5.1.2/
       creating: typo-5.1.2/app/
       creating: typo-5.1.2/app/apis/
       . . .
      inflating: typo-5.1.2/vendor/uuidtools/lib/uuidtools.rb 
      inflating: typo-5.1.2/vendor/uuidtools/rakefile 
      inflating: typo-5.1.2/vendor/uuidtools/README
  2. Create the database:

    ~/samples/jruby >sudo mysqladmin create typo_dev

    Typo 5.1.x works with Rails 2.0.x only and so migrate as shown below:

    ~/samples/jruby/typo-5.1.2 >~/tools/rails20/jruby-1.1.3/bin/jruby -S rake db:migrate
    (in /Users/arungupta/samples/jruby/typo-5.1.2)
    == 1 InitialSchema: migrating =================================================
    -- create_table(:users)
       -> 0.0377s
    -- create_table(:articles)
       -> 0.0189s
    -- add_index(:articles, :permalink)
       -> 0.0094s
    -- create_table(:categories)
       -> 0.0069s

     . . .

    == 69 AddModulesToProfile: migrating ==========================================
    -- add_column(:profiles, :modules, :text)
       -> 0.0072s
    == 69 AddModulesToProfile: migrated (0.0454s) =================================

    == 70 AddUsersToNonAdmins: migrating ==========================================
    == 70 AddUsersToNonAdmins: migrated (0.0488s) =================================

  3. Typo 5.2 (scheduled in 3 days) will work with Rails 2.1.
  4. Download GlassFish (nightly, promoted or build-your-own) and install by unzipping. I tried the nightly of 8/24 as:

    ~/tools/glassfish/v3/8-24 >unzip ~/Downloads/glassfish-snapshot-v3-prelude-08_24_2008.zip
    Archive:  /Users/arungupta/Downloads/glassfish-snapshot-v3-prelude-08_24_2008.zip
       creating: glassfish/
       creating: glassfish/docs/
       creating: glassfish/docs/css/
       creating: glassfish/docs/graphics/
    . . .
      inflating: glassfish/lib/templates/login.conf 
      inflating: glassfish/lib/templates/profile.properties 
      inflating: glassfish/lib/templates/server.policy
  5. Start GlassFish as:

    ~/tools/glassfish/v3/8-24/glassfish >java -DJRUBY_HOME=/Users/arungupta/tools/rails20/jruby-1.1.3 -jar modules/glassfish-10.0-SNAPSHOT.jar
    Aug 26, 2008 5:56:10 PM com.sun.enterprise.glassfish.bootstrap.ASMain main
    INFO: Launching GlassFish on Apache Felix OSGi platform

    Welcome to Felix.
    =================

    Aug 26, 2008 5:56:11 PM HK2Main start
    INFO: contextRootDir = /Users/arungupta/tools/glassfish/v3/8-24/glassfish/modules
    Aug 26, 2008 5:56:11 PM OSGiFactoryImpl initialize

    . . .

    INFO: APIClassLoader = Class Loader for Bundle [GlassFish-Application-Common-Module [66] ]
    Aug 26, 2008 5:56:13 PM CommonClassLoaderManager Skipping creation of CommonClassLoader as there are no libraries available
    INFO: urls = []
    Aug 26, 2008 5:56:13 PM com.sun.enterprise.v3.server.AppServerStartup run
    INFO: Glassfish v3 started in 2176 ms
  6. And deploy Typo as:

    ~/samples/jruby >~/tools/glassfish/v3/8-24/glassfish/bin/asadmin deploy typo-5.1.2

    Command deploy executed successfully.
The application is available at "http://localhost:8080/typo-5.1.2" and some of the screenshots follow:

















Also check out Redmine, Substruct and Mephisto on GlassFish v3. There are some performance issues when running Typo on GlassFish and this is tracked at Issue #5662.

If your Rails application does not work on the gem, file bugs here with "jruby" as "subcomponent" (default version is "v3").

Technorati: rubyonrails glassfish v3 jruby ruby typo blogging

del.icio.us | furl | simpy | slashdot | technorati | digg

http://blogs.sun.com/arungupta/date/20080827 Wednesday August 27, 2008

Interested in a 30 second promotion in Rails Conf Europe 2008 ?

RailsConf Europe 2008 Are you deploying Rails application on GlassFish  in any manner (WAR-based, Gem or Technology Preview 2) ?
Are you using Rails and GlassFish combination in a creative way ?
Having you been following Rails/GlassFish development/deployment options and have an opinion ?

If answer to any of the above questions is yes, then drop a comment on this blog or send me an email (arun dot gupta at sun dot com). I'll be happy to give you a 30-second promotion (at my discretion ;-) in my Rails Conf Europe talk next week. Here is the information I'm looking for:

Title:
Public URL:
Brief Description:
Credits (icon/logo if possible):

And if you are not aware of any of the options mentioned above, then Rails powered by the GlassFish Application Server provides all the details for you to get started!

Technorati: conf railsconf glassfish rubyonrails

del.icio.us | furl | simpy | slashdot | technorati | digg

http://blogs.sun.com/arungupta/date/20080826 Tuesday August 26, 2008

LOTD #6: Rails Deployment on GlassFish in 4 steps and 15 minutes

Charlie describes, in 4 easy steps, how to deploy any Rails application on GlassFish:



The main steps are:

Step 1: The App Server
Step 2: Package your App
Step 3: Deploy your application
Step 4: Tweaking (Optional)

And it should only take 15 minutes on GlassFish v2!

The conclusion of the blog is:

Hopefully this walkthrough clears up some confusion around JRuby on Rails deployment to an app server. It's really a simple process, despite the not-so-simple history surrounding Enterprise Application Servers, and GlassFish almost makes it fun :)

The next version, GlassFish v3, allows Rails application to be deployed natively, i.e. no packaging is required. You create a Rails application and run it - just the way you are used to! Read all about it here.

All previous entries in this series are archived at LOTD.

Technorati: lotd rubyonrails jruby ruby glassfish

del.icio.us | furl | simpy | slashdot | technorati | digg

http://blogs.sun.com/arungupta/date/20080822 Friday August 22, 2008

GlassFish @ Berlin-Brandenburg JUG and TU Berlin


I'll be providing an overview of GlassFish - engineering update on v2 and v3, adoption & success stories, and the vibrant community around it at a joint Berlin-Brandenburg JUG and TU-Berlin meet on Sep 3, 2008.

The coordinates are:

Wednesday, September 3rd
17:30-ca. 19:30
Room FR5516, Technical University of Berlin
Franklinstrasse 28/29
10587 Berlin

The directions are available and please register here.

Thanks to Daniel Freund (Sun's Campus Ambassador in Berlin) & Ralph Bergman for coordinating this! And many thanks to ever-energetic and highly-connected Aaron Houston (JUG Program Coordinator) for initiating the link :)

And of course, I'll also be speaking at Rails Conf Europe 2008 on Rails Powered by GlassFish.

Anybody knows good running trails around Jolly Hotel ?

UPDATE: The venue has changed to a different room. The new room now is FR3003 in the same building.

Technorati: conf glassfish netbeans railsconf rubyonrails jug berlin tuberlin

del.icio.us | furl | simpy | slashdot | technorati | digg

http://blogs.sun.com/arungupta/date/20080821 Thursday August 21, 2008

LOTD #4: Rails running on GlassFish @ LinkedIn


Light Engineering team (BumperSticker fame) at LinkedIn has chosen GlassFish for running their Rails application. One of the developers on the team reports:

Using Warbler, we successfully wrapped our Rails applications into WAR files and deployed on Glassfish (we’ll probably write a more detailed tutorial of this at a future date). A WAR file is completely self contained application that can be deployed simply by copying to an autodeploy directory. No more Apache/Nginx reverse proxy, no more Capistrano, no more installing gems on a production container, no more of any of that madness. This was a huge win, and we broke out the champagne bottles.

Read the complete entry at:

JDBC Connection Pooling for Rails on GlassFish

Stay tuned for more details!

NetBeans development and GlassFish deployment already provide an ideal environment for Rails deployment. You can read about successful deployments of Rails and GlassFish