error accessing JRuby DRb server from MRI DRb client
----------------------------------------------------

                 Key: JRUBY-2128
                 URL: http://jira.codehaus.org/browse/JRUBY-2128
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1
         Environment: MacOS 10.4.11, Java 1.5.0_13, JRuby trunk r5949
            Reporter: Stephen Bannasch
             Fix For: JRuby 1.1


I'm not sure if this should work -- I'd like it if it did.

DRb Server, run in JRuby

{code}
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! 
{code}

DRb client

{code}
require 'drb' 
DRb.start_service() 
obj = DRbObject.new(nil, 'druby://localhost:9000') 
puts obj.java.lang.System.getProperties["java.runtime.version"]
{code}

When the client is run in JRuby (the result is correct):

{code}
1.5.0_13-b05-241
{code}

When the client is run in MRI 1.8.6

{code}
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
{code}



-- 
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


Reply via email to