deploying with warbler/tomcat

Added by Carlo Alberto Degli Atti over 9 years ago

Hi,

this is my absolutely first time I get involved with Ruby & Co... so maybe I'm totally wrong.. excuse me in advance :-)

Anyway my problem is: I've installed redmine 1.1 and have followed the instructions here: http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_Apache_Tomcat

Everything seems fine (all steps are OK, included running ./scripts/server -e production ), but when I put the redmine-1.1.war into the Tomcat webapps folder and I try to access from the browser (ie: http://localhost:8080/redmine-1.1 I just see:

Internal error

An error occurred on the page you were trying to access. If you continue to experience problems please contact your redMine administrator for assistance.

BUT If I give a look to my catalina.out, I can see only few warnings;

So, maybe it's a trivial problem, but I don't know how to make the log more verbose..

This is my catalina.out dump:

INFO: Server startup in 27337 ms config.gem: Unpacked gem rubytree-0.5.2 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this. config.gem: Unpacked gem coderay-0.9.7 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this. /usr/share/tomcatProduzione/webapps/redmine-1.1/WEB-INF/gems/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement

This is my configuration:

Tomcat 6.0.29

Ruby 1.8.7.302, ruby-gems is 1.3.5:

This is my list of installed gems:

actionmailer (2.3.5) actionpack (2.3.5) activerecord (2.3.5) activeresource (2.3.5) activesupport (2.3.5) bouncy-castle-java (1.5.0145.2) i18n (0.4.2) jruby-jars (1.5.6) jruby-openssl (0.7.3) jruby-rack (1.0.7) pg (0.10.1) rack (1.0.1) rails (2.3.5) rake (0.8.7) rubyzip (0.9.4) warbler (1.2.1)

Replies (9)

RE: deploying with warbler/tomcat - Added by Felix Schäfer over 9 years ago

Have a look at the redmine log for more information, I'm not sure where that would be on jruby though.

RE: deploying with warbler/tomcat - Added by Carlo Alberto Degli Atti over 9 years ago

Thank you for answering...

I've already tried... if I'm right it is placed into the WEB-INF/log/production.log, but it contains just:

  1. Logfile created on Fri Mar 11 13:41:27 +0000 2011

no more!

Is there a way to have a more verbose log?!?!

RE: deploying with warbler/tomcat - Added by Felix Schäfer over 9 years ago

Try starting it in development mode instead of production mode (you can safely point both modes to the same DB, just keep in mind that they're not separate ;-) ).

RE: deploying with warbler/tomcat - Added by Carlo Alberto Degli Atti over 9 years ago

hmmm....
to start in a development mode do I need to change the warble.conf this way?

config.webxml.rails.env = ENV['RAILS_ENV'] || 'development'

or something else?

This is my full warble.conf:

  1. Disable automatic framework detection by uncommenting/setting to false
  2. Warbler.framework_detection = false
  1. Warbler web application assembly configuration file
    Warbler::Config.new do |config| # Features: additional options controlling how the jar is built. # Currently the following features are supported: # - gemjar: package the gem repository in a jar file in WEB-INF/lib # config.features = %w(gemjar)
    1. Application directories to be included in the webapp.
      config.dirs = %w(app config lib log vendor tmp extra files lang)
    1. Additional files/directories to include, above those in config.dirs
    2. config.includes = FileList["db"]
    1. Additional files/directories to exclude
    2. config.excludes = FileList["lib/tasks/*"]
    1. Additional Java .jar files to include. Note that if .jar files are placed
    2. in lib (and not otherwise excluded) then they need not be mentioned here.
    3. JRuby and JRuby-Rack are pre-loaded in this list. Be sure to include your
    4. own versions if you directly set the value
    5. config.java_libs += FileList["lib/java/*.jar"]
    1. Loose Java classes and miscellaneous files to be placed in WEB-INF/classes.
    2. config.java_classes = FileList["target/classes/**.*"]
    1. One or more pathmaps defining how the java classes should be copied into
    2. WEB-INF/classes. The example pathmap below accompanies the java_classes
    3. configuration above. See http://rake.rubyforge.org/classes/String.html#M000017
    4. for details of how to specify a pathmap.
    5. config.pathmaps.java_classes << "%{target/classes/,}p"
    1. Path to the pre-bundled gem directory inside the war file. Default
    2. is 'WEB-INF/gems'. Specify path if gems are already bundled
    3. before running Warbler. This also sets 'gem.path' inside web.xml.
    4. config.gem_path = "WEB-INF/vendor/bundler_gems"
    1. Bundler support is built-in. If Warbler finds a Gemfile in the
    2. project directory, it will be used to collect the gems to bundle
    3. in your application. If you wish to explicitly disable this
    4. functionality, uncomment here.
    5. config.bundler = false
    1. An array of Bundler groups to avoid including in the war file.
    2. Defaults to ["development", "test"].
    3. config.bundle_without = []
    1. Files for WEB-INF directory (next to web.xml). This contains
    2. web.xml by default. If there is an .erb-File it will be processed
    3. with webxml-config. You may want to exclude this file via
    4. config.excludes.
    5. config.webinf_files += FileList["jboss-web.xml"]
    1. Other gems to be included. You need to tell Warbler which gems
    2. your application needs so that they can be packaged in the war
    3. file.
    4. The Rails gems are included by default unless the vendor/rails
    5. directory is present.
    6. kada: removed "activerecord-jdbcmysql-adapter"
      config.gems += [ "jruby-openssl", "activerecord-jdbcpostgresql-adapter", "pg", "i18n", "rack"]
    7. config.gems << "tzinfo"
    1. Uncomment this if you don't want to package rails gem.
    2. config.gems -= ["rails"]
    1. The most recent versions of gems are used.
    2. You can specify versions of gems by using a hash assignment:
    3. config.gems["rails"] = "2.0.2"
    1. You can also use regexps or Gem::Dependency objects for flexibility or
    2. fine-grained control.
    3. config.gems << /^merb-/
    4. config.gems << Gem::Dependency.new("merb-core", "= 0.9.3")
    1. Include gem dependencies not mentioned specifically. Default is
    2. true, uncomment to turn off.
    3. config.gem_dependencies = false
    1. Array of regular expressions matching relative paths in gems to be
    2. excluded from the war. Defaults to empty, but you can set it like
    3. below, which excludes test files.
    4. config.gem_excludes = [/^(test|spec)\//]
    1. Files to be included in the root of the webapp. Note that files in public
    2. will have the leading 'public/' part of the path stripped during staging.
    3. config.public_html = FileList["public/**/*", "doc/**/*"]
    1. Pathmaps for controlling how public HTML files are copied into the .war
    2. config.pathmaps.public_html = ["%{public/,}p"]
    1. Pathmaps for controlling how application files are copied into the .war
    2. config.pathmaps.application = ["WEB-INF/%p"]
    1. Name of the war file (without the .war) -- defaults to the basename
    2. of RAILS_ROOT
    3. config.war_name = "mywar"
    1. Name of the MANIFEST.MF template for the war file. Defaults to a simple
    2. MANIFEST.MF that contains the version of Warbler used to create the war file.
    3. config.manifest_file = "config/MANIFEST.MF"
    1. When using the 'compiled' feature and specified, only these Ruby
    2. files will be compiled. Default is to compile all \.rb files in
    3. the application.
    4. config.compiled_ruby_files = FileList['app/**/*.rb']
    1. Value of RAILS_ENV for the webapp -- default as shown below
      config.webxml.rails.env = ENV['RAILS_ENV'] || 'development'
    1. Application booter to use, one of :rack, :rails, or :merb (autodetected by default)
    2. config.webxml.booter = :rails
    1. When using the :rack booter, "Rackup" script to use.
    2. - For 'rackup.path', the value points to the location of the rackup
    3. script in the web archive file. You need to make sure this file
    4. gets included in the war, possibly by adding it to config.includes
    5. or config.webinf_files above.
    6. - For 'rackup', the rackup script you provide as an inline string
    7. is simply embedded in web.xml.
    8. The script is evaluated in a Rack::Builder to load the application.
    9. Examples:
    10. config.webxml.rackup.path = 'WEB-INF/hello.ru'
    11. config.webxml.rackup = %{require './lib/demo'; run Rack::Adapter::Camping.new(Demo)}
    12. config.webxml.rackup = require 'cgi' && CGI::escapeHTML(File.read("config.ru"))
    1. Control the pool of Rails runtimes. Leaving unspecified means
    2. the pool will grow as needed to service requests. It is recommended
    3. that you fix these values when running a production server!
    4. config.webxml.jruby.min.runtimes = 2
    5. config.webxml.jruby.max.runtimes = 4
    1. JNDI data source name
    2. config.webxml.jndi = 'jdbc/rails'
      end

RE: deploying with warbler/tomcat - Added by Carlo Alberto Degli Atti over 9 years ago

Finally I got the Tomcat error log!

What does it mean?!?!?!

SEVERE: Application Error
org.jruby.rack.RackInitializationException: undefined local variable or method `version_requirements' for #<Rails::GemDependency:0x18320df>
    from file:/usr/local/data/tomcat/produzione/webapps/redmine-1.1/WEB-INF/lib/jruby-stdlib-1.6.0.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems.rb:254:in `activate'
    from file:/usr/local/data/tomcat/produzione/webapps/redmine-1.1/WEB-INF/lib/jruby-stdlib-1.6.0.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems.rb:1215:in `gem'
    from /usr/share/tomcatProduzione/webapps/redmine-1.1/WEB-INF/gems/gems/rails-2.3.5/lib/rails/gem_dependency.rb:73:in `add_load_paths'
    from /usr/share/tomcatProduzione/webapps/redmine-1.1/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:301:in `add_gem_load_paths'
    from org/jruby/RubyArray.java:1572:in `each'
    from /usr/share/tomcatProduzione/webapps/redmine-1.1/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:301:in `add_gem_load_paths'
    from /usr/share/tomcatProduzione/webapps/redmine-1.1/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:132:in `process'
    from org/jruby/RubyKernel.java:2038:in `send'
    from /usr/share/tomcatProduzione/webapps/redmine-1.1/WEB-INF/gems/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
    from /usr/share/tomcatProduzione/webapps/redmine-1.1/WEB-INF/config/environment.rb:20:in `(root)'
    from org/jruby/RubyKernel.java:1062:in `load'
    from /usr/share/tomcatProduzione/webapps/redmine-1.1/WEB-INF/config/environment.rb:54:in `load_environment'
    from file:/usr/local/data/tomcat/produzione/webapps/redmine-1.1/WEB-INF/lib/jruby-rack-1.0.7.jar!/jruby/rack/rails.rb:47:in `to_app'
    from file:/usr/local/data/tomcat/produzione/webapps/redmine-1.1/WEB-INF/lib/jruby-rack-1.0.7.jar!/jruby/rack/rails.rb:193:in `new'
    from <web.xml>:1:in `(root)'
    from org/jruby/RubyKernel.java:2007:in `instance_eval'
    from file:/usr/local/data/tomcat/produzione/webapps/redmine-1.1/WEB-INF/lib/jruby-rack-1.0.7.jar!/vendor/rack-1.2.1/rack/builder.rb:46:in `initialize'
    from <web.xml>:1:in `(root)'

    at org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:207)
    at org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:58)
    at org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackApplicationFactory.java:95)
    at org.jruby.rack.DefaultRackDispatcher.process(DefaultRackDispatcher.java:28)
    at org.jruby.rack.RackFilter.doFilter(RackFilter.java:58)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
    at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:774)
    at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
    at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:896)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
    at java.lang.Thread.run(Thread.java:636)
