Miles to go …

February 16, 2008

GlassFish v3 gem on JRuby 1.1 RC2

Filed under: web2.0 — arungupta @ 8:14 pm

JRuby 1.1 RC2 was released earlier today an GlassFish v3 gem works like a charm on it :)

Read the complete announcement here. The key features of RC2 are:

  1. 260 issues resolved
  2. Large IO refactoring
  3. Less memory than previous release
    1. Control total number of JIT’d methods
    2. Support a JIT cache between runtimes to return permgen
    3. 50-70% reduction in generated methods

Here are the steps for quick verification on v3 gem …

  1. Download JRuby 1.1 RC2
  2. Install Rails and create a simple Rails application as described in TOTD #24.
  3. Install GlassFish v3 gem using the command as shown below:

    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.1.1-universal-java
    1 gem installed

  4. And now the simple application can be easily deployed on GlassFish gem as:

    jruby -S glassfish_rails hello

    Notice this command needs to be given from the parent directory of the application. The Applcation environment is as shown below:

    JRuby 1.1 RC2 Application Environment

    and the application output looks like exactly as expected:

    JRuby 1.1 RC2 Application Output

More details about GlassFish and JRuby can be found @ GlassFish wiki and JRuby wiki. Help us test your application on the v3 gem and file issues in JIRA or GlassFish Issue Tracker.

Please use the gem and send us feedback on GlassFish forums, dev@glassfish or gem mailing list.

Technorati: jruby ruby rubyonrails glassfish v3 gem

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

3 steps for successful GlassFish Deployment

Filed under: General — arungupta @ 8:00 am

There are 3 simple steps for a successful GlassFish enterprise deployment – Download, Register, Subscribe. This blog describes what and why of each step. It particularly highlights the several unique benefits available to you in each step.

Download – The first step for any successful enterprise deployment is to download GlassFish – the best open source Application Server (see What’s the big deal about GlassFish ?). You can download, develop and deploy your applications on GlassFish completely FREE. GlassFish Download

The benefits that comes along with download are:


Register – After GlassFish is downloaded and installed, you can easily register your instance by providing an email address. You can register by following these instructions. GlassFish Register

 The registration gives you the following benefits (in addition to the ones available in Download):

  • Access to aggregate contents like tech tips, bugs fixed, latest news and promotions.


Subscribe – Once your application is deployed and you need quality support in maintaining it then it’s strongly recommended to buy the subscription. You can purchase the subscription here. GlassFish Subscribe

Here are the unique benefits that comes along with subscription (in addition to the ones available in Register):

  • Ability to escalate bugs for an out of cycle patch or engineering attention
  • Low risk, tested fixes and features for mission critical deployments
  • Enterprise level production support SLA – Standard, Premium or Premium Plus. Ensures 4 hour response for any question for Standard and Live Transfer for Premium and Premium Plus.
  • Indemnification for both parties
  • Live person technical support
  • Proactive to Sun Alerts and Notifications
  • Access to Sun Knowledge Base

The benefits at different steps are also summarized here.

Sun provides support for GlassFish through our distribution Sun Java System Application Server 9.1 (SJSAS 9.1). So if you have already downloaded then go ahead and register. If you have already registered and ready for deployment then download SJSAS 9.1 and buy a subscription. And be confident of your enterprise applications!

Technorati: glassfish appserver javaee deployment enterprise download register subscribe

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

February 15, 2008

TOTD #27: Configurable Multiple Ruby Platforms in NetBeans 6.1 M1

Filed under: web2.0 — arungupta @ 12:02 am

NetBeans 6.1 M1 is now available. Download here!

There are several features in M1. But the feature I liked the most is storing multiple Ruby/JRuby runtime configurations in the IDE. In NetBeans 6.0 only one Ruby platform could be configured and stored. So if you have to change to another Ruby environment then you have to edit the values in the IDE. 6.1 M1 allows to configure and store multiple Ruby/JRuby runtimes. Click on “Tools“, “Ruby Platforms” and you are presented with the following window:

NetBeans 6.1 M1 Ruby Platform Addition

