History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-1477
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Charles Oliver Nutter
Reporter: Michael Kintzer
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
JRuby

IO Error requiring certain jars in JRoR

Created: 25/Oct/07 11:24 PM   Updated: 22/Dec/07 06:28 AM
Component/s: Java Integration
Affects Version/s: JRuby 1.0.1
Fix Version/s: JRuby 1.1b1, JRuby 1.0.2

Time Tracking:
Not Specified

File Attachments: 1. Java Archive File log4j.jar (342 kb)

Environment: Linux 2.6.15-1.2054_FC5. JRuby 1.0.1. RubyGems 0.9.4. Rails 1.2.5.


 Description  « Hide
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'



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Charles Oliver Nutter - 27/Oct/07 01:06 PM
I'm guessing this is the same as another (fixed) bug, where jars without manifests were blowing up on require. I tried the log4j jar on both trunk and 1.0 branches, and it works fine now.