Over a million developers have joined DZone.

TOTD #32: Rails Deployment on GlassFish v3 from NetBeans IDE

· Java Zone

Thrive in the application economy with an APM model that is strategic. Be E.P.I.C. with CA APM.  Brought to you in partnership with CA Technologies.


Rails powered by the GlassFish Application Server explains all the benefits of using GlassFish for developing and deploying your Rails applications. If you are using NetBeans 6.1 builds then you can deploy your Rails application directly on GlassFish v3 from within NetBeans IDE. No longer you need to have different development and deployment options.

This blog explains how to install a bleeding-edge GlassFish v3 plugin and use it to deploy your Rails app natively on GlassFish (no WAR or anything :). Let's get started! Note, this plugin is bleeding edge and will soon be released on the Beta Update Center.
  1. Install "GlassFish v3 TP2" plugin in NetBeans 6.1
    1. In NetBeans 6.1 IDE, go to "Tools", "Plugins" and click on "Settings". The following window is shown:

    2. Click on "Add" and specify the URL of Bleeding Edge Update Center values as shown (copy from "http://deadlock.netbeans.org/hudson/job/javadoc-nbms/lastSuccessfulBuild/artifact/nbbuild/nbms/updates.xml.gz"):



      Click on "OK". The updated "Plugins" window looks like:




      Notice "Available Plugins" has changed from 58 to 140 as many more bleeding edge plugins are now available.
    3. Click on "Available Plugins" and search for "GlassFish" in the top-right corner text box as shown below:

    4. Select "GlassFish V3 JRuby Integration" and "GlassFish V3 JavaEE Integration" plugin and click on "Install" as shown below:



      Follow the instructions to install the plugin. The IDE needs to restart for successful plugin installation.
    5. In the restarted IDE, go to "Services" tab, right-click on "Servers" and select "Add Server...". Select "GlassFish v3 TP2" as shown below:

    6. Select "Next >", accept the license agreement and click on "Download V3 Now..."



      Click on "Download V3 Now...". This downloads the latest GlassFish v3 TP2 build and installs in "/Users/arungupta/GlassFish_V3_TP2" directory. This is only an interim build, final TP2 build will be available soon! The following screen is shown once GlassFish v3 is installed:



      Click on "Finish". In 58 seconds, you downloaded and installed the entire GlassFish v3 app server, cool isn't it!
  2. Create a Rails app and deploy on GlassFish V3
    1. In NetBeans IDE, in the "Projects" tab, right-click and select "New Project...". Select "Ruby" in "Categories" and "Ruby on Rails Applications" in "Projects" as shown:



      Click on "Next".
    2. Now comes the cool part. Enter the application name and select the recently installed GlassFish v3 as shown:



      This is a brand new feature in the "GlassFish v3 TP2" plugin available only on "Bleeding Edge" Update Center. It'll soon replace the default GlassFish v3 plugin from the Beta Update Center.

      Click on "Finish" to take all other defaults.
    3. On the newly created project, right-click and select "Run" as shown:

    4. The default browser page "http://localhost:8080/" shows up. Change the URL to "http://localhost:8080/HelloRails" and the following page shows up:

Now, NetBeans IDE and GlassFish v3 serves your need for a complete development and deployment platform for Ruby-on-Rails applications.

If any part of the tooling is not working or you have suggestions and improvement then please file bugs on IssueZilla ("serverplugins" component) and use "glassfish_v3" subcomponent. If any part of the runtime is not working, then please file bugs on Issue Tracker ("V3" component) and use "jruby" subcomponent.

Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. A complete archive is available here.

Navigate the Maze of the End-User Experience and pick up this APM Essential guide, brought to you in partnership with CA Technologies

Topics:

Published at DZone with permission of Arun Gupta, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}