Redmine on GlassFish - Ruby-on-Rails Project Management Application



Redmine
is a flexible project management web application written using Ruby on Rails framework. The feature list is pretty comprehensive from the usual suspects like multiple projects, role-based control, forums/wikis/SCM for each project to enterprise level features such as LDAP-authentication and multiple languages. It is cross-platform and cross-database and deploys very nicely on GlassFish v3.

GlassFish v3 modularity and extensibility allows Rails applications to be deployed without any modification (no WARing). This blog explains the steps on how to deploy Redmine on GlassFish and shows some screenshots later. More documentation is available in Redmine Guide.
  1. Check out the most stable release of Redmine by giving the command:

    ~/testbed/redmine >svn co http://redmine.rubyforge.org/svn/branches/0.7-stable redmine-0.7
  2. Configure the database
    1. Start your MySQL server 

      ~/testbed/redmine >sudo mysqld_safe --user root
      Starting mysqld daemon with databases from /usr/local/mysql/data
    2. Create the database as:

      ~/testbed/redmine/redmine-0.7 >../jruby-1.1.1/bin/jruby -S rake db:create
      (in /Users/arungupta/testbed/redmine/redmine-0.7)
    3. Migrate the database as:

      ~/testbed/redmine/redmine-0.7 >../jruby-1.1.1/bin/jruby -S rake db:migrate
      (in /Users/arungupta/testbed/redmine/redmine-0.7)
      == 1 Setup: migrating =========================================================
      -- create_table("attachments", {:force=>true})
         -> 0.2840s
      -- create_table("auth_sources", {:force=>true})
         -> 0.0540s
      -- create_table("custom_fields", {:force=>true})
         -> 0.0430s
      -- create_table("custom_fields_projects", {:id=>false, :force=>true})
         -> 0.0080s
      -- create_table("custom_fields_trackers", {:id=>false, :force=>true})
         -> 0.0500s

      . . .

      == 90 ChangeVersionsNameLimit: migrating ======================================
      -- change_column(:versions, :name, :string, {:limit=>nil})
         -> 0.0220s
      == 90 ChangeVersionsNameLimit: migrated (0.0220s) =============================

      == 91 ChangeChangesetsRevisionToString: migrating =============================
      -- change_column(:changesets, :revision, :string, {:null=>false})
         -> 0.0210s
      == 91 ChangeChangesetsRevisionToString: migrated (0.0230s) ====================

      == 92 ChangeChangesFromRevisionToString: migrating ============================
      -- change_column(:changes, :from_revision, :string)
         -> 0.0130s
      == 92 ChangeChangesFromRevisionToString: migrated (0.0150s) ===================
  3. Download, Install and Configure GlassFish v3
    1. Download GlassFish v3 from here.
    2. Unzip the downloaded bundle.
    3. Add the following fragment as the last line in "glassfishv3-tp2/glassfish/config/asenv.conf" file:

      JRUBY_HOME="/Users/arungupta/testbed/redmine/jruby-1.1.1"
  4. Deploy Redmine as:

    ~/testbed/redmine >./glassfishv3-tp2/glassfish/bin/asadmin deploy redmine-0.7
    Command deploy executed successfully.

    ... and the GlassFish console shows:

    May 21, 2008 4:58:30 PM com.sun.enterprise.rails.RailsDeployer registerAdapter
    INFO: Loading application redmine-0.7 at /redmine-0.7
    May 21, 2008 4:58:30 PM 
    INFO: Starting Rails instances
    May 21, 2008 4:58:37 PM 
    SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for full support.
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
    May 21, 2008 4:58:42 PM com.sun.grizzly.jruby.RubyObjectPool$1 run
    INFO: Rails instance instantiation took : 11979ms
    May 21, 2008 4:58:42 PM com.sun.enterprise.v3.deployment.DeployCommand execute
    INFO: Deployment of redmine-0.7 done is 12091 ms
That's it, your application is ready to be used! Here are some screen snapshots from my trial run:


















Rails powered by the GlassFish Application Server provides all the good reasons on why you should consider using GlassFish instead of the traditional deployment models for Ruby-on-Rails applications.

This application is also covered in LAB 5539 as part of FREE 20-week Ruby-on-Rails course by Sang "with Passion" Shin.

Technorati: web2.0 rubyonrails jruby ruby glassfish redmine
Comments:

You rocks ! Thank for doing this ! It's have been in my to do list but never got to execute it.

Posted by TK on May 23, 2008 at 02:43 AM PDT #

[Trackback] JRuby 1.1.2 is now released - download here! The highlights are: Startup time drastically reduced YAML symbol parsing >100x faster Performance, threading, and stack depth improvements for method calls Fixed several nested backref problems Fixed bad...

Posted by Arun Gupta's Blog on May 29, 2008 at 12:16 AM PDT #

Thanks for the information. However I'm curious to know what is benefit of deploying a Rails Application in Glassfish ? Or in other words why should one consider deploying their Rails app in Glassfish ?

Posted by Andy Yasuna on June 02, 2008 at 03:48 AM PDT #

Andy, http://developers.sun.com/appserver/reference/techart/rails_gf/ describes exactly the set of reasons why Rails need to be powered by the GlassFish application server.

Posted by Arun Gupta on June 04, 2008 at 07:45 AM PDT #

[Trackback] Substruct is an open-source E-Commerce project written using Ruby-on-Rails framework. It provides a simple e-commerce platform, content management system and customer response system - all in one. I found out about this application from Sang "Passion"...

Posted by Arun Gupta's Blog on June 30, 2008 at 04:05 AM PDT #

hi Arun,

