Arun Gupta, Miles to go ...

Arun Gupta is a technology enthusiast, a passionate runner, and a community guy who works for Oracle.
Main | Next page »

http://blogs.sun.com/arungupta/date/20091208 Tuesday December 08, 2009

TOTD #116: GlassFish v3 Administration using JavaFX front-end - JNLP available

As mentioned in TOTD #113, this Tip Of The Day (TOTD) provides a working version of the JavaFX front-end for GlassFish v3 administration.

Please click here to launch the JNLP or click here to a page that provides some introduction along with the link to JNLP. You may like to enable Java Console as explained in TOTD #114 for any log messages.

See a video of the tool in action:

Many thanks to Rajeshwar for providing feedback and helping me understand the RESTful interface better. TOTD #96 explains how the REST interface can be used.

Here is a TODO list in no particular order:

  • Show a splash screen after the startup to indicate server status
  • Allow the administration host/port to be changed
  • Tie the "server stats" with the server uptime instead of fetching once and then binding it locally
  • Provide dynamic updates of the monitoring data, currently its a snapshot
  • Convert the monitoring levels text boxes to radio buttons
  • Provide complete hints on setting monitoring level based upon the engines
  • Enable/Disable the buttons based upon the status of server running (or not)
  • Introduce charts to track dynamic shrink/expand of threads/pools/etc.
  • Probably something else that I'm forgetting :-)

How are you using JavaFX with GlassFish ?

How will you use GlassFish v3 REST interface in your tools ?

Technorati: totd javafx glassfish v3 rest web jruby rubyonrails rest administration monitoring management

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

http://blogs.sun.com/arungupta/date/20091111 Wednesday November 11, 2009

TOTD #113: JavaFX front-end for GlassFish v3 Administration - Using REST interface

GlassFish v3 provides a REST interface to management and monitoring information as discussed in TOTD #96. As mentioned in that blog "the REST interface is a lower level API that enables toolkit developers and IT administrators to write their custom scripts/clients using language of their choice". This blog introduces a tool that uses the REST API to provide management and monitoring of GlassFish v3 and is written using JavaFX.

This tool is only a proof-of-concept that demonstrates that GlassFish v3 REST interface is functionally very rich and can indeed be used to write third-party administration tools. The tool uses a subset of the REST interface and exposes only a limited amount of management and monitoring capabilities otherwise exposed. After all this is a proof-of-concept :-)

A screencast of this tool in action along with a downloadable JNLP version will soon be available. For now, here is a snapshot of the main window of this tool:

The main screen allows you to enter a URL for the GlassFish administration. Then the GlassFish instance can be stopped/restarted from the main window using the buttons on top right. There is an animation at the bottom of the screen where the glassfish is swimming in the ocean and is directly related to the state of server running in the background. If the server is running, the animation works. If the server is not running then the animation stops as well.

The main screen has three main buttons:

  • "List Applications" - list all the applications deployed on the running instance
  • "Show Monitoring Levels" - show/Update all the monitoring levels
  • "Server Stats" - show statistics of the running server

Clicking on "List Applications" shows the list of applications deployed on this particular instance. Here is how a snapshot looks like for an instance running on my localhost at port 4848:

As shown in the screen, it shows a radio-bulleted list of all the applications. Each bullet is also accompanied by an image indicating the type of application - Web or Rails for now. Select the application and click on "Monitor" button to monitor that particular application. The REST API exposes a vast amount of monitoring data but a subset of monitoring data is displayed for Web and Rails application for now. Here is a snapshot of the monitoring data published for a Web application:

As evident by the list of engines, this web application has EJBs bundled as well. It also shows total number of Servlets/JSPs loaded, number of requests made to this web application and some other monitoring data.

Here is a snapshot of the monitoring data published for a Rails application:

It shows number of JRuby runtimes configured for the application, number of requests sent to the application, number of responses with different HTTP access codes and some other data.

The monitoring levels of different containers can be easily updated by clicking on "Show Monitoring Levels" as shown below:

And finally some server statistics are shown by clicking on "Server Stats" as shown below:

It shows when the server was started, host/port information, version and finally how long the server has been running for. The dials are an animation that shows the server up time.

Here are other related JavaFX and GlassFish related blogs published earlier:

How are you going to use the REST interface exposed by GlassFish v3 in your environment ?

Are you using JavaFX with GlassFish together in any way ?

Leave a comment on this blog if you do!

Technorati: javafx glassfish v3 rest web jruby rubyonrails rest administration monitoring management

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

http://blogs.sun.com/arungupta/date/20090918 Friday September 18, 2009

Free Rails/GlassFish Webinar with live Q&A: Sep 23, 2009,10am PT

Got the following message in my inbox today:

All details (including registration) are available here.

Looking forward to see you there!

Technorati: glassfish rubyonrails jruby webinar

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

TOTD #104: Popular Ruby-on-Rails applications on GlassFish v3 – Redmine, Typo, Substruct

GlassFish v3 is opening up new frontiers by allowing to easily deploy Rails, Grails and Django applications, in addition to Java EE, without any additional packaging. You can even write a custom container to support new types of applications. Numerous entries on this blog have talked about how to deploy Rails applications on GlassFish v3. This Tip Of The Day (TOTD) will recap them and, once again, demonstrate how to easily get started with deploying some popular open source Rails applications on GlassFish v3.

