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

Key: JRUBY-573
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Derek Townsend
Votes: 0
Watchers: 0
Operations

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

Drb stop_service throws exception

Created: 09/Feb/07 12:57 PM   Updated: 06/May/07 09:49 PM
Component/s: Core Classes/Modules
Affects Version/s: JRuby 0.9.0, JRuby 0.9.1, JRuby 0.9.2
Fix Version/s: JRuby 1.0.0RC1

Time Tracking:
Not Specified

Environment: J2SE 6, RedHat FC6, using Jrubytrunk

Testcase included: yes


 Description  « Hide
DRb.stop_service throws class cast exception under jruby.

Exception:
null:-1:in `org.jruby.RubyExceptionInvokerinitializexx1.call': java.lang.ClassCastException: org.jruby.RubyObject cannot be cast to org.jruby.RubyException (NativeException)
from InvocationCallback.java:49:in `org.jruby.runtime.callback.InvocationCallback.execute'
from FullFunctionCallbackMethod.java:77:in `org.jruby.internal.runtime.methods.FullFunctionCallbackMethod.internalCall'
from AbstractMethod.java:64:in `org.jruby.internal.runtime.methods.AbstractMethod.call'
from RubyObject.java:473:in `org.jruby.RubyObject.callMethod'
from RubyObject.java:382:in `org.jruby.RubyObject.callMethod'
from RubyObject.java:553:in `org.jruby.RubyObject.callInit'
from RubyClass.java:254:in `org.jruby.RubyClass.newInstance'
from RaiseException.java:60:in `org.jruby.exceptions.RaiseException.<init>'
... 130 levels...
from /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:1605:in `main_loop'
from /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:1430:in `run'
from /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:1348:in `start'
Complete Java stackTrace
java.lang.ClassCastException: org.jruby.RubyObject cannot be cast to org.jruby.RubyException
at org.jruby.RubyExceptionInvokerinitializexx1.call(Unknown Source)
at org.jruby.runtime.callback.InvocationCallback.execute(InvocationCallback.java:49)
at org.jruby.internal.runtime.methods.FullFunctionCallbackMethod.internalCall(FullFunctionCallbackMethod.java:77)
at org.jruby.internal.runtime.methods.AbstractMethod.call(AbstractMethod.java:64)
at org.jruby.RubyObject.callMethod(RubyObject.java:473)
at org.jruby.RubyObject.callMethod(RubyObject.java:382)
at org.jruby.RubyObject.callInit(RubyObject.java:553)
at org.jruby.RubyClass.newInstance(RubyClass.java:254)
at org.jruby.exceptions.RaiseException.<init>(RaiseException.java:60)
at org.jruby.ext.socket.RubyIPSocket.sockerr(RubyIPSocket.java:67)
at org.jruby.ext.socket.RubyTCPServer.accept(RubyTCPServer.java:108)
at org.jruby.ext.socket.RubyTCPServerInvokeraccept0.call(Unknown Source)
at org.jruby.runtime.callback.FastInvocationCallback.execute(FastInvocationCallback.java:49)
at org.jruby.internal.runtime.methods.SimpleCallbackMethod.call(SimpleCallbackMethod.java:80)
at org.jruby.RubyObject.callMethod(RubyObject.java:473)
at org.jruby.RubyObject.callMethod(RubyObject.java:395)
at org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:320)
at org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:934)
at org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:278)
at org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:1436)
at org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:278)
at org.jruby.evaluator.EvaluationState.eval(EvaluationState.java:156)
at org.jruby.internal.runtime.methods.DefaultMethod.internalCall(DefaultMethod.java:157)
at org.jruby.internal.runtime.methods.AbstractMethod.call(AbstractMethod.java:64)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:113)
at org.jruby.RubyObject.callMethod(RubyObject.java:473)
at org.jruby.RubyObject.callMethod(RubyObject.java:395)
at org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:320)
at org.jruby.evaluator.EvaluationState.setupArgs(EvaluationState.java:1786)
at org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:301)
at org.jruby.evaluator.EvaluationState.eval(EvaluationState.java:156)
at org.jruby.internal.runtime.methods.DefaultMethod.internalCall(DefaultMethod.java:157)
at org.jruby.internal.runtime.methods.AbstractMethod.call(AbstractMethod.java:64)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:113)
at org.jruby.RubyObject.callMethod(RubyObject.java:473)
at org.jruby.RubyObject.callMethod(RubyObject.java:390)
at org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:1420)
at org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:1436)
at org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:717)
at org.jruby.evaluator.EvaluationState.eval(EvaluationState.java:156)
at org.jruby.internal.runtime.methods.EvaluateCallable.call(EvaluateCallable.java:61)
at org.jruby.runtime.Block.yield(Block.java:189)
at org.jruby.runtime.Block.call(Block.java:158)
at org.jruby.RubyProc.call(RubyProc.java:123)
at org.jruby.RubyProc.call(RubyProc.java:104)
at org.jruby.internal.runtime.RubyNativeThread.run(RubyNativeThread.java:74)

test_client.rb
require 'drb'

DRb.start_service()
obj = DRbObject.new(nil, 'druby://localhost:9000')

#puts "First sum is #{obj.add(1, 2, 3)}"

#puts "Second sum is #{obj.add(10,20,30)}"

puts "Shutting the service down remotely"

obj.shutdown()

puts "Done!"

test_server.rb
require 'drb'

class TestServer
def add(*args)
args.inject {|n,v| n+v}
end

def shutdown
DRb.stop_service
end
end

server = TestServer.new
DRb.start_service('druby://localhost:9000', server)
DRb.thread.join



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Thomas E Enebo - 26/Apr/07 01:31 PM
The supplied test case appears to be working. I am resolving.

Charles Oliver Nutter - 06/May/07 09:49 PM
Closing for 1.0RC1