Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-330

Ruby driver 1.3.1 incompatible with Java driver 2.6.5 in JRuby

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.4.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      JRuby

      Description

      We have a little ETL process that reads from Oracle and writes to MongoDB. It reads from Oracle using Hibernate and writes to MongoDB using Ruby, all tied together with JRuby (don't ask).

      This process was working fine for the following combination:

      Ruby driver 1.3.1
      Java driver 2.2
      JRuby 1.6.1

      We recently upgraded the Java driver to 2.6.5, and this ETL process started failing with the following error:

      org.jruby.exceptions.RaiseException: (NameError) cannot link Java class org.jbson.RubyBSONDecoder, probable missing dependency: class org.jbson.RubyBSONDecoder has interface org.bson.BSONDecoder as super class
      at org.jruby.javasupport.JavaClass.for_name(org/jruby/javasupport/JavaClass.java:1195)
      at org.jruby.javasupport.JavaUtilities.get_proxy_class(org/jruby/javasupport/JavaUtilities.java:34)
      at #<Class:0x12e4a4890>.const_missing(file:/Users/bploetz/workspace/savewave-java/app.backoffice/target/sw-app-backoffice-6.0.0-000-bin.dir/lib/jruby-complete-1.6.1.jar!/builtin/javasupport/java.rb:45)
      at #<Class:0x17d7cd6ad>.deserialize(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/bson-1.3.1-java/lib/../lib/bson/bson_java.rb:14)
      at Mongo::Connection.read_documents(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:777)
      at Mongo::Connection.receive(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:727)
      at Mongo::Connection.receive_message(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:484)
      at Mongo::Connection.receive_message(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:482)
      at Mongo::Cursor.send_initial_query(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo-1.3.1/lib/../lib/mongo/cursor.rb:407)
      at Mongo::Connection.instrument(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:609)
      at Mongo::Cursor.send_initial_query(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo-1.3.1/lib/../lib/mongo/cursor.rb:406)
      at Mongo::Cursor.refresh(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo-1.3.1/lib/../lib/mongo/cursor.rb:371)
      at Mongo::Cursor.next_document(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo-1.3.1/lib/../lib/mongo/cursor.rb:87)
      at Mongo::DB.command(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo-1.3.1/lib/../lib/mongo/db.rb:497)
      at Mongo::Connection.check_is_master(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:704)
      at Mongo::Connection.connect(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:504)
      at Mongo::Connection.setup(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:656)
      at Mongo::Connection.initialize(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:101)
      at MongoMapper::Connection.connect(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo_mapper-0.9.1/lib/mongo_mapper/connection.rb:64)
      at MongoMapper::Connection.setup(/Users/bploetz/.rvm/gems/jruby-1.6.1@etl/gems/mongo_mapper-0.9.1/lib/mongo_mapper/connection.rb:72)
      at init.loadProperties(init.rb:27)

      While I hate to downgrade the Java driver (since some of the APIs have changed and we've already changed our code), I will if that's the only way to get around this. Is there a known max version of the Java driver that the Ruby driver works with in JRuby?

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: