ClassCastException on YAML.load
-------------------------------

                 Key: JRUBY-3639
                 URL: http://jira.codehaus.org/browse/JRUBY-3639
             Project: JRuby
          Issue Type: Bug
          Components: JRuby-extras
    Affects Versions: JRuby 1.1.6, JRuby 1.3
         Environment: mac osx, jruby 1.1.6 and 1.3.0 , have unit tests that 
load yaml fixtures that pass in ruby but fail in jruby
            Reporter: sammy z


calling YAML.load on the following causes the ClassCastException.

setting str: to nil is fine
when you set str to "" you get the issue.

--- !ruby/object:MySoap::InterfaceOne::DiscountServiceRequestType 
orderRequest: !ruby/object:MySoap::InterfaceOne::OrderType 
  brand: !str 
    str: ""

The stack trace follows:

org.jruby.yaml.JRubyConstructor:239:in `constructYamlStr': 
java.lang.ClassCastException: org.jvyamlb.nodes.MappingNode
        from org.jruby.yaml.JRubyConstructor$13:596:in `call'
        from org.jvyamlb.BaseConstructorImpl:158:in `constructObject'
        from org.jvyamlb.BaseConstructorImpl:272:in `constructMapping'
        from org.jruby.yaml.JRubyConstructor:195:in `constructRubyMapping'
        from org.jruby.yaml.JRubyConstructor:415:in `constructRuby'
        from org.jruby.yaml.JRubyConstructor$28:675:in `call'
        from org.jvyamlb.BaseConstructorImpl$YamlMultiAdapter:111:in `call'
        from org.jvyamlb.BaseConstructorImpl:158:in `constructObject'
        from org.jvyamlb.BaseConstructorImpl:272:in `constructMapping'
        from org.jruby.yaml.JRubyConstructor:195:in `constructRubyMapping'
        from org.jruby.yaml.JRubyConstructor:415:in `constructRuby'
        from org.jruby.yaml.JRubyConstructor$28:675:in `call'
        from org.jvyamlb.BaseConstructorImpl$YamlMultiAdapter:111:in `call'
        from org.jvyamlb.BaseConstructorImpl:158:in `constructObject'
        from org.jvyamlb.BaseConstructorImpl:97:in `constructDocument'
        from org.jvyamlb.BaseConstructorImpl:76:in `getData'
        from org.jruby.RubyYAML:244:in `load'
        from org.jruby.RubyYAML$s_method_1_0$RUBYINVOKER$load:-1:in `call'
        from org.jruby.runtime.callsite.CachingCallSite:280:in `cacheAndCall'
        from org.jruby.runtime.callsite.CachingCallSite:116:in `call'
        from tc_loading_saving:77:in 
`method__1$RUBY$test_load_request_from_yaml'
        from 
tc_loading_savingInvokermethod__1$RUBY$test_load_request_from_yamlFixed0:-1:in 
`call'
        from org.jruby.RubyClass:332:in `finvoke'
        from org.jruby.RubyObject:1358:in `send'
        from org.jruby.RubyObject$i_method_multi$RUBYINVOKER$send:-1:in `call'
        from org.jruby.internal.runtime.methods.DynamicMethod:152:in `call'
        from org.jruby.runtime.callsite.CachingCallSite:280:in `cacheAndCall'
        from org.jruby.runtime.callsite.CachingCallSite:116:in `call'
        from 
Users.sammyzahabi.Desktop.reboot.rsoapUI.vendor.mocha_minus_0_dot_9_dot_5.lib.mocha.test_case_adapter:69:in
 `rescue_4$RUBY$__rescue___22'
        from 
Users.sammyzahabi.Desktop.reboot.rsoapUI.vendor.mocha_minus_0_dot_9_dot_5.lib.mocha.test_case_adapter:-1:in
 `ensure_4$RUBY$__ensure___21'
        from 
Users.sammyzahabi.Desktop.reboot.rsoapUI.vendor.mocha_minus_0_dot_9_dot_5.lib.mocha.test_case_adapter:67:in
 `ensure_3$RUBY$__ensure___20'
        from 
Users.sammyzahabi.Desktop.reboot.rsoapUI.vendor.mocha_minus_0_dot_9_dot_5.lib.mocha.test_case_adapter:66:in
 `method__19$RUBY$run'
        from 
Users.sammyzahabi.Desktop.reboot.rsoapUI.vendor.mocha_minus_0_dot_9_dot_5.lib.mocha.test_case_adapterInvokermethod__19$RUBY$runFixed1:-1:in
 `call'
        from org.jruby.runtime.callsite.CachingCallSite:290:in `cacheAndCall'
        from org.jruby.runtime.callsite.CachingCallSite:126:in `call'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.testsuite:34:in 