thanks for creating this page, it is very helpful !

When I follow your steps to deploy redmine 0.7 to glassfish v3, I got this error, do u know why?

/Users/mei/Downloads/glassfishv3-tp2/glassfish/bin/asadmin deploy redmine-0.7FAILURE : Failed to load com.sun.enterprise.rails.RailsSniffer from ModuleClassLoader(name=org.glassfish.extras:gf-jruby-connector, parent=,URls[]=file:/Applications/glassfishv3-tp2/glassfish/modules/gf-jruby-connector-10.0-tp-2-SNAPSHOT.jar,),init=true,URls[]=file:/Applications/glassfishv3-tp2/glassfish/modules/gf-jruby-connector-10.0-tp-2-SNAPSHOT.jar,)
Command deploy failed.

Posted by mei on July 17, 2008 at 03:51 AM PDT #

I see the above mentioned error when I used this command to deploy the app /Users/mei/Downloads/glassfishv3-tp2/glassfish/bin/asadmin deploy redmine-0.7

but I don't see the error when I used this command:

/Users/mei/Downloads/jruby-1.1.2/bin/jruby -S glassfish_rails redmine-0.7

so it would be a bug in GF.

Posted by Mei on July 17, 2008 at 04:21 AM PDT #

Mei,

I followed the steps and could deploy easily. Here is the log that I saw:

INFO: Loading application redmine-0.7 at /redmine-0.7
Jul 17, 2008 4:56:14 PM
INFO: Starting Rails instances
Jul 17, 2008 4:56:16 PM
SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for full support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
Jul 17, 2008 4:56:21 PM com.sun.grizzly.jruby.RubyObjectPool$1 run
INFO: Rails instance instantiation took : 6967ms
Jul 17, 2008 4:56:21 PM com.sun.enterprise.v3.deployment.DeployCommand execute
INFO: Deployment of redmine-0.7 done is 6977 ms

Here is how I start v3:

java -DJRUBY_HOME=/Users/arungupta/testbed/rails202/jruby-1.1.2 -jar modules/glassfish-10.0-tp-2-SNAPSHOT.jar

Are you using GlassFish v3 TP2 or trunk ?

Is it Rails 2.0.2 or 2.1 ?

Posted by Arun Gupta on July 17, 2008 at 08:57 AM PDT #

Hi Arun,

I'm using Rails 2.0.2 and GF V3 TP2, not the trunk.

The failing only happens when I used the asadmin deploy command.

e.g. /Users/mei/Downloads/glassfishv3-tp2/glassfish/bin/asadmin deploy redmine-0.7

It works fine if I use the following command to deploy

/Users/mei/Downloads/jruby-1.1.2/bin/jruby -S glassfish_rails redmine-0.7

Thanks,

Mei

Posted by mei on July 22, 2008 at 04:25 AM PDT #

[Trackback] Typo is an open-source Blogging Engine written using Ruby-on-Rails framework. It provides a lean engine that makes blogging easy. It's main attribtues are ease of use, usability, beauty and excellent support of web standards. I found out about this...

Posted by Arun Gupta's Blog on August 27, 2008 at 10:50 PM PDT #

[Trackback] Typo is an open-source Blogging Engine written using Ruby-on-Rails framework. It provides a lean engine that makes blogging easy. It's main attribtues are ease of use, usability, beauty and excellent support of web standards. I found out about this...

Posted by Arun Gupta's Blog on August 27, 2008 at 10:57 PM PDT #

[Trackback] Last day of Rails Conf Europe 2008 (Day 1 & Day 2), and it's finally over! David Black's opening session talked about Ruby and Rails Symposium: Versions, Implementations, and the Future. Here is a brief summary of MRI Ruby...

Posted by Arun Gupta's Blog on September 05, 2008 at 03:19 PM PDT #

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

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

Thanks for the information. However I'm curious to know what is benefit of deploying a Rails Application in Glassfish ? Or in other words why should one consider deploying their Rails app in Glassfish ?

Posted by wow gold on March 11, 2009 at 05:34 PM PDT #

http://developers.sun.com/appserver/reference/techart/rails_gf/ describes the advantages of using GlassFish for running Rails applications.

Posted by Arun Gupta on March 12, 2009 at 11:17 AM PDT #

[Trackback] TOTD #70, #71, #72, #73 shows four integration tests that can ensure that the latest JRuby and GlassFish versions work nicely with each other. #70 showed how to create a trivial Rails application and run it using GlassFish Gem. #71...

Posted by Arun Gupta's Blog on March 16, 2009 at 04:49 AM PDT #

[Trackback] TOTD #70, #71, #72, #73 shows four integration tests that can ensure that the latest JRuby and GlassFish versions work nicely with each other. #70 showed how to create a trivial Rails application and run it using GlassFish Gem. #71...

Posted by Arun Gupta's Blog on March 16, 2009 at 04:53 AM PDT #

Great doc, I have one question though:
How can you set the environment variable (e.g.: production, development, test)? With this tutorial the redmine always starts in development mode...
Thanks!

Posted by Peter Major on December 01, 2009 at 08:02 AM PST #

Peter,

Just include RAILS_ENV=production at the CLI to change the environment.

Posted by Arun Gupta on February 23, 2010 at 09:05 AM PST #

do you know if the gantt chart works fine?

thanks

Posted by Daniel Caro on April 11, 2010 at 05:58 PM PDT #

Daniel,

I've heard folks using Redmine in production so seems like the features are working nicely. I've not tried Gantt charts personally so can't comment. Let us know if they don't work though.

Posted by Arun Gupta on April 12, 2010 at 11:14 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