I’ve already added JRuby 1.0.3 as an additional platform. And then you can choose the Ruby/JRuby runtime when creating the Rails application as shown below:

NetBeans 6.1 M1 Ruby Platform Selection

Cool, isn’t it ?

Please leave suggestions on other TOTD that you’d like to see. A complete archive is available here.

Technorati: totd rubyonrails jruby ruby netbeans

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

February 14, 2008

GlassFish v3 Gem – 0.1.1 available

Filed under: web2.0 — arungupta @ 6:52 am

Pramod released an updated version 0.1.1 of the JRuby GlassFish v3 gem.

What’s New ? – Mainly alignment with Rails convention

  1. The name of the gem is changed from “GlassFish” to “glassfish”.
  2. The default port number is 3000.
  3. Applications are deployed at root context (“/”). So the default application is now deployed “http://localhost:3000/home/index” instead of “http://localhost:8080/temp/home/index“.

And then there are some other improvements:

  1. The number of concurrent requests can now be set using a command-line argument (instead of “-J-Djruby.runtime”). So 2 Rails instances can be created using the following command:

    jruby -S glassfish_rails temp -n 2

  2. Rails instances are created in parallel to improve the startup time of the gem.

How to install it ?

If you installed 0.1.0 version of the gem, then you need to uninstall using the following command:

bin/jruby -S gem uninstall GlassFish
Successfully uninstalled GlassFish-0.1.0-java
Remove executables and scripts for
'glassfish_rails, asadmin, asadmin.bat' in addition to the gem? [Yn]  Y
Removing glassfish_rails
Removing asadmin
Removing asadmin.bat

And then install the new gem using the following command:

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.1.1-universal-java
1 gem installed

And for a fresh check out of JRuby trunk, here is the list of gems shown:

bin/jruby -S gem list

*** LOCAL GEMS ***

actionmailer (2.0.2)
actionpack (2.0.2)
activerecord (2.0.2)
activeresource (2.0.2)
activesupport (2.0.2)
glassfish (0.1.1)
rails (2.0.2)
rake (0.8.1)
sources (0.0.1)

Read more details about the this newly released gem here.

All the latest information about the gem can be found at GlassFish JRuby wiki or JRuby wiki.

Please use the gem and send us feedback on GlassFish forums, dev@glassfish or gem mailing list.

File issues in JIRA or GlassFish Issue Tracker.

Technorati: ruby jruby glassfish v3 gem rubyforge rubyonrails

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

February 13, 2008

TOTD #26: Overriding Database Defaults in Rails 2.0.2

Filed under: web2.0 — arungupta @ 12:02 am

A Rails 2.0.2 application configures SQLite3 database by default. This requires you to have SQLlite3 database running and also have the corresponding database adapter installed. Even this is part of the Leopard (Mac OS 10.5+) development kit but this needs extra configuration on non-Leopard machines.

One of the guiding principles of Rails is Convention-over-Configuration. So there are couple of ways you can override this default:

  1. Generate the Rails app by specifying the database of your choice. So if you want to use MySQL as the default database, then generate the application as:

    jruby -S rails -d mysql myapp

    This is assuming you are using JRuby for generating your Rails application.

  2. If you want to use Rails without a database, remove ActiveRecord framework by editing “config/environment.rb” and adding the line:

    config.frameworks -= [ :active_record ]

    Alternatively you can uncomment line 21 in “environment.rb” and remove other frameworks from inside the parentheses.

This is generally handy if you want to generate and test a simple Rails application that does not involve database.

Please leave suggestions on other TOTD that you’d like to see. A complete archive is available here.

Technorati: totd rubyonrails jruby ruby leopard sqlite3 database

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

February 12, 2008

Hill Workouts During Winter

Filed under: Running — arungupta @ 7:00 am

It’s winter, so here is how to do hill repeats on a treadmill:

  • 10 min easy running
  • 2 Short hills – 3% grade, 90 seconds, 3 minute recovery between each hill
  • 2 Moderate hills – 5% grade, 60 seconds, 2 min recovery between each hill
  • 2 Steep hills – 7% grade, 30 seconds, 60 second recovery between each hill

Technorati: running hillrepeats winter treadmill

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

