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


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 webtier@glassfish.dev.java.net.

All other GlassFish related screencasts are available here.

Technorati: glassfish v3 netbeans rubyonrails jruby screencast
Comments:

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.

Posted by Bill Kocik on November 06, 2008 at 10:48 PM PST #

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.

Posted by Peter Williams on November 07, 2008 at 05:46 AM PST #

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 ...?

Posted by Stephen Bannasch on November 07, 2008 at 06:10 AM PST #

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?

Posted by Stephen Bannasch on November 07, 2008 at 06:33 AM PST #

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 webtier@glassfish.dev.java.net.

Posted by Arun Gupta on November 07, 2008 at 06:45 AM PST #

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:

jdbcmysql

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'
RAILS_CONNECTION_ADAPTERS = %w(jdbc)
end

Posted by Stephen Bannasch on November 07, 2008 at 06:48 AM PST #

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.

Posted by Stephen Bannasch on November 07, 2008 at 06:52 AM PST #

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 webtier@glassfish.dev.java.net ? We can resume the discussion there.

user@ruby.netbeans.org is the right alias for asking all your Rails/NetBeans related questions.

Posted by Arun Gupta on November 07, 2008 at 09:16 AM PST #

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 users@ruby.netbeans.org mailing list.

Thanks again to both of you.

Posted by Bill Kocik on November 08, 2008 at 12:30 AM PST #

Hi Stephen,

Regarding the error you saw, please see
http://wiki.netbeans.org/FaqRubyRakeFetchingFailed 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.

Erno

Posted by Erno Mononen on November 09, 2008 at 06:19 PM PST #

