Closed jeffisenhart closed 5 years ago
This is actually related to the version guava
used in Hadoop. Are you using any other packages which might be incompatible with the version shipped with Spark 2.4.0?
Few quick fixes are adding hadoop-client
with the version that supports a higher guava
or Identified your dependency hierarchy and exclude the one that uses guava
.
OK, I've trimmed down the dependencies to see what the issue might be and now getting a different error. Here is the exhaustive list of my dependencies.
compile group: 'org.apache.spark', name: 'spark-core_2.11', version: '2.4.0'
compile group: 'org.apache.spark', name: 'spark-sql_2.11', version: '2.4.0'
compile group: 'com.johnsnowlabs.nlp', name: 'spark-nlp_2.11', version: '1.8.2'
compile group: 'com.johnsnowlabs.nlp', name: 'spark-nlp-ocr_2.11', version: '1.8.2'
compile group: 'org.apache.spark', name: 'spark-mllib_2.11', version: '2.4.0'
compile group: 'com.amazonaws', name: 'aws-java-sdk-core', version: '1.11.372'
compile group: 'com.amazonaws', name: 'aws-java-sdk-s3', version: '1.11.372'
And the current issue:
java.lang.NoSuchMethodError: com.google.common.base.Stopwatch.elapsedMillis()J
at org.apache.hadoop.mapred.FileInputFormat.listStatus(FileInputFormat.java:245)
at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:313)
at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:204)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:253)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:251)
at scala.Option.getOrElse(Option.scala:121)
at org.apache.spark.rdd.RDD.partitions(RDD.scala:251)
at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:49)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:253)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:251)
at scala.Option.getOrElse(Option.scala:121)
at org.apache.spark.rdd.RDD.partitions(RDD.scala:251)
at org.apache.spark.rdd.RDD$$anonfun$take$1.apply(RDD.scala:1343)
at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:112)
at org.apache.spark.rdd.RDD.withScope(RDD.scala:363)
at org.apache.spark.rdd.RDD.take(RDD.scala:1337)
at org.apache.spark.rdd.RDD$$anonfun$first$1.apply(RDD.scala:1378)
at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:112)
at org.apache.spark.rdd.RDD.withScope(RDD.scala:363)
at org.apache.spark.rdd.RDD.first(RDD.scala:1377)
at org.apache.spark.ml.util.DefaultParamsReader$.loadMetadata(ReadWrite.scala:615)
at org.apache.spark.ml.util.DefaultParamsReader.load(ReadWrite.scala:493)
at com.johnsnowlabs.nlp.FeaturesReader.load(ParamsAndFeaturesReadable.scala:12)
at com.johnsnowlabs.nlp.FeaturesReader.load(ParamsAndFeaturesReadable.scala:8)
at com.johnsnowlabs.nlp.pretrained.ResourceDownloader$.downloadModel(ResourceDownloader.scala:115)
at com.johnsnowlabs.nlp.pretrained.ResourceDownloader$.downloadModel(ResourceDownloader.scala:109)
at com.johnsnowlabs.nlp.annotators.ner.dl.PretrainedNerDL$class.pretrained(NerDLModel.scala:117)
at com.johnsnowlabs.nlp.annotators.ner.dl.NerDLModel$.pretrained(NerDLModel.scala:121)
at com.johnsnowlabs.nlp.annotators.ner.dl.NerDLModel.pretrained(NerDLModel.scala)
at hack.NerExample.getEntities(NerExample.java:46)
at hack.NerExample.main(NerExample.java:175)
I finally got the code to run by restricting the quava to version 15
compile ("com.google.guava:guava:15.0:cdi1.0") {
force = true
}
Good to hear that :)
I am trying to replicate NerDLPipeline in Java (standalone) and getting an exception
Here is the code. I expect to see the output of the call
pm.select("ner","ner_converter").show(false);
When this line executes
NerDLModel ner = NerDLModel.pretrained(NerDLModel.pretrained$default$1(), NerDLModel.pretrained$default$2(), NerDLModel.pretrained$default$3());
I get the following exception:
Version used: compile group: 'org.apache.spark', name: 'spark-core_2.11', version: '2.4.0' compile group: 'org.apache.spark', name: 'spark-sql_2.11', version: '2.4.0' compile group: 'com.johnsnowlabs.nlp', name: 'spark-nlp_2.11', version: '1.8.2' compile group: 'com.johnsnowlabs.nlp', name: 'spark-nlp-ocr_2.11', version: '1.8.2' runtime group: 'org.apache.spark', name: 'spark-mllib_2.11', version: '2.4.0'
Operating System and version (desktop or mobile): maxOS Mojave 10.14.1