Caused by: org.jruby.exceptions.RaiseException: (NameError) undefined local variable or method `version_requirements' for #<Rails::GemDependency:0x18320df>

RE: deploying with warbler/tomcat - Added by Felix Schäfer over 9 years ago

version_requirements is a method that was part of older rubygems, but has been deprecated and removed since. I think there's a fix in Redmine to work around that, but it seems the version you have doesn't have the fix yet. You have 2 choices: either upgrade redmine, or downgrade the rubygems that's with jruby/warbler.

RE: deploying with warbler/tomcat - Added by Carlo Alberto Degli Atti over 9 years ago

Thanks a lot!

I've got the latest redmine (1.1) from svn... so, maybe it has been fixed in the trunk...
rubygems is 1.3.5, I'm trying to downgrade... but I've to look for the right rpm...

RE: deploying with warbler/tomcat - Added by Felix Schäfer over 9 years ago

The incriminated rubygems is the one in jruby, not the one you have installed on your system ruby. I think 1.3.5 is fine, but you probably have a newer version in jruby.

RE: deploying with warbler/tomcat - Added by Mypsycho Public over 8 years ago

I posted on a new way to install Redmine.
This procedure is dedicated to people having no Ruby/Rails skills (like me).

Take a look at http://www.redmine.org/boards/1/topics/27046

(1-9/9)