Lets prepare a GlassFish v3 build for deploying Rails applications. This blog is going to use 9/16 nightly but you should pick the latest nightly or promoted.

  1. Unzip the downloaded bundle as:
    ~/tools/glassfish/v3/9-16 >unzip ~/Downloads/glassfish-v3-b64-09_16_2009.zip
  2. Configure JRuby/Rails in GlassFish v3 - JRuby/rails can be configured three different ways - use a previously installed JRuby/Rails directory, install JRuby/Rails module using the graphical Update Center or the "pkg" binary. This Update Center module comes packaged with JRuby 1.3.1, Rails 2.3.2 and some other useful gems. Pick the option you are most comfortable with and use it for your GlassFish installation.
    1. Configure previously installed JRuby/Rails directory as:
      ~/tools/glassfish/v3/9-16/glassfishv3/bin/asadmin create-jvm-options -Djruby.home=/Users/arungupta/tools/jruby
      Authentication failed with password from login store: /Users/arungupta/.asadminpass
      
      Enter admin password >
      created 1 option(s)
      Command create-jvm-options executed successfully.

      That's it!
    2. Install JRuby/Rails module using graphical Update Tool
      1. The graphical Update Tool tool can be invoked as:
        ~/tools/glassfish/v3/9-16/glassfishv3 >./bin/updatetool
        
        The software needed for this command (updatetool) is not installed.
        
        If you choose to install Update Tool, your system will be automatically
        configured to periodically check for software updates. If you would like
        to configure the tool to not check for updates, you can override the
        default behavior via the tool's Preferences facility.
        
        When this tool interacts with package repositories, some system information
        such as your system's IP address and operating system type and version
        is sent to the repository server. For more information please see:
        
        http://wiki.updatecenter.java.net/Wiki.jsp?page=UsageMetricsUC2
        
        Once installation is complete you may re-run this command.
        
        Would you like to install Update Tool now (y/n): y
        
        Proxy: Using system proxy settings.
        Install image: /Users/arungupta/tools/glassfish/v3/9-16/glassfishv3
        Installing pkg packages.
        Installing updatetool packages.
        Registering notifier: Already registered.
        Initialization complete.
        
        Software successfully installed. You may now re-run this command (updatetool).
      2. The first invocation of the command installs the Update Tool and the second invocation shows the following screen after "JRuby on GlassFish" module is selected:


        Click on green button in the top left to install the module and it picks up the dependencies as well as shown below:


        Click on "Install" to start the installation and click on "Accept" to accept the license.
      3. Close the Update Tool window once the installation is completed. The module creates "glassfish/jruby" directory.
    3. Install JRuby/Rails module using "pkg" binary
      1. Install the JRuby/Rails bits using the "pkg" binary. Invoke the command as:
        ~/tools/glassfish/v3/9-16/glassfishv3 >./bin/pkg

        The software needed for this command (pkg) is not installed. When this tool interacts with package repositories, some system information such as your system's IP address and operating system type and version is sent to the repository server. For more information please see: http://wiki.updatecenter.java.net/Wiki.jsp?page=UsageMetricsUC2 Once installation is complete you may re-run this command. Would you like to install this software now (y/n): y Proxy: Using system proxy settings. Install image: /Users/arungupta/tools/glassfish/v3/9-16/glassfishv3 Installing pkg packages. Initialization complete. Software successfully installed. You may now re-run this command (pkg).
      2. The command "pkg list -a" shows all the modules available for installation and the output looks like:

        ~/tools/glassfish/v3/9-16/glassfishv3 >./bin/pkg list -a
        NAME (PUBLISHER)                              VERSION         STATE      UFIX
        ant (contrib.glassfish.org)                   1.7.1-0.6       known      ----
        felix                                         2.0.0-0         installed  ----
        glassfish-appclient                           3.0-65          installed  ----
        glassfish-cmp                                 3.0-65          installed  ----
        
        . . .
        
        jersey-docs-and-examples                      1.1.2-1.0       known      ----
        jmaki (contrib.glassfish.org)                 1.8.1-2.0       known      ----
        jruby                                         1.3.1-1.1       known      ----
        jruby (contrib.glassfish.org)                 1.2.0-1.1       known      u---
        jruby-gems (contrib.glassfish.org)            2.3.2-1.1       known      ----
        jython-container (contrib.glassfish.org)      0.5.3-1.0       known      ----
        jython-runtime (contrib.glassfish.org)        2.5.0-1.0       known      ----
        metro                                         2.0-19          installed  ----
        
        . . .
        
        updatetool                                    2.3.0-36.2403   known      ----
        updatetool (contrib.glassfish.org)            2.2.2-30.2311   known      u---
        wxpython2.8-minimal                           2.8.10.1-36.2403 known      ----
        wxpython2.8-minimal (contrib.glassfish.org)   2.8.8-30.2311   known      u---
      3. Start the installation of "jruby" module as:

        ~/tools/glassfish/v3/9-17/glassfishv3 >./bin/pkg install jruby
        DOWNLOAD                                  PKGS       FILES    XFER (MB)
        Completed                                  2/2 14810/14810    37.0/37.0
        
        PHASE                                        ACTIONS
        Install Phase                            17273/17273
  3. Redmine on GlassFish - Redmine is an open source project management web application. The simplified steps to deploy Redmine on GlassFish v3 are given below (also on GlassFish Gem and on GlassFish v3 TP2):
    1. Download and unzip Redmine 0.8.5 (latest stable release).
    2. Change the database adapter from "mysql" to "jdbcmysql" as:

      sed s/'adapter: mysql'/'adapter: jdbcmysql'/ <config/database.yml.new >config/database.yml
    3. Create the database manually as "sudo mysqladmin create redmine_development". "db:create" fails because of JRUBY-3502.
    4. Migrate the database as "db:migrate".
    5. Deploy the application as:
      ~/samples/jruby/redmine >~/tools/glassfish/v3/9-16/glassfishv3/bin/asadmin deploy redmine-0.8.5
       Authentication failed with password from login store: /Users/arungupta/.asadminpass
      
      Enter admin password>
      Command deploy executed successfully.
    6. Here are some snapshots from the deployed application:





  4. Typo on GlassFish - Typo is the oldest Ruby on Rails blogware. The simplified steps to deploy Typo on GlassFish v3 are given below (also on GlassFish Prelude):
    1. Download and unzip Typo 5.3 (latest stable release).
    2. Change the database adapter from "mysql" to "jdbcmysql" as:

      sed s/'adapter: mysql'/'adapter: jdbcmysql'/ <config/database.yml.example >config/database.yml
    3. Create the database manually as "sudo mysqladmin create typo_dev". "db:create" fails because of JRUBY-3502.
    4. Typo runs using Rails 2.2.2 so lets install Rails 2.2.2 so lets install Rails 2.2.2 as:
      ~/samples/jruby/typo/typo-5.3 >~/tools/glassfish/v3/9-16/glassfishv3/glassfish/jruby/bin/jruby -S gem install rails -v 2.2.2
      JRuby limited openssl loaded. gem install jruby-openssl for full support.
      http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
      Successfully installed activesupport-2.2.2
      Successfully installed activerecord-2.2.2
      Successfully installed actionpack-2.2.2
      Successfully installed actionmailer-2.2.2
      Successfully installed activeresource-2.2.2
      Successfully installed rails-2.2.2
      6 gems installed
      Installing ri documentation for activesupport-2.2.2...
      Installing ri documentation for activerecord-2.2.2...
      Installing ri documentation for actionpack-2.2.2...
      Installing ri documentation for actionmailer-2.2.2...
      Installing ri documentation for activeresource-2.2.2...
      Installing ri documentation for rails-2.2.2...
      Installing RDoc documentation for activesupport-2.2.2...
      Installing RDoc documentation for activerecord-2.2.2...
      Installing RDoc documentation for actionpack-2.2.2...
      Installing RDoc documentation for actionmailer-2.2.2...
      Installing RDoc documentation for activeresource-2.2.2...
      Installing RDoc documentation for rails-2.2.2...
    5. Migrate the database as "db:migrate".
    6. Deploy the application as:
      ~/samples/jruby/typo >~/tools/glassfish/v3/9-16/glassfishv3/bin/asadmin deploy typo-5.3
      Authentication failed with password from login store: /Users/arungupta/.asadminpass
      
      Enter admin password>
      Command deploy executed successfully.
    7. Here are are some snapshots from the deployed application:





  5. Substruct on GlassFish - Substruct is an open source E-Commerce project in Ruby-on-Rails. The simplified steps to deploy Substruct on GlassFish v3 are given below (also on GlassFish v3 Gem):
    1. Download and unzip substruct 1.0 a6 (latest stable release).
    2. Install the required gems as:
      ~/samples/jruby/substruct >~/tools/glassfish/v3/9-16/glassfishv3/glassfish/jruby/bin/jruby -S gem install RedCloth fastercsv mime-types mini_magick ezcrypto jruby-openssl --no-ri --no-rdoc
    3. Change the database adapter from "mysql" to "jdbcmysql" as:

      ~/samples/jruby/substruct/substruct_rel_1-0-a6>sed s/'adapter: mysql'/'adapter: jdbcmysql'/ <config/database.yml
      >config/database.yml.new
      ~/samples/jruby/substruct/substruct_rel_1-0-a6>mv config/database.yml.new config/database.yml
    4. Create the database manually as "sudo mysqladmin create substruct_development". "db:create" fails because of JRUBY-3502.
    5. Initialize the database as:
      ~/samples/jruby/substruct/substruct_rel_1-0-a6 >~/tools/glassfish/v3/9-16/glassfishv3/glassfish/jruby/bin/jruby -S rake substruct:db:bootstrap
    6. Deploy the application as:
      ~/samples/jruby/substruct >~/tools/glassfish/v3/9-16/glassfishv3/bin/asadmin deploy substruct_rel_1-0-a6
      Authentication failed with password from login store: /Users/arungupta/.asadminpass
      Enter admin password>
      
      Command deploy executed successfully.
    7. Here is a snapshot of the deployed application:

So we deployed Redmine, Typo, and Substruct using JRuby/Rails on GlassFish without any additional packaging. There are several Rails applications deployed in production on GlassFish.

What Rails applications are you deploying on GlassFish ?

Technorati: glassfish v3 rubyonrails jruby redmine typo mephisto substruct

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

http://blogs.sun.com/arungupta/date/20090812 Wednesday August 12, 2009

TOTD #92: Session Failover for Rails applications running on GlassFish


The GlassFish High Availability allows to setup a cluster of GlassFish instances and achieve highly scalable architecture using in-memory session state replication. This cluster can be very easily created and tested using the "clusterjsp" sample bundled with GlassFish. Here are some clustering related entries published on this blog so far:

  • TOTD #84 shows how to setup Apache + mod_proxy balancer for Ruby-on-Rails load balancing
  • TOTD #81 shows how to use nginx to front end a cluster of GlassFish Gems
  • TOTD #69 explains how a GlassFish cluster can be front-ended using Sun Web Server and Load Balancer Plugin
  • TOTD #67 shows the same thing using Apache httpd + mod_jk
#67 & #69 uses a web application "clusterjsp" (bundled with GlassFish) that uses JSP to demonstrate in-memory session replication state replication. This blog creates a similar application "clusterrails" - this time using Ruby-on-Rails and deploy it on GlassFish v2.1.1. The idea is to demonstrate how Rails applications can leverage the in-memory session replication feature of GlassFish.

