Skip to main content

GlassFish v3 Gem Updated

Posted by arungupta on January 5, 2008 at 6:25 AM PST

Pramod published an updated href="http://blogs.sun.com/pramodg/entry/a_newer_glassfish_v3_gem">JRuby
Gem for GlassFish v3. Download the gem href="http://download.java.net/javaee5/v3/releases/gem/GlassFish-10.0.0-java.gem">here.



Here are the updates from href="http://blogs.sun.com/arungupta/entry/announcing_glassfish_gem_for_rails">last
time:

  1. The Gem is now smaller - 2.4 MB instead of 2.9 MB (approx
    20% smaller).
  2. The Gem is now using the latest v3 codebase, including
    Grizzly JRuby module 1.6.1.
  3. 2 Rails instances are created instead of the default one.
    So now 2 requests can be invoked in parallel and they both will be
    served instead of returning a blank page for the pending request. This
    explains/resolves the issue reported href="http://weblogs.java.net/blog/arungupta/archive/2007/09/announcing_glas.html#31461">here.
  4. The list of known issues is now available


    1. href="https://glassfish.dev.java.net/issues/show_bug.cgi?id=3856">#3856
      - Default Rails page gives 404
    2. href="https://glassfish.dev.java.net/issues/show_bug.cgi?id=3964">#3964
      - Option to specify port at the command-line
    3. href="https://glassfish.dev.java.net/issues/show_bug.cgi?id=3965">#3965
      - Port conflict should be resolved transparently
    4. href="https://glassfish.dev.java.net/issues/show_bug.cgi?id=3966">#3966
      - Blank page returned if no Rails instance is available
    5. href="https://glassfish.dev.java.net/issues/show_bug.cgi?id=3968">#3968
      - Provide a means to configure number of Rails instances
    6. href="https://glassfish.dev.java.net/issues/show_bug.cgi?id=3971">#3971
      - Usage of v3 gem needs to be consistent with WEBrick



    Please href="https://glassfish.dev.java.net/issues/enter_bug.cgi?issue_type=DEFECT">file
    bugs if you see any other issues.

Ad of course, you can href="http://blogs.sun.com/arungupta/entry/totd_18_how_to_build1">BYOG
(Build style="font-weight: bold;">Your style="font-weight: bold;">Own style="font-weight: bold;">Gem :)



Either way, once the Gem is installed then go ahead and use it as
described
below:

  1. Create a template app as:



    jruby -S rails hello
  2. Create a controller and view as:



    cd hello

    jruby script/generate controller say hello
  3. Edit controller as:



    vi app/controllers/say_controller.rb



    and add the following variable in hello helper method:



    @hello_string = "v3 Gem is getting polished!"
  4. Edit view as:



    vi app/views/say/hello.rhtml



    and add the following string at the bottom:



    <%= @hello_string %>
  5. Ad deploy the application on GlassFish v3 gem as:



    cd ..

    jruby -S glassfish_rails hello

That's it! The following output in the console confirms successful
start of the Gem:



Jan 4, 2008 3:35:52 PM
com.sun.grizzly.standalone.StaticResourcesAdapter <init>

INFO: New Servicing page from:
/Users/arungupta/testbed/r126/jruby-1.0.3/bin/hello/public

Jan 4, 2008 3:36:00 PM com.sun.enterprise.v3.server.AppServerStartup run

INFO: Startup service : Application Loader

Jan 4, 2008 3:36:00 PM com.sun.enterprise.v3.server.AppServerStartup run

INFO: Startup service : Grizzly on port 8080

Jan 4, 2008 3:36:00 PM com.sun.enterprise.v3.server.AppServerStartup run

INFO: Glassfish v3 started in 8567 ms




The application is deployed at http://localhost:8080/hello/say/hello
and shows the output as:



alt="GlassFish v3 gem - Simple App output"
title="GlassFish v3 gem - Simple App output"
src="http://blogs.sun.com/arungupta/resource/images/v3-gem-say-hello-output.png">



And http://localhost:8080/hello is displayed
in the browser as shown below:



alt="Default Rails page with v3 gem"
title="Default Rails page with v3 gem"
src="http://blogs.sun.com/arungupta/resource/images/default-rails-page-v3-gem.png">



And you can try more advanced applications like href="http://blogs.sun.com/arungupta/entry/mephisto_on_glassfish_v3">Mephisto
as described here.

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

Related Topics >>

Comments