Skip to main content

NetBeans 6.5 M1: GlassFish v3 + Rails

Posted by arungupta on July 8, 2008 at 6:08 AM PDT



NetBeans IDE 6.5 Milestone 1 is now href="http://www.netbeans.org/servlets/NewsItemView?newsItemID=1254">available.
The New
and Noteworthy
feature list certainly makes it worthy for the
install - comprehensive PHP support ( href="http://www.netbeans.org/kb/docs/php/php-editor-screencast.html">Editor
Screencast and href="http://www.netbeans.org/kb/trails/php.html">PHP
Learning Trail), href="http://wiki.netbeans.org/NewAndNoteWorthyMilestone1NB65#section-NewAndNoteWorthyMilestone1NB65-JavaScriptDebugger">JavaScript
Debugger, href="http://wiki.netbeans.org/NewAndNoteWorthyMilestone1NB65#section-NewAndNoteWorthyMilestone1NB65-Groovy">Groovy
Editor, href="http://wiki.netbeans.org/NewAndNoteWorthyMilestone1NB65#section-NewAndNoteWorthyMilestone1NB65-GrailsSupport">Grails
support and Numerous improvements in other areas are some of
them.



Let's get started!

  1. Download href="http://bits.netbeans.org/download/6.5/m1/">NetBeans
    6.5 M1. Installation is pretty straight-forward and I
    customized it with the following options:



    src="http://blogs.sun.com/arungupta/resource/netbeans/nb6.5m1-custom-install.png">



    After a simple installation process, check the "About" box as:



    src="http://blogs.sun.com/arungupta/resource/netbeans/nb6.5m1-about.png">




  2. GlassFish v3
    plug-in and TP2
    is baked into the main release and so it is pre-configured for you. No
    need to install the href="http://blogs.sun.com/arungupta/entry/screencast_24_getting_started_with">additional
    plugin.



    This blog walks you through creating a simple Rails app and shows the
    nice improvements along the way.
  3. Let's create a simple Rails app:



    src="http://blogs.sun.com/arungupta/resource/netbeans/nb6.5m1-new-rails.png">



    Notice, GlassFish v3 is chosen as the default Server.
  4. Specify the database connection as:



    src="http://blogs.sun.com/arungupta/resource/netbeans/nb6.5m1-new-rails-db.png">



    and click on "Finish". NetBeans is bundled with JRuby 1.1.2 and Rails
    2.1.0.
  5. Start MySQL as "sudo mysqld_safe --user root".
  6. Running Rake commands from within is more natural now.
    Right-click on the project and select "Run/Debug Rake Task ..."



    src="http://blogs.sun.com/arungupta/resource/netbeans/nb6.5m1-run-rake.png">



    The dialog shows all the Rails rake tasks available. Typing the Rake
    command prunes the list matching

    the pattern and shows:



    src="http://blogs.sun.com/arungupta/resource/netbeans/nb6.5m1-rake-tasks.png">



    Type "db:create" and select "Run".
  7. Create a new Scaffold by right-clicking on "Project" and
    selecting "Generate..." and entering the value as shown:



    src="http://blogs.sun.com/arungupta/resource/netbeans/nb6.5m1-rails-new-scaffold.png">



    and clicking on "OK".
  8. Migrate the database by invoking Rake command as shown:



    src="http://blogs.sun.com/arungupta/resource/netbeans/nb6.5m1-rails-rake-db-migrate.png">



    and selecting "Run".
  9. Right-select the project and select "Run" as shown:



    src="http://blogs.sun.com/arungupta/resource/netbeans/nb6.5m1-rails-run.png">



    The default App Server page at "http://localhost:8080" is shown. This
    will be href="http://www.netbeans.org/issues/show_bug.cgi?id=139188">updated
    to "http://localhost:8080/RailsApplication19" which is the default
    Rails page for the final release.
  10. After adding couple of entries the final output looks like:



    src="http://blogs.sun.com/arungupta/resource/netbeans/nb6.5m1-rails-output.png">

With NetBeans 6.5, you can easily run your Rails applications on
GlassFish v3 by taking most of the defaults. href="http://developers.sun.com/appserver/reference/techart/rails_gf/">Rails
powered by the GlassFish Application Server explains the
reasons to do so.

Subsequent blog entries will highlight other aspects of NetBeans IDE
6.5 M1.



Technorati: href="http://technorati.com/tag/netbeans">netbeans
glassfish
v3 href="http://technorati.com/tag/rubyonrails">rubyonrails
mysql

Related Topics >>

Comments

Chris, did you try copying Oracle JDBC driver in GlassFish's lib directory ?

"The driver encountered an error: cannot load Java class oracle.jdbc.driver.OracleDriver" How do I use the oracle driver with Glassfish 3? its a problem I encounter again and again when trying to use glassfish with netbeans. There doesn't seem to be an odvious way to do it. Any help appreciated. Thanks Chris