Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Incomplete
    • Affects Version/s: JRuby 1.4.0RC1
    • Fix Version/s: None
    • Component/s: Embedding
    • Labels:
      None
    • Environment:
      MATLAB R2009b with JVM 1.6 on WinXP;
      Octave 3.2.3 with JVM 1.5 on Leopard PPC
    • Testcase included:
      yes
    • Number of attachments :
      0

      Description

      MATLAB and Octave, two environments that can call into Java libraries, both encounter errors when they try to call into JRuby. Here's a MATLAB interaction demonstrating the behavior:

      >> javaaddpath 'C:\jruby-complete.jar' 
      >> import org.jruby.Main; 
      >> jruby = Main(); 
      >> jruby.run('--version'); 
      jruby 1.5.0dev (ruby 1.8.7 patchlevel 174) (2009-10-16 6586) (Java HotSpot(TM) Client VM 1.6.0_16) [x86-java] 
      ??? Java exception
      

      To log the contents of that exception, I stuck a custom Java class in between MATLAB and JRuby, and caught a NullPointerException with the message: library `enumerator' could not be loaded.

      At first, I suspected a bug in MATLAB, since the equivalent Java code is able to call into JRuby. But then, see this interaction with Octave on a completely different platform:

      octave-3.2.3:1> pkg load java;
      octave-3.2.3:2> java_init;
      octave-3.2.3:3> javaaddpath("/Users/username/jruby-complete.jar")
      octave-3.2.3:4> java_invoke("org.jruby.Main", "main", {"--version"});
      jruby 1.5.0dev (ruby 1.8.7 patchlevel 174) (2009-10-17 6586) (Java HotSpot(TM) Client VM 1.5.0_20) [ppc-java]
      error: [java] org.jruby.exceptions.RaiseException: library `enumerator' could not be loaded: java.lang.ClassNotFoundException: org.jruby.libraries.EnumeratorLibrary
      

      Are MATLAB and Octave doing something funky with class loaders? This issue is an obstacle to extending these environments in JRuby, since the exception occurs before any extension (using the Ruby-embed APIs) can run.

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        Ian; can you paste the whole InstantiationException please?

        Show
        Charles Oliver Nutter added a comment - Ian; can you paste the whole InstantiationException please?
        Hide
        Thomas E Enebo added a comment -

        Ran out of time for full resolution of this. Pending more information or things to try detargetting to 1.1+.

        Show
        Thomas E Enebo added a comment - Ran out of time for full resolution of this. Pending more information or things to try detargetting to 1.1+.
        Hide
        Ian Dees added a comment -

        Hi, Charlie.

        All MATLAB reports is:

        ?? Java exception occurred:
        java.lang.InstantiationException: org.jruby.ast.Node
        
        Show
        Ian Dees added a comment - Hi, Charlie. All MATLAB reports is: ?? Java exception occurred: java.lang.InstantiationException: org.jruby.ast.Node
        Hide
        Charles Oliver Nutter added a comment -

        Huh, that's pretty baffling. I have no other ideas to try. Maybe we could find someone at MATLAB that might be able to help us debug what's happening?

        Show
        Charles Oliver Nutter added a comment - Huh, that's pretty baffling. I have no other ideas to try. Maybe we could find someone at MATLAB that might be able to help us debug what's happening?
        Hide
        Charles Oliver Nutter added a comment -

        Old issue, specific to a single application's Java embedding capability. If there's something we can fix, reopen.

        Show
        Charles Oliver Nutter added a comment - Old issue, specific to a single application's Java embedding capability. If there's something we can fix, reopen.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: