Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6RC1
-
Fix Version/s: JRuby 1.6
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
Strangely different errors.
Works as expected (NameError because YumYum is not in quotes):
~ ➔ jruby -rjava -e 'import "java.util.ArrayList" do; YumYum; end' org/jruby/RubyModule.java:2530:in `const_missing': uninitialized constant YumYum (NameError) from -e:1:in `__file__' from /Users/headius/projects/jruby/lib/ruby/site_ruby/shared/builtin/javasupport/core_ext/object.rb:79:in `java_import' from -e:1:in `(root)'
Now with Minecraft's jar, also ok:
~ ➔ jruby -rjava -r'~/Library/Application Support/minecraft/bin/minecraft.jar' -e 'import "er" do; YumYum; end' org/jruby/RubyModule.java:2530:in `const_missing': uninitialized constant YumYum (NameError) from -e:1:in `__file__' from /Users/headius/projects/jruby/lib/ruby/site_ruby/shared/builtin/javasupport/core_ext/object.rb:79:in `java_import' from -e:1:in `(root)'
Require 'yaml' first:
~ ➔ jruby -ryaml -rjava -r'~/Library/Application Support/minecraft/bin/minecraft.jar' -e 'import "er" do; YumYum; end' org/jruby/javasupport/JavaClass.java:1052:in `for_name': security exception loading Java class er (NameError) from org/jruby/javasupport/JavaUtilities.java:34:in `get_proxy_class' from /Users/headius/projects/jruby/lib/ruby/site_ruby/shared/builtin/javasupport/core_ext/object.rb:46:in `java_import' from -e:1:in `(root)'
Activity
Charles Oliver Nutter
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Assignee | Thomas E Enebo [ enebo ] | Charles Oliver Nutter [ headius ] |
| Resolution | Fixed [ 1 ] |
Charles Oliver Nutter
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
The problem here was that the Minecraft jar is signed, and the yecht.jar file we use for YAML is not. However they both have classes at the root of the package structure. When YAML loads first, that package is set to have no security policy. Minecraft's classes then cause an error when trying to load, since the security policy must differ.
We can't fix that, other than by eliminating yecht.jar (which we'd like to do, but it's outside the scope of this bug). I have at least modified JRuby to raise the original SecurityException message in a ruby SecurityError.
commit c8d316738ea0ac7aff1393598bf3a6089151687a
Author: Charles Oliver Nutter <headius@headius.com>
Date: Thu Jan 13 13:46:24 2011 -0600
Fix
JRUBY-5351: Peculiar errors with failed java_import in different scenarios