`block_0$RUBY$__block__'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.testsuiteBlockCallback$block_0$RUBY$__block__xx1:-1:in
 `call'
        from org.jruby.runtime.CompiledBlock:100:in `yield'
        from org.jruby.runtime.Block:120:in `yield'
        from org.jruby.RubyArray:1559:in `each'
        from org.jruby.RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each:-1:in 
`call'
        from org.jruby.runtime.callsite.CachingCallSite:98:in `callIter'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.testsuite:33:in 
`method__4$RUBY$run'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.testsuiteInvokermethod__4$RUBY$runFixed1:-1:in
 `call'
        from org.jruby.runtime.callsite.CachingCallSite:290:in `cacheAndCall'
        from org.jruby.runtime.callsite.CachingCallSite:126:in `call'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.testsuite:34:in 
`block_0$RUBY$__block__'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.testsuiteBlockCallback$block_0$RUBY$__block__xx1:-1:in
 `call'
        from org.jruby.runtime.CompiledBlock:100:in `yield'
        from org.jruby.runtime.Block:120:in `yield'
        from org.jruby.RubyArray:1559:in `each'
        from org.jruby.RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each:-1:in 
`call'
        from org.jruby.runtime.callsite.CachingCallSite:270:in `cacheAndCall'
        from org.jruby.runtime.callsite.CachingCallSite:100:in `callIter'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.testsuite:33:in 
`method__4$RUBY$run'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.testsuiteInvokermethod__4$RUBY$runFixed1:-1:in
 `call'
        from org.jruby.runtime.callsite.CachingCallSite:290:in `cacheAndCall'
        from org.jruby.runtime.callsite.CachingCallSite:141:in `callIter'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.ui.testrunnermediator:46:in
 `method__5$RUBY$run_suite'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.ui.testrunnermediatorInvokermethod__5$RUBY$run_suiteFixed0:-1:in
 `call'
        from org.jruby.internal.runtime.methods.CompiledMethod:216:in `call'
        from org.jruby.runtime.callsite.CachingCallSite:260:in `cacheAndCall'
        from org.jruby.runtime.callsite.CachingCallSite:75:in `call'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.ui.console.testrunner:67:in
 `method__10$RUBY$start_mediator'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.ui.console.testrunnerInvokermethod__10$RUBY$start_mediatorFixed0:-1:in
 `call'
        from org.jruby.internal.runtime.methods.CompiledMethod:216:in `call'
        from org.jruby.runtime.callsite.CachingCallSite:260:in `cacheAndCall'
        from org.jruby.runtime.callsite.CachingCallSite:75:in `call'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.ui.console.testrunner:41:in
 `method__6$RUBY$start'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.ui.console.testrunnerInvokermethod__6$RUBY$startFixed0:-1:in
 `call'
        from org.jruby.internal.runtime.methods.CompiledMethod:216:in `call'
        from org.jruby.runtime.callsite.CachingCallSite:260:in `cacheAndCall'
        from org.jruby.runtime.callsite.CachingCallSite:75:in `call'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.ui.testrunnerutilities:29:in
 `method__4$RUBY$run'
        from 
opt.local.share.java.jruby.lib.ruby.$1_dot_8.test.unit.ui.testrunnerutilitiesInvokermethod__4$RUBY$runOpt:-1:in
 `call'
        from org.jruby.internal.runtime.methods.DynamicMethod:243:in `call'
        from org.jruby.internal.runtime.methods.CompiledMethod:221:in `call'
        from org.jruby.runtime.callsite.CachingCallSite:280:in `cacheAndCall'
        from org.jruby.runtime.callsite.CachingCallSite:116:in `call'
        from test.ts_master:29:in `__file__'
        from test.ts_master:-1:in `__file__'
        from test.ts_master:-1:in `load'
        from org.jruby.Ruby:564:in `runScript'
        from org.jruby.Ruby:467:in `runNormally'
        from org.jruby.Ruby:340:in `runFromMain'
        from org.jruby.Main:214:in `run'
        from org.jruby.Main:100:in `run'
        from org.jruby.Main:84:in `main'
MacTome:rsoapUI sammyzahabi$ jruby  -X+C test/ts_master.rb 



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