I have the Casbah MongoDB driver that I use in my Web Application and when I tried to connect to the Database which is when the Casbah driver API's are called, I face a strange error:
play.api.Application$$anon$1: Execution exception[[RuntimeException: java.lang.IncompatibleClassChangeError: Class com.mongodb.casbah.Imports$ does not implement the requested interface com.mongodb.casbah.query.dsl.SearchOp]]
at play.api.Application$class.handleError(Application.scala:293) ~[com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
at play.api.DefaultApplication.handleError(Application.scala:399) [com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$12$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:165) [com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$12$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:162) [com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.util.Failure$$anonfun$recover$1.apply(Try.scala:185) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.util.Try$.apply(Try.scala:161) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.util.Failure.recover(Try.scala:185) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Future$$anonfun$recover$1.apply(Future.scala:387) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Future$$anonfun$recover$1.apply(Future.scala:387) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29) [org.scala-lang.scala-library-2.10.2.jar:na]
at play.api.libs.iteratee.Execution$$anon$1.execute(Execution.scala:43) [com.typesafe.play.play-iteratees_2.10-2.2.1.jar:2.2.1]
at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:37) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:133) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Promise$class.complete(Promise.scala:55) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:58) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Future$$anonfun$flatMap$1$$anonfun$apply$3.apply(Future.scala:278) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Future$$anonfun$flatMap$1$$anonfun$apply$3.apply(Future.scala:278) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.processBatch$1(Future.scala:731) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.apply$mcV$sp(Future.scala:746) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.apply(Future.scala:723) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.apply(Future.scala:723) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Future$InternalCallbackExecutor$Batch.run(Future.scala:722) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Future$InternalCallbackExecutor$.scala$concurrent$Future$InternalCallbackExecutor$$unbatchedExecute(Future.scala:782) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:773) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:37) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:133) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Promise$class.complete(Promise.scala:55) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:58) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:274) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:274) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29) [org.scala-lang.scala-library-2.10.2.jar:na]
at play.api.libs.iteratee.Execution$$anon$2.execute(Execution.scala:70) [com.typesafe.play.play-iteratees_2.10-2.2.1.jar:2.2.1]
at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:37) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:133) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.Promise$class.complete(Promise.scala:55) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:58) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:23) [org.scala-lang.scala-library-2.10.2.jar:na]
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:42) [com.typesafe.akka.akka-actor_2.10-2.2.0.jar:2.2.0]
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386) [com.typesafe.akka.akka-actor_2.10-2.2.0.jar:2.2.0]
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [org.scala-lang.scala-library-2.10.2.jar:na]
Caused by: java.lang.RuntimeException: java.lang.IncompatibleClassChangeError: Class com.mongodb.casbah.Imports$ does not implement the requested interface com.mongodb.casbah.query.dsl.SearchOp
at play.api.mvc.ActionBuilder$$anon$1.apply(Action.scala:314) ~[com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:109) ~[com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:109) ~[com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
at play.utils.Threads$.withContextClassLoader(Threads.scala:18) ~[com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:108) ~[com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:107) ~[com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
at scala.Option.map(Option.scala:145) ~[org.scala-lang.scala-library-2.10.2.jar:na]
at play.api.mvc.Action$$anonfun$apply$1.apply(Action.scala:107) ~[com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
at play.api.mvc.Action$$anonfun$apply$1.apply(Action.scala:100) ~[com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
at play.api.libs.iteratee.Iteratee$$anonfun$mapM$1.apply(Iteratee.scala:481) ~[com.typesafe.play.play-iteratees_2.10-2.2.1.jar:2.2.1]
at play.api.libs.iteratee.Iteratee$$anonfun$mapM$1.apply(Iteratee.scala:481) ~[com.typesafe.play.play-iteratees_2.10-2.2.1.jar:2.2.1]
at play.api.libs.iteratee.Iteratee$$anonfun$flatMapM$1.apply(Iteratee.scala:517) ~[com.typesafe.play.play-iteratees_2.10-2.2.1.jar:2.2.1]
at play.api.libs.iteratee.Iteratee$$anonfun$flatMapM$1.apply(Iteratee.scala:517) ~[com.typesafe.play.play-iteratees_2.10-2.2.1.jar:2.2.1]
at play.api.libs.iteratee.Iteratee$$anonfun$flatMap$1$$anonfun$apply$13.apply(Iteratee.scala:493) ~[com.typesafe.play.play-iteratees_2.10-2.2.1.jar:2.2.1]
at play.api.libs.iteratee.Iteratee$$anonfun$flatMap$1$$anonfun$apply$13.apply(Iteratee.scala:493) ~[com.typesafe.play.play-iteratees_2.10-2.2.1.jar:2.2.1]
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) [org.scala-lang.scala-library-2.10.2.jar:na]
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) [org.scala-lang.scala-library-2.10.2.jar:na]
... 6 common frames omitted
Caused by: java.lang.IncompatibleClassChangeError: Class com.mongodb.casbah.Imports$ does not implement the requested interface com.mongodb.casbah.query.dsl.SearchOp
at com.mongodb.casbah.query.dsl.SearchOp$class.$init$(BarewordOperators.scala:405) ~[casbah-query_2.10-2.7.0-RC2.jar:2.6.2]
at com.mongodb.casbah.Imports$.<init>(Implicits.scala:142) ~[casbah-core_2.10-2.7.0-RC2.jar:2.7.0-RC2]
at com.mongodb.casbah.Imports$.<clinit>(Implicits.scala) ~[casbah-core_2.10-2.7.0-RC2.jar:2.7.0-RC2]
at com.q31.scerticles.core.domain.content.Exam$.getAllExamsForTechnologyWithPagination(Exam.scala:59) ~[scerticles-core-1.0-SNAPSHOT.jar:na]
at com.q31.scerticles.core.service.ContentService.allExamsForTechnologyWithPagination(ContentService.scala:46) ~[scerticles-core-1.0-SNAPSHOT.jar:na]
at controllers.content.ExamController$$anonfun$allExamsForTechnology$1.apply(ExamController.scala:37) ~[com-q31-scerticles.com-q31-scerticles-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
at controllers.content.ExamController$$anonfun$allExamsForTechnology$1.apply(ExamController.scala:35) ~[com-q31-scerticles.com-q31-scerticles-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
at play.api.mvc.ActionBuilder$$anonfun$apply$10.apply(Action.scala:221) ~[com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
at play.api.mvc.ActionBuilder$$anonfun$apply$10.apply(Action.scala:220) ~[com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
at play.api.mvc.Action$.invokeBlock(Action.scala:357) ~[com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
at play.api.mvc.ActionBuilder$$anon$1.apply(Action.scala:309) ~[com.typesafe.play.play_2.10-2.2.1.jar:2.2.1]
... 22 common frames omitted
Looks like there seems to be some sort of library incompatibility, but just don't know which one. Any clues? Here are my libraries so far!
-rw-r--r-- 1 root root 4467 Jun 14 09:09 aopalliance-1.0.jar
-rw-r--r-- 1 root root 167386 Jun 14 09:09 casbah-commons_2.10-2.7.0-RC2.jar
-rw-r--r-- 1 root root 286110 Jun 14 09:09 casbah-core_2.10-2.7.0-RC2.jar
-rw-r--r-- 1 root root 79191 Jun 14 09:09 casbah-gridfs_2.10-2.7.0-RC2.jar
-rw-r--r-- 1 root root 223987 Jun 14 09:09 casbah-query_2.10-2.7.0-RC2.jar
-rw-r--r-- 1 root root 264600 Jun 14 09:09 ch.qos.logback.logback-classic-1.0.13.jar
-rw-r--r-- 1 root root 418870 Jun 14 09:09 ch.qos.logback.logback-core-1.0.13.jar
-rw-r--r-- 1 root root 33491 Jun 14 09:09 com.fasterxml.jackson.core.jackson-annotations-2.2.2.jar
-rw-r--r-- 1 root root 191738 Jun 14 09:09 com.fasterxml.jackson.core.jackson-core-2.2.2.jar
-rw-r--r-- 1 root root 866104 Jun 14 09:09 com.fasterxml.jackson.core.jackson-databind-2.2.2.jar
-rw-r--r-- 1 root root 117309 Jun 14 09:09 com.github.nscala-time.nscala-time_2.10-0.2.0.jar
-rw-r--r-- 1 root root 1295513 Jun 14 09:09 com.github.scala-incubator.io.scala-io-core_2.10-0.4.2.jar
-rw-r--r-- 1 root root 437576 Jun 14 09:09 com.github.scala-incubator.io.scala-io-file_2.10-0.4.2.jar
-rw-r--r-- 1 root root 2189117 Jun 14 09:09 com.google.guava.guava-14.0.1.jar
-rw-r--r-- 1 root root 1549098 Jun 14 09:09 com.h2database.h2-1.3.172.jar
-rw-r--r-- 1 root root 110600 Jun 14 09:09 com.jolbox.bonecp-0.8.0.RELEASE.jar
-rw-r--r-- 1 root root 75459 Jun 14 09:09 com.jsuereth.scala-arm_2.10-1.3.jar
-rw-r--r-- 1 root root 46725 Jun 14 09:09 commons-codec.commons-codec-1.3.jar
-rw-r--r-- 1 root root 60686 Jun 14 09:09 commons-logging.commons-logging-1.1.1.jar
-rw-r--r-- 1 root root 500511 Jun 14 09:09 com.ning.async-http-client-1.7.18.jar
-rw-r--r-- 1 root root 30190 Jun 14 09:09 com.thoughtworks.paranamer.paranamer-2.5.2.jar
-rw-r--r-- 1 root root 2643414 Jun 14 09:09 com.typesafe.akka.akka-actor_2.10-2.2.0.jar
-rw-r--r-- 1 root root 14477 Jun 14 09:09 com.typesafe.akka.akka-slf4j_2.10-2.2.0.jar
-rw-r--r-- 1 root root 187497 Jun 14 09:09 com.typesafe.config-1.0.2.jar
-rw-r--r-- 1 root root 7012 Jun 14 09:09 com.typesafe.netty.netty-http-pipelining-1.1.2.jar
-rw-r--r-- 1 root root 294444 Jun 14 09:09 com.typesafe.play.anorm_2.10-2.2.1.jar
-rw-r--r-- 1 root root 3774943 Jun 14 09:09 com.typesafe.play.play_2.10-2.2.1.jar
-rw-r--r-- 1 root root 35156 Jun 14 09:09 com.typesafe.play.play-cache_2.10-2.2.1.jar
-rw-r--r-- 1 root root 5198 Jun 14 09:09 com.typesafe.play.play-datacommons_2.10-2.2.1.jar
-rw-r--r-- 1 root root 4571 Jun 14 09:09 com.typesafe.play.play-exceptions-2.2.1.jar
-rw-r--r-- 1 root root 366840 Jun 14 09:09 com.typesafe.play.play-functional_2.10-2.2.1.jar
-rw-r--r-- 1 root root 716463 Jun 14 09:09 com.typesafe.play.play-iteratees_2.10-2.2.1.jar
-rw-r--r-- 1 root root 201709 Jun 14 09:09 com.typesafe.play.play-jdbc_2.10-2.2.1.jar
-rw-r--r-- 1 root root 627243 Jun 14 09:09 com.typesafe.play.play-json_2.10-2.2.1.jar
-rw-r--r-- 1 root root 8759 Jun 14 09:09 com.typesafe.play.sbt-link-2.2.1.jar
-rw-r--r-- 1 root root 39142 Jun 14 09:09 com.typesafe.play.templates_2.10-2.2.1.jar
-rw-r--r-- 1 root root 187497 Jun 14 09:09 config-1.0.2.jar
-rw-r--r-- 1 root root 710492 Jun 14 09:09 guice-3.0.jar
-rw-r--r-- 1 root root 1208356 Jun 14 09:09 io.netty.netty-3.7.0.Final.jar
-rw-r--r-- 1 root root 2497 Jun 14 09:09 javax.inject-1.jar
-rw-r--r-- 1 root root 15071 Jun 14 09:09 javax.transaction.jta-1.1.jar
-rw-r--r-- 1 root root 40544 Jun 14 09:09 joda-convert-1.3.1.jar
-rw-r--r-- 1 root root 581571 Jun 14 09:09 joda-time-2.3.jar
-rw-r--r-- 1 root root 581571 Jun 14 09:09 joda-time.joda-time-2.3.jar
-rw-r--r-- 1 root root 586498 Jun 14 09:09 mongo-java-driver-2.12.0-rc2.jar
-rw-r--r-- 1 root root 1346296 Jun 14 09:09 net.sf.ehcache.ehcache-core-2.6.6.jar
-rw-r--r-- 1 root root 183875 Jun 14 09:09 nscala-time_2.10-0.6.0.jar
-rw-r--r-- 1 root root 6512 Jun 14 09:09 oauth.signpost.signpost-commonshttp4-1.2.1.2.jar
-rw-r--r-- 1 root root 45277 Jun 14 09:09 oauth.signpost.signpost-core-1.2.1.2.jar
-rw-r--r-- 1 root root 315805 Jun 14 09:09 org.apache.commons.commons-lang3-3.1.jar
-rw-r--r-- 1 root root 291037 Jun 14 09:09 org.apache.httpcomponents.httpclient-4.0.1.jar
-rw-r--r-- 1 root root 172888 Jun 14 09:09 org.apache.httpcomponents.httpcore-4.0.1.jar
-rw-r--r-- 1 root root 713930 Jun 14 09:09 org.javassist.javassist-3.18.0-GA.jar
-rw-r--r-- 1 root root 40544 Jun 14 09:09 org.joda.joda-convert-1.3.1.jar
-rw-r--r-- 1 root root 86503 Jun 14 09:09 org.json4s.json4s-ast_2.10-3.1.0.jar
-rw-r--r-- 1 root root 462450 Jun 14 09:09 org.json4s.json4s-core_2.10-3.1.0.jar
-rw-r--r-- 1 root root 63432 Jun 14 09:09 org.json4s.json4s-native_2.10-3.1.0.jar
-rw-r--r-- 1 root root 14411577 Jun 14 09:09 org.scala-lang.scala-compiler-2.10.2.jar
-rw-r--r-- 1 root root 7121818 Jun 14 09:09 org.scala-lang.scala-library-2.10.2.jar
-rw-r--r-- 1 root root 854338 Jun 14 09:09 org.scala-lang.scalap-2.10.2.jar
-rw-r--r-- 1 root root 3171168 Jun 14 09:09 org.scala-lang.scala-reflect-2.10.2.jar
-rw-r--r-- 1 root root 650514 Jun 14 09:09 org.scala-stm.scala-stm_2.10-0.7.jar
-rw-r--r-- 1 root root 16517 Jun 14 09:09 org.slf4j.jcl-over-slf4j-1.7.5.jar
-rw-r--r-- 1 root root 4960 Jun 14 09:09 org.slf4j.jul-to-slf4j-1.7.5.jar
-rw-r--r-- 1 root root 26084 Jun 14 09:09 org.slf4j.slf4j-api-1.7.5.jar
-rw-r--r-- 1 root root 7126003 Jun 14 09:09 scala-library-2.10.3.jar
-rw-r--r-- 1 root root 3171168 Jun 14 09:09 scala-reflect-2.10.2.jar
-rw-r--r-- 1 root root 7195811 Jun 14 09:09 scalatest_2.10-2.1.0.jar
-rw-r--r-- 1 root root 26084 Jun 14 09:09 slf4j-api-1.7.5.jar
-rw-r--r-- 1 root root 201315 Jun 14 09:09 tyrex.tyrex-1.0.1.jar
-rw-r--r-- 1 root root 1367760 Jun 14 09:09 xerces.xercesImpl-2.11.0.jar
-rw-r--r-- 1 root root 220536 Jun 14 09:09 xml-apis.xml-apis-1.4.01.jar
use casbah 2.8.1
version which could solve your problem.