Rails applications can be easily deployed as a WAR file on GlassFish v2 as explained in TOTD #73. This blog will guide through the steps of creating the Controller and View to mimic "clusterjsp" and configuring the Rails application for session replication.
  1. Create a template Rails application and create/migrate the database. Add a Controller/View as:

    ~/samples/jruby/session >~/tools/jruby/bin/jruby script/generate controller home index
    JRuby limited openssl loaded. gem install jruby-openssl for full support.
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
          exists  app/controllers/
          exists  app/helpers/
          create  app/views/home
          exists  test/functional/
          create  test/unit/helpers/
          create  app/controllers/home_controller.rb
          create  test/functional/home_controller_test.rb
          create  app/helpers/home_helper.rb
          create  test/unit/helpers/home_helper_test.rb
          create  app/views/home/index.html.erb

  2. Edit the controller in "app/controllers/home_controller.rb" and change the code to (explained below):

    class HomeController < ApplicationController
      include Java

      def index
        @server_served = servlet_request.get_server_name
        @port = servlet_request.get_server_port
        @instance = java.lang.System.get_property "com.sun.aas.instanceName"
        @server_executed = java.net.InetAddress.get_local_host().get_host_name()
        @ip = java.net.InetAddress.get_local_host().get_host_address
        @session_id = servlet_request.session.get_id
        @session_created = servlet_request.session.get_creation_time
        @session_last_accessed = servlet_request.session.get_last_accessed_time
        @session_inactive = servlet_request.session.get_max_inactive_interval

        if (params[:name] != nil)
          servlet_request.session[params[:name]] = params[:value]
        end

        @session_values = ""
        value_names = servlet_request.session.get_attribute_names
        unless (value_names.has_more_elements)
          @session_values = "<br>No parameter entered for this request"
        else
            @session_values << "<UL>"
            while (value_names.has_more_elements)
                param = value_names.next_element
                unless (param.starts_with?("__"))
                  value = servlet_request.session.get_attribute(param)
                  @session_values << "<LI>" + param + " = " + value + "</LI>"
                end
            end
            @session_values << "</UL>"
        end

      end

      def adddata
        servlet_request.session.set_attribute(params[:name], params[:value])
        render :action => "index"
      end

      def cleardata
        servlet_request.session.invalidate
        render :action => "index"
      end
    end

    The "index" action initializes some instance variables using the "servlet_request" variable mapped from "javax.servlet.http.ServletRequest" class. The "servlet_request" provides access to different properties of the request received such as server name/port, host name/address and others. It also uses an application server specific property "com.sun.aas.instanceName" to fetch the name of particular instance serving the request. In this blog we'll create a cluster with 2 instances. The action then prints the servlet session attributes name/value pairs entered so far.

    The "adddata" action takes the name/value pair entered on the page and stores them in the servlet request. The "cleardata" action clears any data that is storied in the session.
  3. Edit the view in "app/views/home/index.html.erb" and change to (explained below):

    <h1>Home#index</h1>
    <p>Find me in app/views/home/index.html.erb</p>
    <B>HttpSession Information:</B>
    <UL>
    <LI>Served From Server:   <b><%= @server_served %></b></LI>
    <LI>Server Port Number:   <b><%= @port %></b></LI>
    <LI>Executed From Server: <b><%= @server_executed %></b></LI>
    <LI>Served From Server instance: <b><%= @instance %></b></LI>
    <LI>Executed Server IP Address: <b><%= @ip %></b></LI>
    <LI>Session ID:    <b><%= @session_id %></b></LI>
    <LI>Session Created:  <%= @session_created %></LI>
    <LI>Last Accessed:    <%= @session_last_accessed %></LI>
    <LI>Session will go inactive in  <b><%= @session_inactive %> seconds</b></LI>
    </UL>
    <BR>
    <% form_tag "/session/home/index" do %>
      <label for="name">Name of Session Attribute:</label>
      <%= text_field_tag :name, params[:name] %><br>

      <label for="value">Value of Session Attribute:</label>
      <%= text_field_tag :value, params[:value] %><br>

        <%= submit_tag "Add Session Data" %>
    <% end  %>
    <% form_tag "/session/home/cleardata" do %>
        <%= submit_tag "Clear Session Data" %>
    <% end %>
    <% form_tag "/session/home/index" do %>
        <%= submit_tag "Reload Page" %>
    <% end %>
    <BR>
    <B>Data retrieved from the HttpSession: </B>
    <%= @session_values %>

    The view dumps the property value retrieved from the servlet context in the action. Then it consists of some forms to enter the session name/value pairs, clear the session and reload the page. The application is now ready, lets configure it for WAR packaging.
  4. Generate a template "web.xml" and copy it to "config" directory as:

    ~/samples/jruby/session >~/tools/jruby/bin/jruby -S warble war:webxml
    mkdir -p tmp/war/WEB-INF
    ~/samples/jruby/session >cp tmp/war/WEB-INF/web.xml config/
    1. Edit "tmp/war/WEB-INF/web.xml" and change the first few lines from:

      <!DOCTYPE web-app PUBLIC
        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">
      <web-app>

      to

      <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

      This is required because the element to be added next is introduced in the Servlet 2.4 specification.
    2. Add the following element:

      <distributable/>

      as the first element, right after "<web-app>". This element marks the web application to be distributable across multiple JVMs in a cluster.
  5. Generate and configure "warble/config.rb" as described in TOTD #87. This configuration is an important step otherwise you'll encounter JRUBY-3789. Create a WAR file as:

    ~/samples/jruby/session >~/tools/jruby/bin/jruby -S warble
    mkdir -p tmp/war/WEB-INF/gems/specifications
    cp /Users/arungupta/tools/jruby-1.3.0/lib/ruby/gems/1.8/specifications/rails-2.3.2.gemspec tmp/war/WEB-INF/gems/specifications/rails-2.3.2.gemspec

    . . .

    mkdir -p tmp/war/WEB-INF
    cp config/web.xml tmp/war/WEB-INF
    jar cf session.war  -C tmp/war .

  6. Download latest GlassFish v2.1.1, install/configure GlassFish and create/configure/start a cluster using the script described here. Make sure to change the download location and filename in the script. This script creates a cluster "wines" with two instances - "cabernet" runing on the port 58080 and "merlot" running on the port 58081.
  7. Deploy the application using the command:

    ~/samples/jruby/session >asadmin deploy --target wines --port 5048 --availabilityenabled=true session.war
Now, the screenshots from the two instances are shown and explained below. The two (or more) instances are front-ended by a load balancer so none of this is typically visible to the user but it helps to understand.
Here is a snapshot of this application deployed on "cabernet":



The instance name and the session id is highlighted in the red box. It also shows the time when the session was created in "Session Created" field.

And now the same application form "merlot":



Notice, the session id exactly matches the one from the "cabernet" instance. Similarly "Session Created" matches but "Last Accessed" does not because the same session session is accessed from a different instance.

Lets enter some session data in the "cabernet" instance and click on "Add Session Data" button as shown below:



The session attribute is "aaa" and value is "111". Also the "Last Accessed" time is updated. In the "merlot" page, click on the "Reload Page" button and the same session name/value pairs are retrieved as shown below:



Notice, the "Last Accessed" time is after the time showed in "cabernet" instance. The session information added in "cabernet" is automatically replicated to the "merlot" instance.

Now, lets add a new session name/value pair in "merlot" instance as shown below:



The "Last Accessed" is updated and the session name/value pair ("bbb"/"222") is shown in the page. Click on "Reload page" in "cabernet" instance as shown below:



This time the session information added to "merlot" is replicated to "cabernet".

So any session information added in "cabernet" is replicated to "merlot" and vice versa.

Now, lets stop "cabernet" instance as shown below:



and click on "Reload Page" in "merlot" instance to see the following:



Even though one instance from which the session data was added is stopped, the replicating instance continues to serve both the session values.

As explained earlier, these two instances are front-ended by a load-balancer typically running at port 80. So the user makes a request to port 80 and the correct session values are served even if one of the instance goes down and there by providing in-memory session replication.

Please leave suggestions on other TOTD that you'd like to see. A complete archive of all the tips is available here.

Technorati: totd glassfish clustering rubyonrails jruby highavailability loadbalancer

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

http://blogs.sun.com/arungupta/date/20090803 Monday August 03, 2009

TOTD #88: How add pagination to Rails - will_paginate


