Project

General

Profile

Glassfish v3.1 + Redmine 1.1.2 + Postgres Guide (and help request)

Added by Ben Siroshton about 13 years ago

Hi. As per the subject I am setting up the Redmine on Glasfish and almost have it working but need a little help. I have started a bullet point guide on what to do and will post it here in hopes that it might help others that have struggled with this.

After following the steps below I have successfully deployed redmine, however when I try and access it I get errors. The first being that yaml.rb could not be found; this makes me think that my jruby home is not being picked up because I do indeed have yaml.rb in there. I'm just not sure how to tell glassfish/redmine to look in my jruby home for needed ruby files. Any help here would be greatly appreciated.

Thanks!

-=ben

Guide follows:

--------------------------------------------------------------------------------
Installing Redmine on Glassfish with PostgreSQL
--------------------------------------------------------------------------------
Version notes at bottom.

- Install Glashfish

- Download the latest jruby and hold onto this for later. Do NOT install this.

- Create new user in postgres "redmine" and for sake of this document
the password "redmine"

- Create new database "redmine" and make the user "redmine" the owner

- Use Glassfish update tool and install jruby

- Now we are going to replace the installed jruby with the latest version.
Download jruby. Replace files in [glassfish install]/glassfish/jruby/ with
the new files.

- Add your [glassfish install]/glassfish/jruby/bin to your PATH.

- Copy the posgresql jdbc driver to these folders:
1> [glassfish install]/glassfish/lib

- Download and Extract Redmine

- Open command prompt and go to Redmine folder

- Type the following commands
1> jruby -S gem install -v=0.4.2 i18n
2> jruby -S gem install jdbc-postgres
3> jruby -S gem install jruby-openssl
4> jruby -S gem install warbler

- Edit the file config/database.yml. Clear the file and add these lines (dont
use tabs):

-------------- copy --------------
#production:
  1. adapter: jdbc
  2. jndi: jdbc/redmine
  3. driver: org.postgresql.Driver

production:
adapter: postgresql
database: redmine
host: localhost
username: redmine
password: redmine
encoding: utf8
port: 5432

-------------- copy --------------

- Now type these commands from the redmine folder:
1> jruby -S rake generate_session_store
2> jruby -S rake db:migrate RAILS_ENV=production
3> jruby -S rake redmine:load_default_data RAILS_ENV=production

- Edit the config/database.yml and reverse the commented secitions out. The
upper portion will now be uncommented and the lower portion will be commented.

- Execute:
1> jruby -S warble config

- Next edit the file config/warble.rb add add the line:

config.gems["rack"] = "1.0.1"
Also search for "jruby-openssl" and uncomment that line and remove the
active record portion so it looks like this:
config.gems += ["jruby-openssl"]

- Now we can build the war file for deployment, type:
1> jruby -S warble

- Open the War file and remove WEB-INF/lib/jruby-core-1.4.0.jar file and
replace it with the jruby.jar file found in the latest jruby release
you downloaded earlier. You do not need to rename this file. This is needed
otherwise when you run redmine you will get a Method Not Found exception for
a method that was added in jruby 1.5.

- Next, go to glassfish and add the redmine connection pool and jdbc resource
to match what we put in the database.yml file.

- Deploy redmine onto glassfish, with any luck you made it without any errors.

--------------------------------------------------------------------------------
Versions I used at the time of writing
-------------------------------------------------------------------------------
Postgresql 9.0
Glassfish 3.1
Redmine 1.1.2
JRuby 1.4.0 <-- in glassfish
JRuby 1.6.1 <-- for war file

jruby -S gem list

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activerecord-jdbc-adapter (0.9.2)
activerecord-jdbcmysql-adapter (0.9.2)
activeresource (2.3.5)
activesupport (2.3.5)
bouncy-castle-java (1.5.0145.2)
i18n (0.4.2)
jdbc-mysql (5.0.4)
jdbc-postgres (9.0.801)
jruby-jars (1.4.0)
jruby-openssl (0.7.3)
jruby-rack (1.0.8)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rspec (1.2.9)
rubyzip (0.9.4)
sources (0.0.1)
warbler (1.2.1, 0.9.14)

--------------------------------------------------------------------------------
References: http://karanar.net/?p=265
--------------------------------------------------------------------------------


Replies (2)

RE: Glassfish v3.1 + Redmine 1.1.2 + Postgres Guide (and help request) - Added by Ben Siroshton about 13 years ago

Here is the error output from my Glassfish log:

[#|2011-04-15T13:14:22.248-0700|INFO|glassfish3.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=133;_ThreadName=Thread-1;|PWC1412: WebModule[null] ServletContext.log():An exception happened during JRuby-Rack startup
no such file to load -- yaml
--- System
jruby 1.6.1 (ruby-1.8.7-p330) (2011-04-12 85838f6) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_24) [Windows 7-amd64-java]
Time: Fri Apr 15 13:14:22 -0700 2011
Server: GlassFish Server Open Source Edition 3.1
jruby.home: classpath:/META-INF/jruby.home

--- Context Init Parameters:
com.sun.faces.forceLoadConfiguration = true
com.sun.faces.validateXml = true
public.root = /
rails.env = production

