Problem loading yaml string in 1.9 mode with JRuby 1.6 and newer
----------------------------------------------------------------

                 Key: JRUBY-5802
                 URL: http://jira.codehaus.org/browse/JRUBY-5802
             Project: JRuby
          Issue Type: Bug
          Components: Standard Library
    Affects Versions: JRuby 1.6.1, JRuby 1.6, JRuby 1.6RC3, JRuby 1.6RC2, JRuby 
1.6RC1
            Reporter: Reto Schüttel
            Assignee: Thomas E Enebo
            Priority: Critical


Rail's I18n library triggered the following strange YAML error: 
"java.lang.ClassCastException: org.jruby.RubyObject cannot be cast to 
org.jruby.RubyException"

{code}
# Full exception
RubyException$i$0$2$initialize.gen:65535:in `call': 
java.lang.ClassCastException: org.jruby.RubyObject cannot be cast to 
org.jruby.RubyException
        from CachingCallSite.java:242:in `cacheAndCall'
        from CachingCallSite.java:80:in `callBlock'
        from CachingCallSite.java:84:in `call'
        from RubyClass.java:820:in `newInstance'
        from RubyException.java:211:in `exception'
        from RubyException$s$0$1$exception.gen:65535:in `call'
        from DynamicMethod.java:209:in `call'
        from DynamicMethod.java:205:in `call'
        from RubyClass.java:685:in `finvoke'
        from RuntimeHelpers.java:548:in `invoke'
        from RubyBasicObject.java:358:in `callMethod'
        from RubyKernel.java:1009:in `convertToException'
        from RubyKernel.java:987:in `raise'
        from PsychParser.java:242:in `parse'
        from PsychParser$i$1$0$parse.gen:65535:in `call'
        from CachingCallSite.java:282:in `cacheAndCall'
        from CachingCallSite.java:139:in `call'
        from CallOneArgNode.java:57:in `interpret'
        from NewlineNode.java:103:in `interpret'
        from BlockNode.java:71:in `interpret'
        from ASTInterpreter.java:74:in `INTERPRET_METHOD'
        from InterpretedMethod.java:190:in `call'
        from DefaultMethod.java:179:in `call'
        from CachingCallSite.java:282:in `cacheAndCall'
        from CachingCallSite.java:139:in `call'
        from FCallOneArgNode.java:36:in `interpret'
        from CallNoArgNode.java:62:in `interpret'
        from LocalAsgnNode.java:123:in `interpret'
        from NewlineNode.java:103:in `interpret'
        from BlockNode.java:71:in `interpret'
        from ASTInterpreter.java:74:in `INTERPRET_METHOD'
        from InterpretedMethod.java:190:in `call'
        from DefaultMethod.java:179:in `call'
        from CachingCallSite.java:282:in `cacheAndCall'
        from CachingCallSite.java:139:in `call'
        from FCallOneArgNode.java:36:in `interpret'
        from LocalAsgnNode.java:123:in `interpret'
        from NewlineNode.java:103:in `interpret'
        from BlockNode.java:71:in `interpret'
        from ASTInterpreter.java:74:in `INTERPRET_METHOD'
        from InterpretedMethod.java:190:in `call'
        from DefaultMethod.java:179:in `call'
        from CachingCallSite.java:282:in `cacheAndCall'
        from CachingCallSite.java:139:in `call'
        from -e:1:in `__file__'
        from -e:-1:in `load'
        from Ruby.java:671:in `runScript'
        from Ruby.java:575:in `runNormally'
        from Ruby.java:424:in `runFromMain'
        from Main.java:278:in `doRunFromMain'
        from Main.java:198:in `internalRun'
        from Main.java:164:in `run'
        from Main.java:148:in `run'
        from Main.java:128:in `main'
{/code}


I was able to reduce it to the following snippet:

{code}
jruby -ryaml --1.9  -e 'YAML.load("[:year]")'
{/code}


It works with 1.5.6, the snippet causes a different error with 1.6.0 
"RuntimeError: while parsing a flow node; expected the node content, but found 
Value".

This bug renders most common localized (using i18n) rails unusable with 1.9 
mode, and the error is very difficult to track down to i18n, or yaml, as the 
error doesnt include anything helpful. 


Thanks for the help!

Cheers
Reto Schüttel

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