Jruby-rack and warbler

I’m hoping someone can help resolve an issue I’m having with deploying a
warble made jar file. I have a jar file that when I deploy it, it is
having
problems find rack. I’m using Rails 3.0.3 with Warbler 1.2.1,
jruby-rack
1.0.4, JRuby 1.5.6. Rack 1.2.1 has been bundled in and is sitting in
the
default packaged path of WEB-INF/gems (with gems & specifications as sub
directories of that).

I’ve tried the following:

  1. Setting both GEM_PATH and GEM_HOME before deployment (OS X 10.5
    Server)
  2. Tried setting gem.path in WEB-INF/web.xml (both with and without the
    adding the public.root path as a prefix to it… /WEB-INF/gems versus
    WEB-INF/gems)
  3. Tried setting the full path
  4. Creating .bundle/config and setting it so it’s pointing at
    WEB-INF/gems

I don’t know what else I can do, does any one have any suggestions?
This
happens with both a web application I’ve been working on and a freshly
generated rails. If any more information is required, please let me
know.

Caused by: org.jruby.exceptions.
RaiseException: no such file to load – rack
at
(unknown).new(file:/PATH_TO_TOMCAT_WEBAPP_DIR/WEB-INF/lib/jruby-rack-1.0.4.jar!/vendor/rack.rb:7)
at
Kernel.require(file:/PATH_TO_TOMCAT_WEBAPP_DIR/WEB-INF/lib/jruby-rack-1.0.4.jar!/vendor/rack.rb:7)
at
(unknown).(unknown)(file:/PATH_TO_TOMCAT_WEBAPP_DIR/WEB-INF/lib/jruby-rack-1.0.4.jar!/vendor/rack.rb:28)
at
Kernel.require(file:/PATH_TO_TOMCAT_WEBAPP_DIR/WEB-INF/lib/jruby-rack-1.0.4.jar!/jruby/rack/booter.rb:28)
at
JRuby::Rack::Booter.boot!(file:/PATH_TO_TOMCAT_WEBAPP_DIR/WEB-INF/lib/jruby-rack-1.0.4.jar!/jruby/rack/rails.rb:20)
at
JRuby::Rack::RailsBooter.boot!(file:/PATH_TO_TOMCAT_WEBAPP_DIR/WEB-INF/lib/jruby-rack-1.0.4.jar!/jruby/rack/boot/rack.rb:10)
at
(unknown).(unknown)(file:/PATH_TO_TOMCAT_WEBAPP_DIR/WEB-INF/lib/jruby-rack-1.0.4.jar!/jruby/rack/boot/rack.rb:1)
at
(unknown).(unknown)(file:/PATH_TO_TOMCAT_WEBAPP_DIR/WEB-INF/lib/jruby-rack-1.0.4.jar!/jruby/rack/boot/rack.rb:1)
at Kernel.load(:1)
at (unknown).(unknown)(:1)

`–> gem update
Updating installed gems
Nothing to update

`–> gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.3)
actionpack (3.0.3)
activemodel (3.0.3)
activerecord (3.0.3)
activerecord-jdbc-adapter (1.1.0)
activerecord-jdbcsqlite3-adapter (1.1.0)
activerecord-oracle_enhanced-
adapter (1.3.1)
activeresource (3.0.3)
activesupport (3.0.3)
arel (2.0.6)
bouncy-castle-java (1.5.0145.2)
builder (3.0.0, 2.1.2)
bundler (1.0.7)
capistrano (2.5.19)
erubis (2.6.6)
ffi (1.0.2, 1.0.1)
ffi-ncurses (0.3.3)
formtastic (1.2.2, 1.1.0)
highline (1.6.1)
i18n (0.5.0)
jdbc-sqlite3 (3.6.14.2.056)
jruby-jars (1.5.6)
jruby-openssl (0.7.2)
jruby-rack (1.0.4)
mail (2.2.12)
mime-types (1.16)
mocha (0.9.10)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.0.23)
net-ssh-gateway (1.0.1)
nifty-generators (0.4.2)
nokogiri (1.4.4.2, 1.4.4)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.6)
rails (3.0.3)
railties (3.0.3)
rake (0.8.7)
rubyzip (0.9.4)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.23)
warbler (1.2.1)
weakling (0.0.4)
webrat (0.7.2)
yard (0.6.3)

Sounds like you’re making work for yourself.

FWIW, my gems get bundled under WEB-INF/gems/gems,
but the simplest fix is probably just to use a top-level Gemfile
and let warbler handle the packaging.

