"require" won't load jars with ".so" anywhere in the name
---------------------------------------------------------
Key: JRUBY-3977
URL: http://jira.codehaus.org/browse/JRUBY-3977
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.3.1
Environment: Tested on windows server 2k3 and os x 10.5
Reporter: Jeremy Huiskamp
Priority: Minor
Attachments: so.patch
JRuby will not load a jar whose name includes ".so" anywhere in it. Example:
{noformat}$ ls
xds.soap-1.0.0rc1.jar
$ cp xds.soap-1.0.0rc1.jar xds.s-oap-1.0.0rc1.jar
$ jirb
irb(main):001:0> require 'xds.soap-1.0.0rc1.jar'
LoadError: JRuby does not support .so libraries from filesystem
from
/Users/jeremy/tools/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from
/Users/jeremy/tools/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from (irb):2
irb(main):002:0> require 'xds.s-oap-1.0.0rc1.jar'
=> true
irb(main):003:0>{noformat}
I think the problem is in org.jruby.runtime.load.LoadService.createLibrary().
This method uses file.endsWith() for all extensions except .so, for which it
uses file.contains(). Is there a good reason why it looks anywhere within the
file name? Is it to avoid things like "libc.so.40.3"?
I've attached (but not tested) a patch that changes .contains() to .endsWith()
but I don't know if that is the best solution.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email