This Tip Of The Day (TOTD) explains how to add pagination to your Rails application.

  1. Create a simple Rails scaffold as:

    ~/samples/jruby >~/tools/jruby/bin/jruby -S rails paginate
    ~/samples/jruby/paginate >~/tools/jruby/bin/jruby script/generate scaffold book title:string author:string
    ~/samples/jruby/paginate >sed s/'adapter: sqlite3'/'adapter: jdbcsqlite3'/ <config/database.yml >config/database.yml.new
    ~/samples/jruby/paginate >mv config/database.yml.new config/database.yml
    ~/samples/jruby/paginate >~/tools/jruby/bin/jruby -S rake db:migrate

  2. Edit "test/fixtures/books.yml" and specify the content as:

    # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

    one:
      title: Ultramarathon Man Confessions of an All-Night Runner
      author: Dean Karnazes

    two:
      title: My Life on the Run
      author: Bart Yasso

    three:
      title: 50/50 Secrets I Learned Running 50 Marathons in 50 Days
      author: Dean Karnazes

    four:
      title: Born to Run
      author: Christopher Mcdougall

    five:
      title: Four Months to a Four-hour Marathon
      author: Dave Kuehls

    six:
      title:  Galloway's Book on Running
      author: Jeff Galloway

    seven:
      title: Marathoning for Mortals
      author: John Bingham and Jenny Hadfield

    eight:
      title:  Marathon You Can Do It!
      author: Jeff Galloway

    nine:
      title: Marathon The Ultimate Training Guide
      author: Hal Higdon

    ten:
      title: Running for Mortals
      author: John Bingham and Jenny Hadfield

    and load the fixtures as:

    ~/samples/jruby/paginate >~/tools/jruby/bin/jruby -S rake db:fixtures:load
    (in /Users/arungupta/samples/jruby/paginate)

  3. Run the application as:

    ~/samples/jruby/paginate >~/tools/jruby/bin/jruby -S glassfish -l
    Starting GlassFish server at: 129.145.132.8:3000 in development environment...
    Writing log messages to: /Users/arungupta/samples/jruby/paginate/log/development.log.

    . . .

    Jul 29, 2009 2:06:44 PM com.sun.grizzly.scripting.pool.DynamicPool$1 run
    INFO: New instance created in 7,488 milliseconds

    The application is accessible at "http://localhost:3000/books" and looks like:



    The page shows 10 rows, all in one page.
  4. Lets add pagination to this simple sample.
    1. Install will_paginate gem as:

      /tools/jruby >./bin/jruby -S gem install will_paginate
      JRuby limited openssl loaded. gem install jruby-openssl for full support.
      http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
      Successfully installed will_paginate-2.2.2
      1 gem installed
      Installing ri documentation for will_paginate-2.2.2...
      Installing RDoc documentation for will_paginate-2.2.2...

      There are other methods of installation as well.
    2. Edit "config/environment.rb" and add

      require "will_paginate"

      as the last line.
    3. Edit the "index" action in "app/controllers/books_controller.rb" as:

      @books = Book.paginate(:page => params[:page], :per_page => 5)
      #@books = Book.all

      ":per_page" specifies the number of items to be displayed in each page.
    4. In "app/views/books/index.html.erb", add:

      <%= will_paginate @books %>

      right after "</table>".

      The output now looks like:



      and clicking on "Next" shows:



      The information is nicely split amongst 2 pages.
An important point to remember is that will_paginate only adds pagination to your Rails app. You are still required to display all the values.

But essentially replacing "@books = Book.all" with "@books = Book.paginate(:page => params[:page], :per_page => 5)" in the Controller and adding
"<%= will_paginate @books %>" did the trick for us.

Clean and simple!

Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. A complete archive of all the tips is available here.

Technorati: jruby rubyonrails glassfish pagination will_paginate

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

http://blogs.sun.com/arungupta/date/20090731 Friday July 31, 2009

TOTD #87: How to fix the error undefined method `new' for "Rack::Lock":String caused by Warbler/JRuby-Rack ?


If you are using Warbler to create a WAR file of your application and deploying on GlassFish or any other Servlet container, then you are likely seeing the following error during deployment:

[#|2009-07-30T15:29:50.788-0700|SEVERE|sun-appserver2.1|javax.enterprise.system.container.web|_ThreadID=17;
_ThreadName=httpWorkerThread-4848-0;_RequestID=1d7e8f18-1c9a-4924-bd0b-6a07eba425ba;|WebModule
[/session]unable to create shared application instance
org.jruby.rack.RackInitializationException: undefined method `new' for "Rack::Lock":String
        from /Users/arungupta/tools/glassfish/v2.1/glassfish/domains/domain1/applications/j2ee-modules/session/WEB-INF/gems/gems/actionpack-2.3.2/lib/
action_controller/middleware_stack.rb:116:in `inject'
        from /Users/arungupta/tools/glassfish/v2.1/glassfish/domains/domain1/applications/j2ee-modules/session/WEB-INF/gems/gems/actionpack-2.3.2/lib/
action_controller/middleware_stack.rb:116:in `build'
        from /Users/arungupta/tools/glassfish/v2.1/glassfish/domains/domain1/applications/j2ee-modules/session/WEB-INF/gems/gems/actionpack-2.3.2/lib/
action_controller/dispatcher.rb:82:in `initialize'

. . .

This is a known issue as reported at JRUBY-3789 and JRUBY_RACK-18.

As the bug report indicates, this is actually an issue with jruby-rack-0.9.4 and is fixed in jruby-rack-0.9.5. The 3-step workaround is described here and explained below for convenience:
  1. Do "warble war:clean" to clean up the .war file and staging area. This basically removes previous version of jruby-rack.jar.
  2. Download the latest jruby-rack-0.9.5 snapshot (complete list) and copy in the "lib" directory of your application.
  3. If "config/warble.rb" does not exist then generate it using "jruby -S config warble". Edit "config/warble.rb" such that it looks like:

      # Additional Java .jar files to include. Note that if .jar files are placed
      # in lib (and not otherwise excluded) then they need not be mentioned here.
      # JRuby and JRuby-Rack are pre-loaded in this list. Be sure to include your
      # own versions if you directly set the value
      # config.java_libs += FileList["lib/java/*.jar"]
      config.java_libs.delete_if {|f| f =~ /jruby-rack/ }
      config.java_libs += FileList["lib/jruby-rack*.jar"]

    This will pack jruby-rack-0.9.5 snapshot instead of the one bundled with Warbler.

    Now warbler 1.0.0 bundles "jruby-complete-1.3.0RC1.jar". Optionally, you can also download the latest jruby-complete (jruby-complete-1.3.1.jar as of this writing) and copy in the "lib" directory of your application. In that case, modify the above fragment to:

      # Additional Java .jar files to include. Note that if .jar files are placed
      # in lib (and not otherwise excluded) then they need not be mentioned here.
      # JRuby and JRuby-Rack are pre-loaded in this list. Be sure to include your
      # own versions if you directly set the value
      # config.java_libs += FileList["lib/java/*.jar"]
      config.java_libs.delete_if {|f| f =~ /jruby-rack/ || f =~ /jruby-complete/ }
      config.java_libs += FileList["lib/jruby-complete*.jar"]
      config.java_libs += FileList["lib/jruby-rack*.jar"]

    This packs the "jruby-complete-1.3.1.jar" in your .war file.
And now follow your regular procedure of creating the .war file using "jruby -S warble" and happily deploy your Rails/Sintara/Merb applications on GlassFish.

There are several users who are already using Rails on GlassFish in production environment and they are listed at rubyonrails+glassfish+stories. Drop a comment on this blog if you are using it too :)

Technorati: jruby rack glassfish war servlet rubyonrails

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

http://blogs.sun.com/arungupta/date/20090728 Tuesday July 28, 2009