February 9, 2008

acts_as_conference 2008 – Day 2 Report

Filed under: web2.0 — arungupta @ 7:00 pm

acts_as_conference Day 2 started with breakfast … yaaay! I had to hunt for breakfast yesterday.

Robert started the day by asking some questions and here are the responses:

  • 100% will come back if organized next year
  • Fri/Sat is good
  • $100 Price is good
  • Got 60-70 submissions so the selection process was difficult

Some of the reasons people came to this conference:

  • Mickey Mouse
  • Speaker lineup
  • Topics
  • Want to hear what other people concerns are

The gems are breeding exponentially but I found out about Bjplugin that allows you to unblock Mongrel before the entire request is processed. We might be able to use it for one of our projects.

Brian showed all the fancy Ruby debugging in NetBeans. 5 lucky winners were awarded Agile Development with Rails – 2nd edition in a sweepstakes by Sun.

Charlie explained some of JRuby success stories in mediacast.sun.com, Oracle Mix and Mingle.

Here are the key points of Why JRuby ?

  • Easier setup – unzip and ready to use
  • Better Performance – Showed live benchmarks
    • JRuby 1.0 was 2x slower than Ruby 1.8.6, JRuby 1.1 Beta1 2x faster, JRuby trunk 2-5x faster and often faster than 1.9
    • Method dispatch (10million invocations)
      • Ruby 1.8.6 ~2.1 secs
      • Ruby 1.9 ~0.95 secs
      • JRuby trunk 1.29 secs for first call and then 0.6 secs (JRuby trunk on Soy Latte)
    • Fibonacci
      • Ruby 1.9 0.4 secs
      • Ruby 1.8.6 ~1.54 secs
      • JRuby ~.77 secs first, 0.4 secs subsequently
    • Hilbert matrx of dimension 2, 4, … 64 times its inverse
      • Ruby 1.9 ~21secs
      • JRuby ~21secs
  • Easier deployment
  • More libraries
    • Easy wiring in Java libraries such as Java2D
  • Wider database support – via JDBC
  • Platform independence
    • JRuby on Rails on AS/400 calling MS SQL
  • Less political resistance

Key JRuby messages:

  • JRuby is raising the bar for Rails all the time
  • GlassFish is not your daddy’s app server (2.3M gem)
  • Looking for users, use cases to support

Here are some of the local Ruby groups:

The last session of the day was keynote by Obie Fernandez on “Simplicity”. The actual topic might have been slightly different but that was the essence. Here are some interesting points from his preso:

  • Good software development produces a result that is both functional and beautiful.
  • Played the role of MythBuster. Here are 3 that he busted: 
    • Myth: Practice makes perfect, Busted: Practice makes permanent, perfect practice makes perfect!
    • Myth: In order to play fast, I have to practice fast. Busted: Practice slow first (?)
    • Myth: I dont need to practice reading music. Busted: Start by reading code and develop a better understanding.
  • Rest of his preso drew a great analogy between Sofware Development and Oil painting
    • Like initial oil painters, are you grinding your own paints ? -That requires a lot of labor, needs custom tools and could be expensive. Now the paints are available, use them.
    • Just because you know all the brushes and paints does not mean you can draw a great painting.You need to add aesthetics and creativity to it.
    • The palette is not the point, the application development is the point. You paint the draft, step back and let the painting tell you what needs to be filled.
    • An art degree is not a gurantee to be a success, similarly CS degree does not ensure that you can author a great piece of software.

All in all, I learned a lot, met a lot of folks and a great post-lunch debugging session with a fellow Rubyist on JRuby/OpenSSL!

This is one of the unique conferences I’ve attended because pretty much everybody stayed till the last session, and that too SRO, that was cool! Here are pictures of the attendees towards the end of Obie’s keynote:

As earlier, the complete album is available at:

Technorati: conf jruby ruby actsasconf rubyonrails glassfish netbeans

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

February 8, 2008

acts_as_conference 2008 – Day 1 Report

Filed under: web2.0 — arungupta @ 10:05 pm

acts_as_conference started earlier today (now yesterday) in Orlando, Florida with Charity Session.  Completely sold out with 165 attendees!