--- Backtrace
LoadError: no such file to load -- yaml
require at org/jruby/RubyKernel.java:1038
(root) at /C:/sun/glassfish3/glassfish/domains/domain1/generated/jsp/redmine-1.1.2/loader_1978163060/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:7
require at org/jruby/RubyKernel.java:1038
(root) at /C:/sun/glassfish3/glassfish/domains/domain1/generated/jsp/redmine-1.1.2/loader_1978163060/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:1124
require at org/jruby/RubyKernel.java:1038
(root) at /C:/sun/glassfish3/glassfish/domains/domain1/generated/jsp/redmine-1.1.2/loader_1978163060/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems.rb:113
require at org/jruby/RubyKernel.java:1038
(root) at C:/sun/glassfish3/glassfish/domains/domain1/applications/redmine-1.1.2/WEB-INF/config/boot.rb:11
load at org/jruby/RubyKernel.java:1063
load_environment at C:/sun/glassfish3/glassfish/domains/domain1/applications/redmine-1.1.2/WEB-INF/config/environment.rb:54
to_app at /C:/sun/glassfish3/glassfish/domains/domain1/generated/jsp/redmine-1.1.2/loader_1978163060/jruby/rack/rails.rb:47
new at /C:/sun/glassfish3/glassfish/domains/domain1/generated/jsp/redmine-1.1.2/loader_1978163060/jruby/rack/rails.rb:193
(root) at <web.xml>:1
instance_eval at org/jruby/RubyKernel.java:2021
initialize at /C:/sun/glassfish3/glassfish/domains/domain1/generated/jsp/redmine-1.1.2/loader_1978163060/vendor/rack-1.2.2/rack/builder.rb:46
(root) at <web.xml>:1
Activated gems:

--- Bundler
undefined method `bundle_path' for Bundler:Module

--- JRuby-Rack Config
background_spooling = false
compat_version =
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = false
initial_runtimes =
jms_connection_factory =
jms_jndi_properties =
logger = org.jruby.rack.logging.ServletContextLogger@3826ea10
logger_class_name = servlet_context
logger_name = jruby.rack
maximum_runtimes =
memory_buffer_size = 65536
num_initializer_threads =
rackup =
rackup_path =
rewindable = true
runtime_timeout_seconds =
serial_initialization = false
servlet_context = org.apache.catalina.core.ApplicationContextFacade@a7d060f

--- $LOAD_PATH:
/C:/sun/glassfish3/glassfish/domains/domain1/generated/jsp/redmine-1.1.2/loader_1978163060/vendor/rack-1.2.2
classpath:/META-INF/jruby.home/lib/ruby/site_ruby/1.8
classpath:/META-INF/jruby.home/lib/ruby/site_ruby/shared
classpath:/META-INF/jruby.home/lib/ruby/1.8
. |#]

[#|2011-04-15T13:14:22.249-0700|SEVERE|glassfish3.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=133;_ThreadName=Thread-1;|WebModule[/redmine-1.1.2]Application Error
org.jruby.rack.RackInitializationException: no such file to load -- yaml
from /C:/sun/glassfish3/glassfish/domains/domain1/generated/jsp/redmine-1.1.2/loader_1978163060/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:7:in `(root)'
from org/jruby/RubyKernel.java:1038:in `require'
from /C:/sun/glassfish3/glassfish/domains/domain1/generated/jsp/redmine-1.1.2/loader_1978163060/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:1124:in `(root)'
from org/jruby/RubyKernel.java:1038:in `require'
from /C:/sun/glassfish3/glassfish/domains/domain1/generated/jsp/redmine-1.1.2/loader_1978163060/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems.rb:113:in `(root)'
from org/jruby/RubyKernel.java:1038:in `require'
from C:/sun/glassfish3/glassfish/domains/domain1/applications/redmine-1.1.2/WEB-INF/config/boot.rb:11:in `(root)'
from org/jruby/RubyKernel.java:1063:in `load'
from C:/sun/glassfish3/glassfish/domains/domain1/applications/redmine-1.1.2/WEB-INF/config/environment.rb:54:in `load_environment'
from /C:/sun/glassfish3/glassfish/domains/domain1/generated/jsp/redmine-1.1.2/loader_1978163060/jruby/rack/rails.rb:47:in `to_app'
from /C:/sun/glassfish3/glassfish/domains/domain1/generated/jsp/redmine-1.1.2/loader_1978163060/jruby/rack/rails.rb:193:in `new'
from <web.xml>:1:in `(root)'
from org/jruby/RubyKernel.java:2021:in `instance_eval'
from /C:/sun/glassfish3/glassfish/domains/domain1/generated/jsp/redmine-1.1.2/loader_1978163060/vendor/rack-1.2.2/rack/builder.rb:46:in `initialize'
from <web.xml>:1:in `(root)'

RE: Glassfish v3.1 + Redmine 1.1.2 + Postgres Guide (and help request) - Added by Ben Siroshton about 13 years ago

Ok, .I got it all working, yay! I will post a new message with the updated guide.

Thanks.

-=ben

    (1-2/2)