Miles to go …

November 7, 2008

Screencast #26: Develop/Run/Debug Rails application using NetBeans IDE and GlassFish v3 Prelude

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

GlassFish v3 Prelude is now available. It allows Rails applications to be deployed natively using JRuby and without the need of any WAR packaging or Servlet container. An integrated NetBeans tooling provides a comprehensive development and deployment platform for all your Rails applications. And you can even purchase enterprise support as well!

This screencast shows how you can create a simple Rails application using NetBeans IDE, deploy it directly on GlassFish v3 and then debug it.

Typo, Redmine, Substruct, and Mephisto are some of the applications I’ve tried deploying on GlassFish. Have you tried deploying your Rails app on GlassFish ?

File Rails/GlassFish related bugs here using “jruby” sub-component and ask your questions on .

All other GlassFish related screencasts are available here.

Technorati: glassfish v3 netbeans rubyonrails jruby screencast

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
Related posts:
  1. Screencast #27: Simple Web Application using NetBeans 6.5 IDE and GlassFish v3 Prelude
  2. Screencast #28: Simple Web Application using Eclipse and GlassFish v3 Prelude
  3. Substruct on GlassFish v3 – Ruby-on-Rails E-Commerce Application
  4. Developing GlassFish- and MySQL-Backed Applications with Netbeans and JRuby-on-Rails – Free Webinar on Jan 27
  5. Debug application code deployed on GlassFish using NetBeans ?


  1. I just finished watching this. Great job on the screencast – thanks for taking the time to do it. I love that NetBeans makes Ruby on Rails a first-class platform in the IDE, and its integration with GlassFish is top-shelf.

    I have one question. I noticed that when you started your sample app normally it deployed it at context /GlassFishV3Rocks. When you started it in debug mode, though, it launched it at the root context. Was that expected?

    It caught my eye because I’ve not yet been able to make sense of NB’s "Deploy all Rails applications at root context" setting under Tools -> Servers -> GlassFish v3 Prelude -> JRuby tab. When unchecked, NB deploys things at /. When checked, it seems to give them a context matching the application’s name. This seems reversed.

    Comment by Bill Kocik — November 7, 2008 @ 6:48 am

  2. NetBeans 6.5 enables Rails debugging by running a small Grizzly + Rails stack. This small stack is managed similar to the way WEBrick and Mongrel are managed, so deployments are at context root and the HTTP port is dynamically selected.

    Due to technical limitations (which are being resolved for the next version of NetBeans), it was not possible to enable debugging of Rails apps against the "full server". Thus the experience is slightly different because the runtime scenario actually is slight different.

    I can’t explain your observation of a reversal of the "Deploy at /" setting. You’re correct that what you describe happening is the opposite of what should happen. You can check how an application is actually deployed by looking in domain.xml (in domains/[domain folder]/config/domain.xml) near the top. Or you can go the services tab in NetBeans, browse the deployed applications and select "Open in Browser" to access one of them and see what URL is used. That will indicate how the application is actually deployed, which should match whatever you read out of domain.xml. If "Deploy at /" is checked, then no context should be used. You may need to "Run" the application after making changing the properties setting, to ensure it takes effect. If this last thing seems counterintuitive, please file an RFE against serverplugins/glassfish_v3. I think there are some things I can do about that.

    Comment by Peter Williams — November 7, 2008 @ 1:46 pm

  3. I just downloaded NB 6.5 IDE RC2 — Ruby Pack and when I make a new Rails app using jruby 1.1.4 the only server listed is Webrick …?

    Comment by Stephen Bannasch — November 7, 2008 @ 2:10 pm

  4. Ahh … I had to use the NB menu option: Tools/Servers and add the GF server that was in the NB app bundle (this is MacOS X).

    I’m subscribed to the GF-dev list — is there a better list for discussion of ruby web applications and GF?

    Last question for now.

    I have an app environment that combines Tomcat running a Java web start server, and two Rails apps.

    Can I use NB and GF to deploy and debug all three apps?

    Comment by Stephen Bannasch — November 7, 2008 @ 2:33 pm

  5. Rails debugging is supported only on GlassFish v3. I suspect you are deploying your Rails app on Tomcat as WAR files. You can deploy them natively (no packaging or Servlet container) on GlassFish v3 Prelude. And then you should be able to debug them easily :)

    As mentioned in the blog, please direct your questions to .

    Comment by Arun Gupta — November 7, 2008 @ 2:45 pm

  6. FYI: all these tests are in JRuby

    I claimed the previous message had the last question — I guess that wasn’t true.

    I copied a dir with a current Rails app and opened it in NB. This somewhat confusing error appeared in a dialog titled "Error":

    Rake tasks fetching failed with (working directory: /Users/stephen/dev/rails/sds_auth_nb

    hmm …?

    There is no obvious console output that describes in more detail what NB was doing to generate this message.

    I noticed that creating and running a simple test app in NB and GF the test app specified the mysql adapter in config/database.yml

    When I normally run rails apps that access mysql in jruby I use the ar jdb gem/driver and spec my adapter as:


    Actually the line really looks like this so I can easily switch back and forth between jruby and cruby:

    adapter: <% if RUBY_PLATFORM =~ /java/ %>jdbcmysql<% else %>mysql<% end %>

    I also use this in environment.rb:

    if RUBY_PLATFORM =~ /java/
    require ‘rubygems’

    Comment by Stephen Bannasch — November 7, 2008 @ 2:48 pm

  7. Starting NB_GF on my existing imported Rails app displays this in the GF console:

    Unrecognized VM option ‘+UnlockDia’
    Could not create the Java virtual machine.

    The Server Startup progress bar shows activity but the server never starts.

    Comment by Stephen Bannasch — November 7, 2008 @ 2:52 pm

  8. Stephen, can you run the IDE with -J-Dglassfish.level=FINE and send the server JVM start command that will be written to the netbeans log file to ? We can resume the discussion there.

    is the right alias for asking all your Rails/NetBeans related questions.

    Comment by Arun Gupta — November 7, 2008 @ 5:16 pm

  9. Hi Peter -

    I’m definitely seeing some strangeness with contexts and routing when loading a Rails app into GF v3 from NB 6.5. But rather than pollute Arun’s blog with my issues, I’ve posted them to the mailing list.

    Thanks again to both of you.

    Comment by Bill Kocik — November 8, 2008 @ 8:30 am

  10. Hi Stephen,

    Regarding the error you saw, please see for more info on that. Basically the IDE tried to fetch the descriptions for the Rake tasks in the project using ‘rake -D’ and it failed.


    Comment by Erno Mononen — November 10, 2008 @ 2:19 am

  11. [Trackback] 1400 registrations, 112 sessions, free pizza, a barbecue on Saturday night, raffles and lot more – that is Silicon Valley Code Camp. Jitu, Jiandong, Jacob, and I presented on GlassFish at Silicon Valley Code Camp over the weekend. The…

    Comment by Arun Gupta's Blog — November 11, 2008 @ 4:32 am

  12. Hi I follow your work from NetBeans nbweekly and love it.
    Is simple to follow and great to know.
    Thank you for yours post….

    Comment by jose antonio ramos — November 11, 2008 @ 6:22 am

  13. [Trackback] GlassFish Gem 0.9.0 was recently released. It can run any Rack-compatible framework such as Rails and Merb. Support for another Rack-based framework&nbsp;Sinatra will be released in the near future. The gem is even extensible and allows to plug any of…

    Comment by Arun Gupta's Blog — November 14, 2008 @ 9:36 am

  14. [Trackback] Presented on GlassFish at Java MUG last week. The event is hosted at Sun’s North Dallas Office. It was impressive to know that local Sun team is hosting 4 User Groups (MySQL, Solaris, and OpenSolaris other than the JUG)…

    Comment by Arun Gupta's Blog — November 17, 2008 @ 5:53 am

  15. Hi Arun,

    thanks for the nicely done, concise screencast.

    Debugging RoR in NB6.5 isn’t working for me, probably because I got the concept wrong? I am on Mac OSX Leopard, using a MacPorts installation of Ruby / RubyGems.

    When I start the NB 6.5 debugger in my RoR project (choosing server side ruby debugging), Firefox will launch with the start page of my RoR project on localhost:3000 (Mongrel). Now, when I navigate to the controller I set my breakpoint in, the breakpoint in the IDE doesn’t get hit.

    In the NB sessions window, I can see the session being started at localhost:53353. The status is always "starting". Entering the address localhost:53353 in the browser does nothing, the request stalls.

    Hence my question: Is it possible debugging my RoR application on Mongrel? If so, how do I set the debugger to work together with it?

    Comment by Benny — December 17, 2008 @ 4:08 am

  16. Benny, I posted your question to . Please follow up at:

    Comment by Arun Gupta — December 17, 2008 @ 10:37 pm

  17. 4544

    Comment by Anonymous — December 19, 2008 @ 10:28 am

  18. How to Configure a MySql database to be able to connect Netbeans6.5.?

    I’ve tried using mysql Server 6 many times, but it fails.
    Please, let me know how to fix that problem.

    Thank you

    Comment by D Stephen — December 26, 2008 @ 11:05 am

  19. This is now answered at:

    Comment by Arun Gupta — January 6, 2009 @ 5:51 am

  20. [Trackback] This Tip Of The Day answers the following comment on my blog: How to Configure a MySql database to be able to connect Netbeans6.5.? I’ve tried using mysql Server 6 many times, but it fails.Please, let me know how…

    Comment by Arun Gupta's Blog — January 7, 2009 @ 9:16 am

  21. [Trackback] Here is a blog entry that was sitting in my Drafts folder for a long time (just because I didn’t realize :) . Anyway, it shows how to install Open Solaris 2008/11 on Virtual Box. The original install was done using…

    Comment by Arun Gupta's Blog — January 13, 2009 @ 10:56 am

  22. [Trackback] The Sun Tech Days Singapore started earlier this morning – over 1100 developers, an outstanding audience!!! The kick off had a good local flare when the Gods of Longevity, Fortune, and Prosperity (Fu Lu Shou) showed up to start the…

    Comment by Arun Gupta's Blog — January 20, 2009 @ 12:29 am

  23. [Trackback] Supper Happy Dev House is "a premier monthly hackathon event that combines serious and not-so-serious productivity with a fun and exciting party atmosphere." The 30th monthly event was hosted at Sun Microsystem’s Executive Briefing Center (aka EBC) in…

    Comment by Arun Gupta's Blog — February 3, 2009 @ 5:39 am

  24. [Trackback] Supper Happy Dev House is "a premier monthly hackathon event that combines serious and not-so-serious productivity with a fun and exciting party atmosphere." The 30th monthly event was hosted at Sun Microsystem’s Executive Briefing Center (aka EBC) in…

    Comment by Arun Gupta's Blog — February 3, 2009 @ 10:31 am

  25. thank u.Thanks for information

    Comment by sinema izle — March 13, 2009 @ 1:39 pm

  26. good

    Comment by justin tv — March 24, 2009 @ 12:06 pm

  27. thank you

    Comment by Sexy Female Celebs Wallpapers — March 24, 2009 @ 12:10 pm

  28. I’ve tried using mysql Server 6 many times, but it fails.
    Please, let me know how to fix that problem.

    Thank you

    Comment by cilt bakımı — March 24, 2009 @ 12:11 pm

  29. cilt, what error are you getting ? What platform ?

    Comment by Arun Gupta — March 24, 2009 @ 1:47 pm

  30. [Trackback] 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…

    Comment by Arun Gupta's Blog — May 6, 2009 @ 5:39 am

  31. Great Job!
    But what about rapid development ?
    It seems to me that in this was is not possible create class or modify code on the fly. isn’t it ?

    Comment by Ra — June 16, 2009 @ 1:31 am

  32. [Trackback] I presented on "Creating powerful web applications using GlassFish, MySQL and NetBeans/Eclipse" as the first talk of FISL 10 yesterday. The room was only partial full being the first talk of FISL but got packed towards the middle so…

    Comment by Arun Gupta's Blog — June 24, 2009 @ 8:56 pm

  33. [Trackback] I presented on "Creating powerful web applications using GlassFish, MySQL and NetBeans/Eclipse" as the first talk of FISL 10 yesterday. The room was only partial full being the first talk of FISL but got packed towards the middle so…

    Comment by Arun Gupta's Blog — June 24, 2009 @ 9:00 pm

  34. This is my first post on I hope to use this space do discuss current topics in the areas on web application security and data privacy.

    Comment by aion gold — June 24, 2009 @ 11:10 pm


    Comment by nike hign tops — July 7, 2009 @ 6:31 pm

  36. we engaged in discount jewelry, cheap jewelry, handmade jewelry, discount fashion jewelry, china jewelry, wholesale discount jewelry, discount china jewelry, discount handmade jewelry, handcrafted jewelry, discount costume jewelry, discount pearl jewelry, discount gemstone jewelry, discount turquoise jewelry, discount coral jewelry, discount shell jewelry, discount crystal jewelry, discount jewellery, cheap jewellery, handmade jewellery, discount fashion jewellery, wholesale jewelry,china jewellery and so on.

    Comment by discount jewelry — July 8, 2009 @ 12:21 am

  37. wholesale replica handbags

    Comment by sare — August 1, 2009 @ 2:44 am

  38. A father of five children came home with a toy,summoned his children and asked which one of them should be given the present,"Who is the most obedient,never talks back to Mother and does everything he or she is told?" he inquired. There was silence,and then a chorus of voices:"You play with it, Daddy!"

    Comment by cheap gucci shoes — August 12, 2009 @ 8:53 pm

  39. China Costume Jewelry—Wholesale Costume Jewelry, costume jewelry Costume Jewelry Wholesalers,rhinestone costume jewelry,cheap costume jewelry, costume jewelry supplies Vintage Costume Jewelry,gold costume jewelry, designer costume jewelry,discount costume jewelry, Gold Costume Jewelry,bridal costume jewelry, costume jewelry wholesalers, costume jewelry rings

    Comment by sterling silver jewelry — August 20, 2009 @ 11:31 pm

  40. <H1><strong><a title="ثيمات" href="">ثيمات</a></strong></H1>
    <H1><strong><a title="نغمات" href="">نغمات</a></strong></H1>
    <H1><strong><a title="رسائل" href="">رسائل</a></strong></H1>
    <H1><strong><a title="جوال" href="">جوال</a></strong></H1>
    <H1><strong><a title="برامج" href="">برامج</a></strong></H1>
    <H1><strong><a title="صور" href="">صور</a></strong></H1>
    <H1><strong><a title="كورة" href="">كورة</a></strong></H1>
    <H1><strong><a title="افلام" href="">افلام</a></strong></H1>
    <H1><strong><a title="العاب" href="">العاب</a></strong></H1>
    <H1><strong><a title="مقاطع بلوتوث" href="">مقاطع بلوتوث</a></strong></H1>
    <H1><strong><a title="شات" href="">شات</a></strong></H1>
    <H1><strong><a title="دردشة" href="">دردشة</a></strong></H1>
    <H1><strong><a title="منتدى شهد" href="">منتدى شهد</a></strong></H1>
    <H1><strong><a title="شهد" href="">شهد</a></strong></H1>
    <H1><strong><a title="منتديات شهد" href="">منتديات شهد</a></strong></H1>
    <H1><strong><a title="ترجمة" href="">ترجمة</a></strong></H1>
    <H1><strong><a title="نيونار" href="">نيونار</a></strong></H1>
    <H1><strong><a title="شات" href="">شات</a></strong></H1>
    <H1><strong><a title="دردشة كتابية" href="">دردشة كتابية</a></strong></H1>
    <H1><strong><a title="منتدى" href="">منتدى</a></strong></H1>
    <H1><strong><a title="منتديات" href="">منتديات</a></strong></H1>
    <H1><strong><a title="منتدى" href="">منتدى</a></strong></H1>
    <H1><strong><a title="منتدى بنات" href="">منتدى بنات</a></strong></H1>
    <H1><strong><a title="دردشة كتابية" href="">دردشة كتابية</a></strong></H1>
    <H1><strong><a title="شات شهد" href="">شات شهد</a></strong></H1>
    <H1><strong><a title="دردشة شهد" href="">دردشة شهد</a></strong></H1>
    <H1><strong><a title="دردشة ضحك" href="">دردشة ضحك</a></strong></H1>
    <H1><strong><a title="شات سكر" href="">شات سكر</a></strong></H1>

    Comment by omar7 — September 5, 2009 @ 8:33 am

  41. [url=نغمات/b/url
    [url= شات سكر[/b][/url]

    Comment by omar7 — September 5, 2009 @ 8:34 am

  42. <A href="">Costume Jewelry </A>
    <A href="">wholesale Costume Jewelry </A>
    <A href="">china fashion jewelry wholesale</A>
    <A href="">925 silver jewelry wholesale</A>
    <A href="">cheaper fashion jewelry</A>
    <A href="">korea jewelry</A>
    <A href="">sterling silver jewelry</A>
    <A href="">cheaper wholesale Jewelry </A>

    Comment by costume jewelry — September 10, 2009 @ 9:20 pm

  43.  The tragedy of life is not so much what men suffer, but what they miss.

    Comment by ugg slipper — September 15, 2009 @ 8:47 pm

  44. we supply <A href="">jewelry rings</A>\
    <A href="">jewelry necklace</A>\
    <A href="">earring jewelry</A>\
    <A href="">amber jewelry</A>\
    <A href="">pearl jewelry</A>\
    <A href="">crystal jewelry</A>\on our site welcome

    and we wholesale <A href="">925 silvery</A>|
    <A href="">sterling silver</A>|
    <A href="">silver crystal</A>| at

    another we have <A href="">jewellery wholesale</A>|
    <A href="">fashion jewellery</A>|
    <A href="">silver jewellery</A>| at

    <A href="">sterling silver 925</A>|
    <A href="">silver 925</A>|

    Comment by staje — September 19, 2009 @ 12:55 am

  45. supply all kinds fashion jewelry,cheap wholesale jewelry

    Comment by jewelry wholesale — November 3, 2009 @ 6:09 am

  46. Hey Arun,

    Very concise and easy to follow screencast on how to get up and running on ROR with Netbeans. The best one I have watched. 5*. Thank you.

    Comment by Joey the Fish. — February 13, 2010 @ 3:54 am

  47. Thanks Joey!

    Comment by Arun Gupta — February 15, 2010 @ 4:38 pm

  48. Have you tried deploying your Rails app on GlassFish

    Comment by discount jerseys — June 2, 2010 @ 7:15 pm

RSS feed for comments on this post. TrackBack URL

Sorry, the comment form is closed at this time.

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