Track your running miles using JRuby, Ruby-on-Rails, GlassFish, NetBeans, MySQL, and YUI Charts


This blog introduces a new application that will provide basic tracking of your running distance and generate charts to monitor progress. There are numerous similar applications that are already available/hosted and this is a very basic application. What's different about this ?

The first version of this application is built using JRuby, Ruby-on-Rails, GlassFish Gem, MySQL, and NetBeans IDE. This combination of technologies is a high quality Rails stack that is used in production deploymnet at various places. Still nothing different ?

A similar version of this application will be built using a variety of Web frameworks such as Java EEGrails, Wicket, Spring and Struts2 (in no particular order). The goal is to provide a similar application, slightly bigger than "Hello World," built using different frameworks and deploy on GlassFish. Each framework will then be evaluated based upon the criteria ranging from the basic principles of framework, ease-of-use in design/development/testing/debugging/production of this web app, database interaction, tools support, ability to add 3rd party libraries, browser compatibility and other points. 

An important point to note is that this is not an exhaustive evaluation of different Web frameworks and the scope is limited only to this application.

A complete list of frameworks planned is available here. The criteria used to evaluate each framework is described here. Your feedback in terms of Web frameworks and evaluation criteria is highly appreciated.  Please share your feedback on the users list.

Now the first version of application. The complete instructions to check out and run the Rails version of this application are available here.

Here are some charts generated using the application:



and



YUI is used for all the charting capabilities.

And here is a short video that explains how the application work:



If you are a runner, check out the application and use it for tracking your miles. A sample runlog is available in "test/fixtures/runlogs.yml" and races in "test/fixtures/races.yml".

If you know Rails, please provide feedback if the application is DRY and using the right set of helpers.

If you'd like the existing list of web frameworks to be pruned or include another one to the list, let us know.

Share you feedback at users@runner.kenai.com.

Technorati: jruby rubyonrails glassfish netbeans mysql yahoo yui chart running miles framework

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

http://blogs.sun.com/arungupta/date/20090702 Thursday July 02, 2009

Rails on GlassFish - "most performant of all", "simpler and just works", "blazing speed"


Here are some quotes about running Rails applications on GlassFish from user@jruby mailing list:

I find the glassfish gem to be the most performant of all -- and I don't need to war-up my app.

I also have some mongrel cluster stuff, but glassfish is simpler and just works.

Voila...blazing speed, can handle lots of traffic. Note that I am also cominging into apache from a dyndns name. So, whatever IP I have, I can go straight to execution on the glassfish gem and NO warring up! What could be easier deployment, or a faster execution?

It's running fantasticly and performing like nothing I've seen before :) Completely stable memory, no wirings or anything bad for 5 days now.. (with several ab/htperf stresstests).

It's always exciting to get good endorsements of our efforts in the GlassFish team :)

Other similar stories for using Rails/GlassFish in production are described at rubyonrails+stories.

Technorati: glassfish v3 gem rubyonrails stories jruby

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

http://blogs.sun.com/arungupta/date/20090616 Tuesday June 16, 2009

TOTD #84: Using Apache + mod_proxy_balancer to load balance Ruby-on-Rails running on GlassFish


TOTD #81 explained how to install/configure nginx for load-balancing/front-ending a cluster of Rails application running on GlassFish Gem. Another popular approach in the Rails community is to use Apache HTTPDmod_proxy_balancer. A user asked the exact details of this setup on the GlassFish Gem Forum. This Tip Of The Day (TOTD) will clearly explain the steps.

  1. Create a simple Rails scaffold and run this application using GlassFish Gem on 3 separate ports as explained in TOTD #81.
  2. Setup and configure HTTPD and mod_proxy_balancer
    1. Setup and install Apache HTTPD as explained here. I believe mod_proxy_balancer and other related modules comes pre-bundled with HTTPD, at least that's what I observed with Mac OS X 10.5.7. Make sure that the "mod_proxy_balancer" module is enabled by verifying the following line is uncommented in "/etc/apache2/httpd.conf":

      LoadModule proxy_balancer_module libexec/apache2/mod_proxy_balancer.so

      Please note another similar file exists in "/etc/httpd/httpd.conf" but ignore that one.
    2. Setup a mod_proxy_balancer cluster by adding the following fragment in "httpd.conf" as:

      <Proxy balancer://glassfishgem>
      BalancerMember http://localhost:3000
      BalancerMember http://localhost:3001
      BalancerMember http://localhost:3002
      </Proxy>

      The port numbers must exactly match with those used in the first step.
    3. Specify the ProxyPass directives to map the cluster to a local path as:

      ProxyPass / balancer://glassfishgem/
      CustomLog /var/log/glassfishgem.log/apache_access_log combined

      The "/" at the end of "balancer://glassfishgem" is very important to ensure that all the files are resolved correctly.
    4. Optionally, the following directive can be added to view the access log:

      CustomLog /var/log/glassfishgem.log/apache_access_log combined

      Make sure to create the directory specified in "CustomLog" directive.
  3. Now the application is accessible at "http://localhost/runlogs". If a new GlassFish instance is started then update the <Proxy> directive and restart your HTTPD as "sudo httpd -k restart". Dynamic update of BalancerMembers can be configured as explained here.
TOTD #81 started the Rails application in root context. You can alternatively start the application in a non-root context as:

~/tools/jruby/rails/runner >../../bin/jruby -S glassfish -e production -c myapp
Starting GlassFish server at: 10.0.177.178:3000 in production environment...
Writing log messages to: /Users/arungupta/tools/jruby-1.3.0/rails/runner/log/production.log.
Press Ctrl+C to stop.
. . .
~/tools/jruby/rails/runner >../../bin/jruby -S glassfish -e production -c myapp -p 3001
Starting GlassFish server at: 10.0.177.178:3001 in production environment...
Writing log messages to: /Users/arungupta/tools/jruby-1.3.0/rails/runner/log/production.log.
Press Ctrl+C to stop.
. . .
~/tools/jruby/rails/runner >../../bin/jruby -S glassfish -e production -c myapp -p 3002
Starting GlassFish server at: 10.0.177.178:3002 in production environment...
Writing log messages to: /Users/arungupta/tools/jruby-1.3.0/rails/runner/log/production.log.
Press Ctrl+C to stop.

and then the ProxyPass directive will change to:

ProxyPass /myapp/ balancer://glassfishgem/myapp/

The changes are highlighted in bold. And the application is now accessible at "http://localhost/myapp/runlogs".

After discussing on Apache HTTP Server forum, the BalancerMember host/port can be printd in the log file using a custom log format. So add the following log format to "/etc/apache2/httpd.conf":

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" \"%{BALANCER_WORKER_NAME}e\"" custom

