Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6RC2
    • Fix Version/s: JRuby 1.6
    • Component/s: Core Classes/Modules
    • Labels:
      None
    • Environment:
      ruboto-core
    • Number of attachments :
      0

      Description

      Hi!

      In a clean ruboto-core project, try

      require 'yaml'
      

      I get the output below. I see references to yecht.jar in yaml/yecht.rb and in Ruby.java And what is YechtService? Please help! I need to get yaml, activerecord, and derby working this week

      E/dalvikvm( 2746): ERROR: defineClass(0x40840848, org.yecht.ruby.Module$s$1$0$compile, 0x40fb8a28, 0, 745, 0x0)
      W/System.err( 2746): java.lang.UnsupportedOperationException: can't load this type of class file
      W/System.err( 2746): 	at java.lang.VMClassLoader.defineClass(Native Method)
      W/System.err( 2746): 	at java.lang.ClassLoader.defineClass(ClassLoader.java:327)
      W/System.err( 2746): 	at org.jruby.util.JRubyClassLoader.defineClass(JRubyClassLoader.java:76)
      W/System.err( 2746): 	at org.jruby.internal.runtime.methods.InvocationMethodFactory.endClass(InvocationMethodFactory.java:1347)
      W/System.err( 2746): 	at org.jruby.internal.runtime.methods.InvocationMethodFactory.getAnnotatedMethodClass(InvocationMethodFactory.java:782)
      W/System.err( 2746): 	at org.jruby.internal.runtime.methods.InvocationMethodFactory.getAnnotatedMethod(InvocationMethodFactory.java:800)
      W/System.err( 2746): 	at org.jruby.RubyModule.defineAnnotatedMethod(RubyModule.java:691)
      W/System.err( 2746): 	at org.jruby.RubyModule.defineAnnotatedMethod(RubyModule.java:659)
      W/System.err( 2746): 	at org.jruby.anno.TypePopulator$DefaultTypePopulator.populate(TypePopulator.java:67)
      W/System.err( 2746): 	at org.jruby.RubyModule.defineAnnotatedMethodsIndividually(RubyModule.java:653)
      W/System.err( 2746): 	at org.jruby.RubyModule.defineAnnotatedMethods(RubyModule.java:541)
      W/System.err( 2746): 	at YechtService.basicLoad(YechtService.java:21)
      W/System.err( 2746): 	at org.jruby.runtime.load.LoadService.reflectedLoad(LoadService.java:412)
      W/System.err( 2746): 	at org.jruby.ext.LateLoadingLibrary.load(LateLoadingLibrary.java:48)
      W/System.err( 2746): 	at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:755)
      W/System.err( 2746): 	at org.jruby.runtime.load.LoadService.smartLoad(LoadService.java:334)
      W/System.err( 2746): 	at org.jruby.runtime.load.LoadService.require(LoadService.java:381)
      W/System.err( 2746): 	at org.jruby.runtime.load.LoadService.lockAndRequire(LoadService.java:306)
      W/System.err( 2746): 	at org.jruby.RubyKernel.requireCommon(RubyKernel.java:1054)
      W/System.err( 2746): 	at org.jruby.RubyKernel.require(RubyKernel.java:1037)
      W/System.err( 2746): 	at org.jruby.RubyKernel$s$1$0$require.call(RubyKernel$s$1$0$require.gen:65535)
      W/System.err( 2746): 	at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:319)
      W/System.err( 2746): 	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:282)
      W/System.err( 2746): 	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:139)
      W/System.err( 2746): 	at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
      W/System.err( 2746): 	at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:103)
      W/System.err( 2746): 	at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
      W/System.err( 2746): 	at org.jruby.ast.RootNode.interpret(RootNode.java:129)
      W/System.err( 2746): 	at org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:119)
      W/System.err( 2746): 	at org.jruby.Ruby.runInterpreter(Ruby.java:697)
      W/System.err( 2746): 	at org.jruby.Ruby.loadFile(Ruby.java:2417)
      W/System.err( 2746): 	at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:66)
      W/System.err( 2746): 	at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:755)
      W/System.err( 2746): 	at org.jruby.runtime.load.LoadService.smartLoad(LoadService.java:334)
      W/System.err( 2746): 	at org.jruby.runtime.load.LoadService.require(LoadService.java:381)
      W/System.err( 2746): 	at org.jruby.runtime.load.LoadService.lockAndRequire(LoadService.java:306)
      W/System.err( 2746): 	at org.jruby.RubyKernel.requireCommon(RubyKernel.java:1054)
      W/System.err( 2746): 	at org.jruby.RubyKernel.require(RubyKernel.java:1037)
      W/System.err( 2746): 	at org.jruby.RubyKernel$s$1$0$require.call(RubyKernel$s$1$0$require.gen:65535)
      W/System.err( 2746): 	at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:319)
      W/System.err( 2746): 	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:282)
      W/System.err( 2746): 	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:139)
      W/System.err( 2746): 	at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
      W/System.err( 2746): 	at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:103)
      W/System.err( 2746): 	at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
      W/System.err( 2746): 	at org.jruby.ast.RootNode.interpret(RootNode.java:129)
      W/System.err( 2746): 	at org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:119)
      W/System.err( 2746): 	at org.jruby.Ruby.runInterpreter(Ruby.java:697)
      W/System.err( 2746): 	at org.jruby.Ruby.loadFile(Ruby.java:2417)
      W/System.err( 2746): 	at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:66)
      W/System.err( 2746): 	at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:755)
      W/System.err( 2746): 	at org.jruby.runtime.load.LoadService.smartLoad(LoadService.java:334)
      W/System.err( 2746): 	at org.jruby.runtime.load.LoadService.require(LoadService.java:381)
      W/System.err( 2746): 	at org.jruby.runtime.load.LoadService.lockAndRequire(LoadService.java:306)
      W/System.err( 2746): 	at org.jruby.RubyKernel.requireCommon(RubyKernel.java:1054)
      W/System.err( 2746): 	at org.jruby.RubyKernel.require(RubyKernel.java:1037)
      W/System.err( 2746): 	at org.jruby.RubyKernel$s$1$0$require.call(RubyKernel$s$1$0$require.gen:65535)
      W/System.err( 2746): 	at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:319)
      W/System.err( 2746): 	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:282)
      W/System.err( 2746): 	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:139)
      W/System.err( 2746): 	at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
      W/System.err( 2746): 	at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:103)
      W/System.err( 2746): 	at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
      W/System.err( 2746): 	at org.jruby.ast.RootNode.interpret(RootNode.java:129)
      W/System.err( 2746): 	at org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:119)
      W/System.err( 2746): 	at org.jruby.Ruby.evalScriptlet(Ruby.java:322)
      W/System.err( 2746): 	at org.ruboto.Script.exec(Script.java:101)
      W/System.err( 2746): 	at org.ruboto.Script.execute(Script.java:93)
      W/System.err( 2746): 	at org.ruboto.Script.execute(Script.java:239)
      W/System.err( 2746): 	at org.ruboto.RubotoActivity.finishCreate(RubotoActivity.java:157)
      W/System.err( 2746): 	at org.ruboto.RubotoActivity.access$300(RubotoActivity.java:13)
      W/System.err( 2746): 	at org.ruboto.RubotoActivity$2.run(RubotoActivity.java:129)
      W/System.err( 2746): 	at android.os.Handler.handleCallback(Handler.java:587)
      W/System.err( 2746): 	at android.os.Handler.dispatchMessage(Handler.java:92)
      W/System.err( 2746): 	at android.os.Looper.loop(Looper.java:126)
      W/System.err( 2746): 	at android.app.ActivityThread.main(ActivityThread.java:3997)
      W/System.err( 2746): 	at java.lang.reflect.Method.invokeNative(Native Method)
      W/System.err( 2746): 	at java.lang.reflect.Method.invoke(Method.java:491)
      W/System.err( 2746): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
      W/System.err( 2746): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
      W/System.err( 2746): 	at dalvik.system.NativeStart.main(Native Method)
      W/System.err( 2746): org.jruby.exceptions.RaiseException: (LoadError) can't load this type of class file
      W/System.err( 2746): 	at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1037)
      W/System.err( 2746): 	at #<Class:0x1407769a8>.(root)(file:/data/app/org.ruboto.poc.yaml-1.apk!/yaml/yecht.rb:5)
      W/System.err( 2746): 	at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1037)
      W/System.err( 2746): 	at #<Class:0x1407769a8>.(root)(file:/data/app/org.ruboto.poc.yaml-1.apk!/yaml/yecht.rb:12)
      W/System.err( 2746): 	at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1037)
      W/System.err( 2746): 	at #<Class:0x1407769a8>.(root)(file:/data/app/org.ruboto.poc.yaml-1.apk!/yaml.rb:2)
      D/dalvikvm( 1145): GC_EXPLICIT freed <1K, 12% free 27845K/31559K, paused 5ms+6ms
      

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        See JRUBY-5567 for the root cause of this, and JRUBY-5566 for the eventual "proper" fix.

        Show
        Charles Oliver Nutter added a comment - See JRUBY-5567 for the root cause of this, and JRUBY-5566 for the eventual "proper" fix.
        Hide
        Charles Oliver Nutter added a comment -

        The root cause of this issue was JRUBY-5567, for which I've made a preliminary fix. We'll call this one fixed, since JRUBY-5567 remains open and I'll come up with a more robust answer for JRuby 1.6.1.

        With the preliminary fix in place, YAML successfully loads from a ruboto-core app.

        commit 07c811b5f6318dbcecf7dfdbf06448d20de7980c
        Author: Charles Oliver Nutter <headius@headius.com>
        Date: Wed Mar 9 01:14:21 2011 -0600

        Preliminary fix for JRUBY-5567: Invokers will fail to generate and kill method binding on systems that do not support bytecode loading

        I added logic into MethodFactory to attempt to load a class, forcing reflected invokers forever if this fails in any way. I have confirmed manually that this does not interfere with normal execution, and have left logging in place that indicates when it has fallen back. See JRUBY-5568 for a task to remove this logging before JRuby 1.6 final.

        JRUBY-5567 will remain open until a more robust solution can be found (JRuby 1.6.1).

        See also JRUBY-5566, which this issue caused.

        Show
        Charles Oliver Nutter added a comment - The root cause of this issue was JRUBY-5567 , for which I've made a preliminary fix. We'll call this one fixed, since JRUBY-5567 remains open and I'll come up with a more robust answer for JRuby 1.6.1. With the preliminary fix in place, YAML successfully loads from a ruboto-core app. commit 07c811b5f6318dbcecf7dfdbf06448d20de7980c Author: Charles Oliver Nutter <headius@headius.com> Date: Wed Mar 9 01:14:21 2011 -0600 Preliminary fix for JRUBY-5567 : Invokers will fail to generate and kill method binding on systems that do not support bytecode loading I added logic into MethodFactory to attempt to load a class, forcing reflected invokers forever if this fails in any way. I have confirmed manually that this does not interfere with normal execution, and have left logging in place that indicates when it has fallen back. See JRUBY-5568 for a task to remove this logging before JRuby 1.6 final. JRUBY-5567 will remain open until a more robust solution can be found (JRuby 1.6.1). See also JRUBY-5566 , which this issue caused.
        Hide
        Uwe Kubosch added a comment -

        Thank you so much for fixing this!

        We are now loading ActiveSupport and ActiveRecord OK!

        Show
        Uwe Kubosch added a comment - Thank you so much for fixing this! We are now loading ActiveSupport and ActiveRecord OK!

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Uwe Kubosch
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: