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.
« OSX #6: Organizing... | Main | GlassFish/JRuby and... »

http://blogs.sun.com/arungupta/date/20080105 Saturday January 05, 2008

GlassFish v3 Gem Updated

Pramod published an updated JRuby Gem for GlassFish v3. Download the gem here.

Here are the updates from 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 here.
  4. The list of known issues is now available

    1. #3856 - Default Rails page gives 404
    2. #3964 - Option to specify port at the command-line
    3. #3965 - Port conflict should be resolved transparently
    4. #3966 - Blank page returned if no Rails instance is available
    5. #3968 - Provide a means to configure number of Rails instances
    6. #3971 - Usage of v3 gem needs to be consistent with WEBrick

    Please file bugs if you see any other issues.
Ad of course, you can BYOG (Build Your Own 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:

GlassFish v3 gem - Simple App output

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

Default Rails page with v3 gem

And you can try more advanced applications like Mephisto as described here.

Technorati: ruby jruby glassfish v3 gem

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

[Trackback] As mentioned earlier, I presented on &quot;Rails powered by GlassFish &amp; jMaki&quot; at South Bay Ruby Meetup yesterday. The slides are available here. The demos showed in the talk are listed below: screencast #web9 - Create standalone and shared WA...

Posted by Arun Gupta's Blog on January 30, 2008 at 10:31 PM PST #

[Trackback] 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. The Gem was originally announced here...

Posted by Arun Gupta's Blog on February 08, 2008 at 04:33 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
« OSX #6: Organizing... | Main | GlassFish/JRuby and... »

Valid HTML! Valid CSS!

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

--> ajax ajaxworld conf eclipse fitness gem glassfish glassfishday hyderabad india indigo interoperability javaone javaone2008 jax-ws jmaki jpa jruby marathon metro microsoft mysql netbeans phobos photography presos railsconf ruby rubyonrails running runninglog runsfm screencast siliconvalleymarathon sun suntechdays swdp tango theserverside totd training traveltips v3 vista wcf web2.0 webservices windows wsaddressing wsit
Project Tango: Adding Quality of Service and .NET Interoperability to the Metro Web Services Stack
Locations of visitors to this page

calendar

« May 2008
SunMonTueWedThuFriSat
    
11
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
       
Today

Stats

Today's Page Hits: 7894


Total # blog entries: 596
Total # comments: 1636

www.flickr.com
This is a Flickr badge showing public photos from ArunGupta. Make your own badge here.
Add to Technorati Favorites

Last 50