Have a rails controller class with code:
include Java
require 'junit.jar'
require 'log4j.jar'
require 'commons-httpclient-3.0.jar'
...
All jars are world-readable, of non-zero size, and located in RAILS_PROJECT_ROOT/lib.
The junit.jar is loaded successfully and can be used. The log4j.jar throws an IO Error. If the line require 'log4j.jar' is commented out, then the commons-httpclient-3.0.jar is successfully loaded.
There seems to be certain types of jar files that cannot be loaded successfully, while others load just fine using the same syntax. Seems like there is a problem with loader/jar compatibility. I have several examples of each type of jar. Some work, some don't, I can't determine why. I have attached the log4j.jar I used in my test.
stack trace:
/usr/local/jruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:100:in `require_or_load'
/usr/local/jruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:246:in `load_missing_constant'
/usr/local/jruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:462:in `const_missing'
/usr/local/jruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:462:in `const_missing'
/usr/local/jruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/inflector.rb:1:in `module_eval'
/usr/local/jruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/dispatcher.rb:40:in `constantize'
/usr/local/jruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/dispatcher.rb:40:in `recognize'
/usr/local/jruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/dispatcher.rb:40:in `dispatch'
/usr/local/jruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/webrick_server.rb:113:in `handle_dispatch'
/usr/local/jruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/webrick_server.rb:79:in `service'
/usr/local/jruby-1.0.1/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/local/jruby-1.0.1/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/local/jruby-1.0.1/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/local/jruby-1.0.1/lib/ruby/1.8/webrick/server.rb:95:in `start'