And change the format from the default "combined" to the newly defined "custom" format as:

CustomLog /var/log/glassfishgem.com/apache_access_log custom

Three subsequent invocations of "http://localhost/runlogs" then prints the following log entries:

::1 - - [17/Jun/2009:10:53:53 -0700] "GET /runlogs HTTP/1.1" 304 - "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11" "http://localhost:3002"
::1 - - [17/Jun/2009:10:54:04 -0700] "GET /runlogs HTTP/1.1" 200 621 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11" "http://localhost:3000"
::1 - - [17/Jun/2009:10:54:05 -0700] "GET /runlogs HTTP/1.1" 304 - "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11" "http://localhost:3001"

As evident from the last fragment of each log line, the load is distributed amongst three GlassFish Gem instances. More details on load balancer algorithm are available here.

Feel free to drop a comment on this blog if you are using GlassFish in production for your Rails applications. Several stories are already available at rubyonrails+glassfish+stories.

Technorati: glassfish rubyonrails apache httpd mod_proxy_balancer loadbalancing clustering

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

http://blogs.sun.com/arungupta/date/20090610 Wednesday June 10, 2009

OPIN Systems - Financial Application using JRuby-on-Rails on GlassFish


OPIN Systems has chosen JRuby, Rails, and GlassFish for a customer-facing financial application. Why ? "Easy to setup Rails application and add more intense logic in JRuby calls"

Learn more about it in this video:



Thanks to Ben Leadholm for the quick story! Check out other GlassFish Production Stories.

Check out Ben's "Dude, Where's my pass ?" entry:


Read several other Rails/GlassFish success stories.

Technorati: conf javaone sanfrancisco glassfish rubyonrails stories

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

http://blogs.sun.com/arungupta/date/20090515 Friday May 15, 2009

Ruby-on-Rails and Ramaze production deployments on GlassFish


Published three new JRuby/GlassFish production deployment stories in as many days:

Who ? Recipe Why GlassFish ?
JRuby + Rails + GlassFish v2 + MySQL + Apache Web Server + memcached The GlassFish processes have been among the most stable of our deployment.

and

(The) GlassFish team has been extremely helpful along the way with tuning and diagnosing performance issues.
JRuby + Rails + GlassFish v2 + MySQL + Solaris Zones GlassFish works and provides useful error messages.
Recipe: JRuby + Ramaze + GlassFish v2 + MySQL/H2 What's essential for me is that I spend my time doing development, not sysadmin work, so I settle for a working solution.   I've had no trouble for a few months now, and redeploy using simple scripts.

Other similar JRuby stories are available at jruby+stories. Other GlassFish stories are available here.

Technorati: jruby rubyonrails ramaze stories glassfish

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

http://blogs.sun.com/arungupta/date/20090506 Wednesday May 06, 2009

Rails Conf 2009 Day 3 Trip Report

Attended a great talk by Michael Bleigh on Twitter on Rails. He has built a gem, TwitterAuth, that uses Twitter as authentication provider (OAuth or HTTP Basic) which allows to to quickly and easily create Twitter applications in Rails. In Michael's words "TwitterAuth makes Twitter Rails apps stupid simple".

The talk built Twistener - a Twitter application in Rails that shows how many tweepl are having a conversation about you. A hosted version of the application is available at twisteners.heroku.com. The slides and  end result of the code are always helpful.

In a post-talk conversation he mentioned that all the gems are pure Ruby. Any body willing to re-build the application and trying using JRuby and GlassFish ?

And then attended Rails 3: Stepping off of the Golden Path by a "morally loose, cheese eating surrender monkey", aka Matt Aimonetti :)

What are you going to get in Rails 3 ?

  • Improved performance
  • Increased modularity 
  • Agnosticism (choose any JS framework)
  • Public API
  • Mountable Apps
Rails 3: ORM => ActiveRecord, JavaScript => Prototype, Templating => ERB, Testing => Test::Unit. The defaults are exactly same as Rails 2.x.x and the idea is to provide the least amount of changes from user perspective, yet provide a choice.

Some other key points highlighted in the talk were:
  • More flexible, Less opinionated
  • Templating engines: HAML and ERB are the big ones.
  • ORM: ActiveRecord, DataMapper
  • Adapaters: RDBMS, File Ssytem, IMAP, YAML, REST APIs, Custom APIs
  • Sequel: Prepared statement, Sharding, highly customization SQL
  • Use Hibernate with either ActionORM, JRuby
  • Ability to talk to Non RDBMS Systems; GAE, CouchDB, Redis, Tokyo Cabinet, etc
Had a so-so lunch buffet at a local Indian restaurant with a limited variety and average food. It was hot in Vegas today (98 degrees high and 72 degrees low) and we walked to the restaurant. An Indian buffet and a long walk in the high temperatures is a perfect recipe for a sleepy afternoon ;-) But it was apparently contagious cause the person sitting next to me dozed off while I kept awake!

Anyway here are some pictures captured earlier today:


And then the complete album:



See ya next year!

Technorati: conf railsconf lasvegas rubyonrails

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

Rails Conf 2009 Day 3 - Chris's Keynote


An informal survey this morning at Rails Conf 2009 keynote showed:

40% Rails developers in startup
30% Rails developers in consulting
30% Rails developers work in internal projects

Engine Yard got a sponsor keynote slot and announced Flex - a cloud computing platform on EC2 to host Rails applications. They also showed one-button self-healing clusters. One of the speakers was particularly scared (reminds me of my early days) and IRC#railsconf had a pool of $125 to hug him on the stage :) Anyway, read more details here.

The highlight of the morning was keynote by Chris Wanstrath (@defunkt). I took multiple notes during the keynote but the  transcript has all the details. The first part of the talk has good tips on how to create a successful blog such as blog personality, template, killer name and a sleek design, sparse side bar, consistency and structure, and many others.

There was a good bashing of SourceForge towards 60% in the talk. Chris gave a suggestion to SourceForge:

They should cut their registration process down to a single page, remove the 200 character "please host my project" plea, be more lenient on the categorization, suggest an open source license for you, then allow you to change any of these things after your project has been created.

And there are other interesting ones too. Read the full text and enjoy!

Here were some of the Q&As at the end of keynote ...

Q. What was your inspiration for github ?
A. Inspiration is coding, doing open source software all the time, downloading patches, relative paths were getitng in the way to coding. Source forge registration page is too long. github is very simple for anything code related that you want to put there.

Q. You develop these interesting pieces of software, have a job, play guitar, create pieces of music, drum music, how you do this in one lifetime ?
A. I outsource most of it. All of us do it, I post my music and code on the Internet, watch a lot of TV. I'm into sharing on github. Don't have a better work ethic, just talk a lot.

