1

My project uses the following jars: scala-library (2.9.2), mongo-java-driver (2.7.3), scalaj-collection (2.9.1-1.2), casbah (util, commons, core, query, gridfs) 2.9.1-3.0.0-M2, joda-time 2.1, and joda convert 1.2

When I enter the following hello-worldish code:

package test

import com.mongodb.casbah.Imports._

object Test {
  def main(args: Array[String]): Unit = {
    var connection = MongoConnection()
  }
}

I get an error: "not found: value MongoConnection". The error goes away if I explicitly

include com.mongodb.casbah.MongoConnection

But I thought Imports._ was supposed to be taking care of that. What could I be doing wrong?

Eduardo
  • 8,362
  • 6
  • 38
  • 72
  • What are you using to build this? I get this sort of thing randomly within eclipse sometimes (with the auto-build red squiggly underline), but using SBT to build works fine. – Eve Freeman Apr 19 '12 at 02:13
  • Yes, I use Eclipse, and the latest version of the Scala IDE plugin for Eclipse. – Eduardo Apr 19 '12 at 05:45

1 Answers1

1

In Casbah 3.0, Imports._ is deprecated. What is weird though is that MongoConnection is not even imported anymore. Everything else works but deprecation warnings occur.

As those warnings state, you just need to do this instead:

import com.mongodb.casbah._
urcadox
  • 83
  • 5
  • No idea, sorry. The only thing to do would be to get the source code and generate the scaladoc (with `sbt doc`). Sadly I didn't found anything summing up the differences between 2.1.5 and 3.0. – urcadox Apr 19 '12 at 13:10