0

I've been getting this error whenever I'm using Scala libraries for MongoDB.

bad symbolic reference. A signature in Implicits.class refers to type MongoCursor in 
package com.mongodb which is not available. It may be completely missing from the 
current classpath, or the version on the classpath might be incompatible with the 
version used when compiling Implicits.class.  

I get the error in response to the line:
val client = MongoClient("localhost", 27017)

I've tried different versions of the various jar files, but it hasn't fixed it. I've been using only the most up-to-date versions, so I don't know what the problem is. It won't give me a line reference, and I can't find a reference to a "MongoCursor" type in the Implicits.class source. I get the feeling that I'm missing another library, but I don't know what it would be.

I'm using:
joda-time-2.3.jar
mongo-java-driver-2.11.4.jar
casbah_2.10-2.7.0-SNAPSHOT.jar
casbah-commons_2.10-2.7.0-SNAPSHOT.jar
casbah-core_2.10-2.7.0-SNAPSHOT.jar
casbah-gridfs_2.10-2.7.0-SNAPSHOT.jar
casbah-query_2.10-2.7.0-SNAPSHOT.jar

Eric
  • 5
  • 2
  • A jar is missing on your classpath, or you are using the wrong version mix. The simplest way out is to use Sbt to pull your dependencies, and sbteclipse to generate an Eclipse project. – Iulian Dragos Mar 25 '14 at 16:55

1 Answers1

1

You will need to update the Java driver as the 2.7.0-SNAPSHOT relies on the mongo-java-driver 2.12.0-SNAPSHOT - then it should be able to find MongoCursor correctly.

Ross
  • 17,861
  • 2
  • 55
  • 73
  • There's no "SNAPSHOT" jar available, just "mongo-java-driver-2.12.0-rc0". That didn't fix the problem. I also made a jar from the mongo-java-driver repo, and it didn't fix the problem either. I still get the same error. This is driving me kind of crazy. – Eric Mar 16 '14 at 05:11
  • The snapshot can be found in sonatype snapshots repo, however there is now an 2.7.0-RC2 which should be discoverable. – Ross Mar 24 '14 at 08:56
  • Thanks. Updating to casbah-core to RC2 fixed it. – Eric Mar 29 '14 at 15:32