Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: JRuby 1.1
-
Fix Version/s: None
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:MacOS 10.4.11, Java 1.5.0_13, JRuby trunk r5949
-
Number of attachments :
Description
I'm not sure if this should work – I'd like it if it did.
DRb Server, run in JRuby
include Java
require 'drb'
class TestServer
def method_missing(methodname, *args)
klass = methodname.to_s
methodd = args.delete_at(0)
puts args.inspect
puts methodd
puts args.inspect
the_script = "#{klass}.#{methodd}(*args)"
puts the_script
instance_eval(the_script)
end
end
server = TestServer.new
DRb.start_service('druby://localhost:9000', server)
DRb.thread.join # Don't exit just yet!
DRb client
require 'drb' DRb.start_service() obj = DRbObject.new(nil, 'druby://localhost:9000') puts obj.java.lang.System.getProperties["java.runtime.version"]
When the client is run in JRuby (the result is correct):
1.5.0_13-b05-241
When the client is run in MRI 1.8.6
TypeError: wrong argument type String (expected Module) from (druby://localhost:9000) /Users/stephen/dev/jruby_trunk/jruby/lib/ruby/1.8/drb/drb.rb:1538:in `check_insecure_method' from (druby://localhost:9000) /Users/stephen/dev/jruby_trunk/jruby/lib/ruby/1.8/drb/drb.rb:1543:in `setup_message' from (druby://localhost:9000) /Users/stephen/dev/jruby_trunk/jruby/lib/ruby/1.8/drb/drb.rb:1494:in `perform' from (druby://localhost:9000) /Users/stephen/dev/jruby_trunk/jruby/lib/ruby/1.8/drb/drb.rb:1589:in `main_loop' from (druby://localhost:9000) /Users/stephen/dev/jruby_trunk/jruby/lib/ruby/1.8/drb/drb.rb:1585:in `loop' from (druby://localhost:9000) /Users/stephen/dev/jruby_trunk/jruby/lib/ruby/1.8/drb/drb.rb:1585:in `main_loop' from (druby://localhost:9000) /Users/stephen/dev/jruby_trunk/jruby/lib/ruby/1.8/drb/drb.rb:1585:in `accept' from (irb):4
Perhaps you could raise this with Ruby core? I'm punting this to post 1.1, since there's perhaps nothing here we should actually fix, but if there's a reason for the error in C Ruby, maybe we will want to consider whether we duplicate it.