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

JRuby Driver and Java Driver Libraries are incompatible

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • bson-5.0.0
    • Affects Version/s: None
    • Component/s: BSON, JRuby
    • Environment:
      JRuby 9.0.5.0, Java 8, Ruby mongo-2.2.5, Java mongo-driver-3.2.2
    • Minor Change

      Try to use JRuby and Java drivers in one project results in an exception:

      Java::JavaLang::IncompatibleClassChangeError: Implementing class
      	from java.lang.ClassLoader.defineClass1(Native Method)
      	from java.lang.ClassLoader.defineClass(ClassLoader.java:760)
      	from java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      	from java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
      	from java.net.URLClassLoader.access$100(URLClassLoader.java:73)
      	from java.net.URLClassLoader$1.run(URLClassLoader.java:368)
      	from java.net.URLClassLoader$1.run(URLClassLoader.java:362)
      	from java.security.AccessController.doPrivileged(Native Method)
      	from java.net.URLClassLoader.findClass(URLClassLoader.java:361)
      	from java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	from java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	from com.mongodb.MongoClientOptions$Builder.<init>(MongoClientOptions.java:758)
      	from com.mongodb.MongoClientURI.<init>(MongoClientURI.java:158)
      ...
      

      Steps to reproduce in JRuby IRB (expects java driver jar files in working dir):

      require 'mongo'
      mongo_client = Mongo::Client.new(["localhost:27017"])
      require './bson-3.2.2.jar'
      require './mongodb-driver-core-3.2.2.jar'
      require './mongodb-driver-3.2.2.jar'
      com.mongodb.MongoClient.new("localhost")
      

            Assignee:
            jamis.buck@mongodb.com Jamis Buck
            Reporter:
            helle@fraggaz.de Andreas Gerauer
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: