Home > database >  Spark connection mongo failed com. Mongo. The ConnectionString
Spark connection mongo failed com. Mongo. The ConnectionString

Time:10-04

Scala> MongoSpark. Save (documents)

Java. Lang. NoClassDefFoundError: com/mongo/ConnectionString
At com. Mongo. Spark. Config. MongoCompanionConfig $$anonfun $4. Apply (MongoCompanionConfig. Scala: 254)
At com. Mongo. Spark. Config. MongoCompanionConfig $$anonfun $4. Apply (MongoCompanionConfig. Scala: 254)
At the scala. Util. Try $. Apply (161). The Try scala:
At com. Mongo. Spark. Config. MongoCompanionConfig $class. The connectionString (MongoCompanionConfig. Scala: 254)
At com. Mongo. Spark. Config. WriteConfig $. The connectionString (WriteConfig. Scala: 36)
At com. Mongo. Spark. Config. WriteConfig $. Apply (WriteConfig. Scala: 71)

As long as the submission action to directing a saving data, will prompt connection failure...
My version: spark1.6.0 scala2.10.4, mongo3.4.7
Connect the jar has: mongo - spark - connector_2. 10-1.1.0. Jar
What reason????????

CodePudding user response:

Before the code also guide package
Import the mongo. Spark. _
The import org. Apache. Spark. _
The import org. Apache. Spark. SQL. Hive. HiveContext

CodePudding user response:

Directing a startup binding IP whether specific IP when I start binding localhost, and cannot access the mongo other machine

CodePudding user response:

Conflict settled, jar package, delete one of the good, thank you
  • Related