e.g

Mine looks like:

restscaler:$ ls
Gemfile clients config.ru lib
restscaler:$ cat Gemfile
source :rubygems
gem ‘sinatra’
gem ‘json_pure’
gem ‘jruby-openssl’
gem ‘rack’
gem ‘rack-cache’
gem ‘savon’, “= 0.7.9”

Then a simple ‘warble war’ does the trick. No need for a warbler config
file.

Sounds like everything should be working. Can you set
“jruby.rack.debug.load” as a context parameter inside web.xml? That
should give more details on the error, including dumping out the load
path at the point where the error occurs.

/Nick

I found the same problem. It looks like it doesn’t like spaces in the
path as of 1.5.6. Jruby 1.5.5 works fine.
Our system is tomcat on windows.

I apologize for the lack of writing back, being sick and vacation will
cause
that from time to time.
I have set the param as Nick asked:

jruby.rack.debug.load true

It appears I’m now getting the same message as shown here:
Issues · nicksieger/jruby-rack · GitHub (Same
exact
error, line numbers and all)
I’ve also switched back to Jruby 1.5.5 as I have spaces in my file name
(and
unfortunately can’t change this).

Using Jruby 1.5.5, if I don’t enable jruby.rack.debug.load, it complains
about not being able to find erb. Enabling it and it complains about
not
finding logger. The load path is:
file:/PATH_TO_TOMCAT_WEBAPP_DIR/WEB-INF/lib/jruby-stdlib-1.5.5.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8
file:/PATH_TO_TOMCAT_WEBAPP_DIR/WEB-INF/lib/jruby-stdlib-1.5.5.jar!/META-INF/jruby.home/lib/ruby/site_ruby/shared
file:/PATH_TO_TOMCAT_WEBAPP_DIR/WEB-INF/lib/jruby-stdlib-1.5.5.jar!/META-INF/jruby.home/lib/ruby/1.8
.

Everything appears to be proper. I even went as far as to unzip
jruby-stdlib-1.5.5.jar and saw that the files (erb.rb and logger.rb) are
within the load path. Switching back to Jruby 1.5.6 and it complains
about
not being able to find rack (as before). With the jruby.rack.debug.load
param set to true, it about finding logger (as with jruby 1.5.5). The
only
difference in the load path is that it points to 1.5.6 instead of 1.5.5
and
it uses %20 for a space instead of just a space (as with 1.5.5).

Anything else I can test/attempt? All help is appreciated.

Dec 27, 2010 5:51:29 PM org.apache.catalina.core.ApplicationContext log

Ken A. wrote in post #970324:

I found the same problem. It looks like it doesn’t like spaces in the
path as of 1.5.6. Jruby 1.5.5 works fine.
Our system is tomcat on windows.

I’m seeing the same thing. As of 1.5.6 it seems to no longer work with
spaces in the path name.

Nick S. wrote in post #972276:

On Tue, Jan 4, 2011 at 11:44 AM, Shane E. [email protected]
wrote:

Ken A. wrote in post #970324:

I found the same problem. It looks like it doesn’t like spaces in the
path as of 1.5.6. Jruby 1.5.5 works fine.
Our system is tomcat on windows.

I’m seeing the same thing. As of 1.5.6 it seems to no longer work with
spaces in the path name.

Drat. 1.5.6 was supposed to resolve these issues. Does this report
look familiar to you or fit your problem?
http://jira.codehaus.org/browse/JRUBY-5281

/Nick

Sure is. Worked with 1.5.5, stopped working with 1.5.6.

The ticket, http://jira.codehaus.org/browse/JRUBY-5281 is showing that
it is
fixed but in my testing, the problem persists. Has anyone had any luck
testing this out and showing that it is actually fixed? I tried with
1.6.0.RC2, verified jruby-jars was at 1.6.0.RC2 as well. I’ve also
tried
jruby-rack 1.0.6.RC1 and compiled it from the latest source. All
continued
to show the same problem.

On Tue, Jan 4, 2011 at 11:44 AM, Shane E. [email protected]
wrote:

Ken A. wrote in post #970324:

I found the same problem. It looks like it doesn’t like spaces in the
path as of 1.5.6. Jruby 1.5.5 works fine.
Our system is tomcat on windows.

I’m seeing the same thing. As of 1.5.6 it seems to no longer work with
spaces in the path name.

Drat. 1.5.6 was supposed to resolve these issues. Does this report
look familiar to you or fit your problem?
http://jira.codehaus.org/browse/JRUBY-5281

/Nick