[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...

Posted by Arun Gupta's Blog on November 10, 2008 at 08:32 PM PST #

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

Posted by jose antonio ramos on November 10, 2008 at 10:22 PM PST #

[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...

Posted by Arun Gupta's Blog on November 14, 2008 at 01:36 AM PST #

[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)...

Posted by Arun Gupta's Blog on November 16, 2008 at 09:53 PM PST #

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?

Posted by Benny on December 16, 2008 at 08:08 PM PST #

Benny, I posted your question to users@ruby.netbeans.org. Please follow up at:

http://ruby.netbeans.org/servlets/BrowseList?listName=users&by=date&from=2008-12-01&to=2008-12-31&first=1&count=110

Posted by Arun Gupta on December 17, 2008 at 02:37 PM PST #

4544

Posted by guest on December 19, 2008 at 02:28 AM PST #

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

Posted by D Stephen on December 26, 2008 at 03:05 AM PST #

This is now answered at:

http://blogs.sun.com/arungupta/entry/totd_60_configure_mysql_6

Posted by Arun Gupta on January 05, 2009 at 09:51 PM PST #

[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...

Posted by Arun Gupta's Blog on January 07, 2009 at 01:16 AM PST #

[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...

Posted by Arun Gupta's Blog on January 13, 2009 at 02:56 AM PST #

[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...

Posted by Arun Gupta's Blog on January 19, 2009 at 04:29 PM PST #

[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...

Posted by Arun Gupta's Blog on February 02, 2009 at 09:39 PM PST #

[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...

Posted by Arun Gupta's Blog on February 03, 2009 at 02:31 AM PST #

thank u.Thanks for information

Posted by sinema izle on March 13, 2009 at 06:39 AM PDT #

good

Posted by justin tv on March 24, 2009 at 05:06 AM PDT #

thank you

Posted by Sexy Female Celebs Wallpapers on March 24, 2009 at 05:10 AM PDT #

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

Thank you

Posted by cilt bakımı on March 24, 2009 at 05:11 AM PDT #

cilt, what error are you getting ? What platform ?

Posted by Arun Gupta on March 24, 2009 at 06:47 AM PDT #

[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...

Posted by Arun Gupta's Blog on May 05, 2009 at 10:39 PM PDT #

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 ?

Posted by Ra on June 15, 2009 at 06:31 PM PDT #

[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...

Posted by Arun Gupta's Blog on June 24, 2009 at 01:56 PM PDT #

[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...

Posted by Arun Gupta's Blog on June 24, 2009 at 02:00 PM PDT #

This is my first post on blogs.sun.com. I hope to use this space do discuss current topics in the areas on web application security and data privacy.
http://www.watchrolexshop.com
http://www.gamegoldme.com
http://www.cheap-lotrogold.com
http://www.globalsale.me/Aion-gold-083.aspx
http://www.cheap-gamegold.org
http://www.gamegoldvip.org

Posted by aion gold on June 24, 2009 at 04:10 PM PDT #

http://www.globalsneaker.com

Posted by nike hign tops on July 07, 2009 at 11:31 AM PDT #

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.

Posted by discount jewelry on July 07, 2009 at 05:21 PM PDT #

wholesale replica handbags

Posted by sare on July 31, 2009 at 07:44 PM PDT #

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!"

Posted by cheap gucci shoes on August 12, 2009 at 01:53 PM PDT #

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

Posted by sterling silver jewelry on August 20, 2009 at 04:31 PM PDT #

<H1><strong><a title="ثيمات" href="http://vb.5b5b.com/f113/">ثيمات</a></strong></H1>
<H1><strong><a title="نغمات" href="http://vb.5b5b.com/f18/">نغمات</a></strong></H1>
<H1><strong><a title="رسائل" href="http://vb.5b5b.com/f192/">رسائل</a></strong></H1>
<H1><strong><a title="جوال" href="http://vb.5b5b.com/">جوال</a></strong></H1>
<H1><strong><a title="برامج" href="http://vb.5b5b.com/f12/">برامج</a></strong></H1>
<H1><strong><a title="صور" href="http://www.arab-photos.net/">صور</a></strong></H1>
<H1><strong><a title="كورة" href="http://vb.5b5b.com/f43/">كورة</a></strong></H1>
<H1><strong><a title="افلام" href="http://www.arab-movies.net">افلام</a></strong></H1>
<H1><strong><a title="العاب" href="http://www.arab-games.com/">العاب</a></strong></H1>
<H1><strong><a title="مقاطع بلوتوث" href="http://vb.5b5b.com/f17/">مقاطع بلوتوث</a></strong></H1>
<H1><strong><a title="شات" href="http://chat.sh8d.com/">شات</a></strong></H1>
<H1><strong><a title="دردشة" href="http://www.sh8d.com/">دردشة</a></strong></H1>
<H1><strong><a title="منتدى شهد" href="http://vb.sh8d.com/">منتدى شهد</a></strong></H1>
<H1><strong><a title="شهد" href="http://www.sh8d.com/">شهد</a></strong></H1>
<H1><strong><a title="منتديات شهد" href="http://vb.sh8d.com/">منتديات شهد</a></strong></H1>
<H1><strong><a title="ترجمة" href="http://www.trgmh.com/">ترجمة</a></strong></H1>
<H1><strong><a title="نيونار" href="http://www.newn2r.com/">نيونار</a></strong></H1>
<H1><strong><a title="شات" href="http://www.3atboha.com/">شات</a></strong></H1>
<H1><strong><a title="دردشة كتابية" href="http://www.re44re.com/">دردشة كتابية</a></strong></H1>
<H1><strong><a title="منتدى" href="http://vb.sh8d.com/">منتدى</a></strong></H1>
<H1><strong><a title="منتديات" href="http://vb.galiti.com/">منتديات</a></strong></H1>
<H1><strong><a title="منتدى" href="http://forum.6hk.com/">منتدى</a></strong></H1>
<H1><strong><a title="منتدى بنات" href="http://vb.bnatdll3.com/">منتدى بنات</a></strong></H1>
<H1><strong><a title="دردشة كتابية" href="http://www.sh8d.com/">دردشة كتابية</a></strong></H1>
<H1><strong><a title="شات شهد" href="http://www.sh8d.com/">شات شهد</a></strong></H1>
<H1><strong><a title="دردشة شهد" href="http://www.sh8d.com/">دردشة شهد</a></strong></H1>
<H1><strong><a title="دردشة ضحك" href="http://www.6hk.com/">دردشة ضحك</a></strong></H1>
<H1><strong><a title="شات سكر" href="http://www.skkkr.com/">شات سكر</a></strong></H1>

Posted by omar7 on September 05, 2009 at 01:33 AM PDT #

<A href="http://www.china-costume-jewelry.com">Costume Jewelry </A>
<A href="http://www.china-costume-jewelry.com">wholesale Costume Jewelry </A>
<A href="http://www.chinafashionjewelrywholesale.com">china fashion jewelry wholesale</A>
<A href="http://www.925-silver-wholesale.com">925 silver jewelry wholesale</A>
<A href="http://www.chinafashionjewelrywholesale.com">cheaper fashion jewelry</A>
<A href="http://www.chinafashionjewelrywholesale.com">korea jewelry</A>
<A href="http://www.925-silver-wholesale.com">sterling silver jewelry</A>
<A href="http://www.chinacheaperwholesalejewelry.com">cheaper wholesale Jewelry </A>

Posted by costume jewelry on September 10, 2009 at 02:20 PM PDT #

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

Posted by ugg slipper on September 15, 2009 at 01:47 PM PDT #

we supply <A href="http://www.china-jewelry-supplier.com">jewelry rings</A>\\
<A href="http://www.china-jewelry-supplier.com">jewelry necklace</A>\\
<A href="http://www.china-jewelry-supplier.com">earring jewelry</A>\\
<A href="http://www.china-jewelry-supplier.com">amber jewelry</A>\\
<A href="http://www.china-jewelry-supplier.com">pearl jewelry</A>\\
<A href="http://www.china-jewelry-supplier.com">crystal jewelry</A>\\on our site china-jewelry-supplier.com welcome

and we wholesale <A href="http://www.silver-jewelry-wholesaler.com">925 silvery</A>|
<A href="http://www.silver-jewelry-wholesaler.com">sterling silver</A>|
<A href="http://www.silver-jewelry-wholesaler.com">silver crystal</A>| at silver-jewelry-wholesaler.com

another we have <A href="http://www.jewellerywholesales.com">jewellery wholesale</A>|
<A href="http://www.jewellerywholesales.com">fashion jewellery</A>|
<A href="http://www.jewellerywholesales.com">silver jewellery</A>| at jewellerywholesales.com

<A href="http://www.sterling-silver-925.com">sterling silver 925</A>|
<A href="http://www.sterling-silver-925.com">silver 925</A>|

Posted by staje on September 18, 2009 at 05:55 PM PDT #

supply all kinds fashion jewelry,cheap wholesale jewelry

Posted by jewelry wholesale on November 02, 2009 at 10:09 PM PST #

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.

Posted by Joey the Fish. on February 12, 2010 at 07:54 PM PST #

Thanks Joey!

Posted by Arun Gupta on February 15, 2010 at 08:38 AM PST #

Have you tried deploying your Rails app on GlassFish

Posted by discount jerseys on June 02, 2010 at 12:15 PM PDT #

Post a Comment:
Comments are closed for this entry.
About

profile image
Arun Gupta is a technology enthusiast, a passionate runner, author, and a community guy who works for Oracle Corp.


Java EE 7 Samples

Stay Connected

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today