Ezra Zybmuntowicz (Merb core developer) talked about Merb.

What is Merb ?

  • Started after tried to make Rails thread-safe and memory foot print lower.
  • All (everything?) you need, none you don’t.
  • Key features of Merb are: Thread-safe, ORM-agnostic, JavaScript-library agnostic, and Template language agnostic.
  • Replacement for ActionPack.
  • Similar to Rails, fixes a bunch of problems like performance, memory collection.
  • 2000 requests/second
  • merb-core, merb-more, merb-plugins are some of the key components.

Read more about Why Merb ? (Speed, Lighweight, Powerful). In later discussions, Ezra told me that somebody on #merb IRC channel has already tried Merb on GlassFish. I’m certainly waiting for him to provide me more information on that. Unfortunately I could not find the chat archives :(

Then Evan Phonix (started Rubinius) talked about the “Ruby kernel written in Ruby”. He talked about how Rubinius is a community-driven implementation (90 committers in last 365 days) and building a rich and high-performance environment for running Ruby code.

In the welcome session, Robert Dempsey explained the two goals for the conference – “wide & deep on variety of topics” and “technologies that integrate with Ruby”. Here are some statistics presented:

  • 30-70 people for every Rails meetup
  • Orlando #16, Tampa #17 for Rails jobs

And some more gathered during another session:

  • 90% using Rails as part of job
  • 50% first time visitors to any Rails conf
  • 50% local to Orlando

The last session of the day was a nice talk by Dan Benjamin on “Simplicity”. I enjoyed his metaphors for emphasizing how simplicity in user interface is important to meet customer’s requirement and keep him happy. Here are the two quotes he used: “Everything should be made as simple as possible, but no simpler” by Einstein and “Simplicity is the key to happiness in the modern world” by Dalai Lama.

The party at Orlando Ale House was a good blast. Here are some pictures:

And finally the day ended with dinner @ GOL! The Taste of Brazil – highly recommended with a great variety of salads and meat. I particularly enjoyed Lime & Strawberry Caipirinha.

In next few hours, stay tuned for Charlie’s session on JRuby and Brian’s talk on NetBeans/Ruby tomorrow. You can always come and talk to me about GlassFish/JRuby – an “eco friendly” alternative to WEBrick and Mongrel at Sun booth. If not there, I’m sitting in back of the room :)

And we are also giving away 5 copies of Agile Web Development with Rails: 2nd Edition in sweepstakes tomorrow, right after Brian’s talk.

The complete album is available at:

Follow the conference at twitter - acts_as_conf or IRC – #actsasconf.

Technorati: conf jruby ruby actsasconf rubyonrails glassfish netbeans

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

Rails Quick Start Seminar – San Francisco, Feb 20-21, 2008

Filed under: web2.0 — arungupta @ 11:00 am

Rails Quick Start Seminar, Feb 20-21, San Francisco
Sun Microsystems is a sponsor of a new Ruby on Rails seminar. Michael Slater and Christopher Haupt, of BuildingWebApps.com and the LearningRails.com podcast, are offering a two-day Ruby on Rails QuickStart seminar in San Francisco, February 20-21. The seminar is designed to enable web designers and developers with only minimal programming experience to become productive Rails developers.

Attendees will learn how to build Ruby on Rails applications using the NetBeans IDE. They will receive a complete Ruby on Rails site they can use as the basis for their own designs, with deployment scripts and a trial hosting account. The key topics include:

  • The Rails approach to web site design
  • Basics of Ruby: just enough to get going with Rails
  • Using Rails layouts and partials
  • Building forms with validation
  • Easy Ajax with Prototype, Scriptaculous, and RJS
  • Working with the database through Active Record
  • Testing and debugging
  • Deploying to production

Once again …

Event: Ruby on Rails QuickStart Seminar, agenda
Date
: Feb 20-21
Location: San Francisco, CA (hotel)

Register now!

Technorati: conf rubyonrails learningrails seminar railsquickstart

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

GlassFish v3 Ruby Gem – New Home on RubyForge