Q. What do you watch on the TV  ?
A. Legend of the secret

Q. Built a bunch of tools used by non-Rubyists, how can we promote Ruby there ?
A. RubyGems is one reason I fell in love with Ruby. Remove the friction and lower the barrier to entry.

Q. Focus github around the code/community, it helps around the people, opposite of Source Forge/Ruby Forge
A. Github is like facebook for code development.

Technorati: conf railsconf git github lasvegas rubyonrails

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

http://blogs.sun.com/arungupta/date/20090505 Tuesday May 05, 2009

Rails Conf 2009 Day 2 Trip Report

This is a follow up post from David's keynote.

Attended Women in Rails panel discussion. The panel, Sarah Mei, Lori Olson, and Desi McAdam (from L to R), had a very interesting discussion around the genuine problems and possible solutions of involving more women in Rails community.

Sarah is trying to involve more women in the San Francisco Ruby meetup. She plans to invite non-traditional audience like those who never programmed before, other language programmers, and similar. The details will be shared after performing the exercise for a year. Lori started Calgary Ruby Group. She do lot of self promotion so that younger women feel inspired. Desi is a co-founder of devChix with the purpose of "build a community of women developers". All the panelists were very vocal about being visible, having a blog and twitter presence is a good start.

Here are some random notes captured ...

Women drop out because of kids, try to get a job and then come back with a gap in the resume. It's difficult to get a new job at that time. Sarah is trying to reach out to that group who have that gap in their resume.

Visbility is important "She did that, I can do too!".

Data point: Women % in Rails community is much less than in other development community, e.g. Java or .NET world.
Another data point: % of women is more in larger companies, not in smaller companies. The reason is facilities like maternity leave, training (don't have evening hours to train themselves, can't sacrifice family time), etc.

Real stats from 2006: Women participation in open source community is 2-3%, 20-25% in "enterprise"

Appeal from the panelist "Guys, help us, tell .NET developer that Rails is not all guys, spread the word.".

Here are some Q&As captured:

Q. Should women be given free/discounted tickets to RailsConf ?
A. If women can't pay for it, then devChix can help them. RailsConf have helped before. It'll help if childcare is available.

Q. Why are we only looking at CS ? Why not other areas who have the development skills ?
A. Panel do reach out to multiple audience and seeks help from everybody in spreading the word. Women will be working on JavaScript and thinks she is designer. A guy will read 3 blog entries and thinks he is developer. There is a market salary differential between designer and developer. Women need to be more public about their programming status.

Q. Women won't present themselves as something they are not confident because they'll be called upon. How do you fix it ?
A. Everybody is learning. David's comment "I don't know everything in Rails" was commended. Girls need to know if it's important then they can figure it out. They are scared of messing the impression of their gender.

And of course there was a discussion on "Pr0ngate scandal":

Sarah: Matt is not a bad guy, he made a mistake that lot of people make in software development. If 1 out of 100 does not match the pattern of software developer, then that "1" may not be a software developer. The organizers of the conference did not do anything wrong. I voted for the talk and trust the judgement of the people. A negative feeling started developing but don't want to see that honestly. We learned something from it. As a relatively young community, this was bound to happen.

Lori: Not from the presentation itself but form the community reaction to this event. Blown out of proportion because of the same reasons when there is a conflict with developers in same company. You can't argue with somebody regarding how they feel. Can have a discussion, but argument is never going to be a win for anyone. That's where the community reaction devolved.

Desi: If Matt would've said "Oh Crap, I offended and wouldnt mean to offend you.", everything would've been fine. To David: "Next time, do us a favor and keep your mouth shut. It didn't help."

I was certainly expecting many more women to show up in the room but there were very few. Anyway, read Desi's blog entry about the panel. And I reached out to all three of them for helping in any manner :)

I presented on Develop with Pleasure, Deploy with Fun: GlassFish and NetBeans for a better Rails experience, slides here. The several concepts in the talk are explained in the following bullets:

The next talk of the day was JRuby: State of the Art

Why JRuby on VM ?
  • Best memory management
  • Dynamic optimizations
  • Reliable native threads: run threads across multiple cores
  • Vast number of libraries
  • Interop with Java, Scala, Rhino, Jython, ...
  • Ubiquitous
Performance
  • Fastest production-ready Ruby implementation
  • Definitely faster than 1.8.6
  • JRuby -> Bytecode -> Native code -> Optimizations
Future JVM Work
  • "invokedynamic": Build fast dynamic invocation in JVM, JRuby support by June, allow Hotspot to do all optimizations across Ruby calls
  • Multi-language VM "Da Vinci Machine", Optimized tail calls, continuations, fixnums, value types
Threading
  • Only production-ready impl with real threads
  • Ruby thread is a normal thread that can run on multiple cores
Simple Rails App
  • 1 Controller/Mode/View, send 1000 reqs
  • 80% less memory in 10 instance example, 96% for 20 instances
GlassFish
  • Gem, WAR-based
  • nginx, Apache: mod_proxy
Ruby 1.9 is 80-90% complete, IRB works, RubyGems works

FFI
  • Call C functions directly from Ruby
  • Portable unlike extensions
Who uses JRuby ?
  • Kenai
  • Gravitor
  • King Pong (JRuby wrapping MonkeyEngine)
  • Oslo's Gardermoen Airport to refuel planes
  • ThoughtWorks Mingle
    • No cross-platform SVN libraryfor Ruby
    • Bundling of installation
    • Security (ecnrypting source code)
    • Memory profile
    • Avoiding process proliferation
  • mix.oracle.com
    • 5 developers, 6 weeks for all development, 2887 LOC
  • Trisano: Open source infectious disease reporting system
    • Ease of deployment
    • Every enterprise on the planet run Java
    • Extensive project roadmap
Check out interactive Q & A from the session in the following video fragment:



Later in the evening, Brian Helmkamp, Aman Gupta, Luis Navena, Pat Allan, Dan Kubb, and John Nunemaker were awarded Ruby Heroes Award!


And the keynote by Tim Ferris, lets not talk about it ;-) I edited pictures, authored my blog, caught up on email/RSS during the keynote. #railconf on IRC and twitter were way more fun! Check the live ratings.

"1" was the lowest rating that could be given anyway!

Watch the interview on why Sea Change Affinity picked JRuby/GlassFish.

Finally watch some of the snapshots captured today:


And then the evolving album:



Technorati: conf railsconf lasvegas jruby rubyonrails glassfish netbeans

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

Valid HTML! Valid CSS!

This is a personal weblog, I do not speak for my employer.