[DOCS-7831] Version mismatch with Spark HD Insight Created: 09/May/16  Updated: 11/Jan/17  Resolved: 06/Sep/16

Status: Closed
Project: Documentation
Component/s: drivers
Affects Version/s: mongodb-3.2
Fix Version/s: 01112017-cleanup

Type: Improvement Priority: Critical - P2
Reporter: Veeresh S Y Assignee: Unassigned
Resolution: Done Votes: 0
Labels: driver
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

HD Insight ( Linux)


Participants:
Days since reply: 7 years, 24 weeks, 1 day ago
Story Points: 9

 Description   

Hi
I have installed Mongodb 3.2.5 ( latest) on Azure VMs ( 3 nodes) . Also a HDInsight Spark cluster created in the same vNet. Want to collect MongodB mongo instance from the head node of spark cluster. To do that I have downloaded the mongo-scala-driver_2.11-1.0.1.jar. When I run the sample program QuickTour.scala on scala shell prompt I get the error
I believe the driver expects the latest version scala 2.11 but the one that comes with HD Insight is 2.10.4 . Guess the below error is due to that.
Please help me understand whats going on here.

------------------------
scala> import org.mongodb.scala._
import org.mongodb.scala._

scala> import org.mongodb.scala.model.Aggregates._
import org.mongodb.scala.model.Aggregates._

scala> import org.mongodb.scala.model.Filters._
import org.mongodb.scala.model.Filters._

scala> import org.mongodb.scala.model.Projections._
import org.mongodb.scala.model.Projections._

scala> import org.mongodb.scala.model.Sorts._
import org.mongodb.scala.model.Sorts._

scala> import org.mongodb.scala.model.Updates._
import org.mongodb.scala.model.Updates._

scala> import org.mongodb.scala.model._
import org.mongodb.scala.model._

scala> val mongoClient = MongoClient("mongodb://10.1.0.7")
error: bad symbolic reference. A signature in MongoClient.class refers to term client
in package com.mongodb.async 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 MongoClient.class.

scala> util.Properties.versionString
res0: String = version 2.10.4

scala> util.Properties.versionNumberString
res1: String = 2.10.4

scala> util.Properties.versionMsg
res2: String = Scala library version 2.10.4 – Copyright 2002-2013, LAMP/EPFL

scala> exit



 Comments   
Comment by Ross Lawley [ 30/Aug/16 ]

Hi veereshsy05@gmail.com,

Many apologies for missing this ticket. You're correct the reason for the error is due to the MongoDB Scala driver only supporting Scala 2.11.

The good news is we now have an official MongoDB Spark connector that supports both Scala 2.11 and Scala 2.10. You can download the MongoDB Spark connector from the Spark Packages site.

Ross

Generated at Thu Feb 08 07:55:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.