Filed under: web2.0 — arungupta @ 3:02 am
Ruby Forge Icon GlassFish v3 Gem allows JRuby-on-Rails application to be launched in GlassFish v3 server. It provides a robust alternative to WEBrick and Mongrel for development and deployment of your JRuby-on-Rails applications.

UPDATE (Feb 14): A 0.1.1 version of the gem is released which will change the installation process.

The Gem was originally announced here and then updated here. All along, the Gem was living a nomadic life on download.java.net. Now it has found a permanent home on http://rubyforge.org/projects/glassfishgem/. We are excited to release version 0.1.0 of Gem co-located with other standard gems such as RubyGems, Rails and RMagick. This new and permanent home provides a much more seamless installation of v3 gem. Here are the highlights:

  • The Gem replaces WEBrick as the development container and a pack of Mongrels front-ended by light-weight Web server + Capistrano for management by one command and one process (think “eco-friendly”).
  • Works with both JRuby 1.0.3 and JRuby 1.1RC1.
  • Multiple applications can be deployed in one instance of gem, each in their own context root and running on separate ports (details below).
  • Each application can serve multiple requests concurrently. This can be configured by the number of JRuby runtimes using -J-Djruby.runtime as a command-line property (details below).
  • The applications deployed on this Gem can easily make use of pooled resources such as database connections as explained in TOTD #9.
  • The released version is 0.1.0. Even though a preview version of Gem was released earlier, the version number is starting from scratch because of the newly found permanent home. 
  • Installing the Gem is a seamless and integrated process as explained below.

How to install the Gem ?

After you’ve downloaded and unzipped JRuby 1.0.3, go to JRUBY_HOME directory and install the gem by giving the following command:

bin/jruby -S gem install GlassFish
Need to update 24 gems from http://gems.rubyforge.org
........................
complete
Select which gem to install for your platform (java)
 1. GlassFish 0.1.0 (java)
 2. Skip this gem
 3. Cancel installation
> 1
Successfully installed GlassFish-0.1.0-java

Once the gem is installed, “glassfish_rails” script is available in JRUBY_HOME/bin directory. The exact same commands work for installing the gem in JRuby 1.1RC1 as well.

How to deploy an application on Gem ?

TOTD #24 shows how to develop a JRuby-on-Rails applications with JRuby 1.0.3 and JRuby 1.1 RC1 and tested using WEBrick. To deploy these applications on the newly installed gem, use the following command:

cd .. (go to parent directory of the application)
jruby -S glassfish_rails hello

Now the app is deployed at “http://localhost:8080/hello/say/hello“.

How to configure the number of concurrent requests ?

The default number of concurrent requests that can be handled by an application deployed Gem is 1. If your application hosted on the Gem needs to handle concurrent requests then you need to specify the command-line option “-J-Djruby.runtime=NNN“, where NNN is the number of expected concurrent requests. For example, if your application needs to handle 4 concurrent requests then the command to host your application will look like:

jruby -J-Djruby.runtime=4 -S glassfish_rails hello

How to host multiple applications ?

Multiple applications can be hosted on GlassFish gem by modifying the default port number on which the Gem is started. The ports that need to be changed are: “http-listener-1“, “http-listener-2” and “admin-listener“.

For now, the port numbers need to be modified by manually editing “jruby-1.0.3/lib/ruby/gems/1.8/gems/GlassFish-0.1.0-java/domains/domain1/config/domain.xml” file. Search for the string in first column, replace the port attribute of that XML element with the value in second column and the third column shows the default value:

Search String New Port Default
http-listener-1 8081 8080
http-listener-2 8182 8181
admin-listener 4849 4848

Any subsequent application deployed on GlassFish gem will now be hosted on http://localhost:8081/<context-root>/<controller>/<view> where <context-root> is the name of your Rails application.

A command-line switch, similar “-J-Djruby.rutime” will be provided in the near future.

Please use the gem and send us feedback on GlassFish forums, dev@glassfish or gem mailing list.

File issues in JIRA or GlassFish Issue Tracker.

Technorati: ruby jruby glassfish v3 gem rubyforge

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
« Newer PostsOlder Posts »

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.
Powered by WordPress