Dependency Issue java.lang.NoSuchMethodError: com.monitorjbl.xlsx
See original GitHub issueHello, i’m trying to read a simple excel file but i keep getting an error. Here is the full stacktrace
Exception in thread "main" java.lang.NoSuchMethodError: com.monitorjbl.xlsx.StreamingReader$Builder.open(Ljava/io/InputStream;)Lshadeio/poi/ss/usermodel/Workbook; at com.crealytics.spark.excel.StreamingWorkbookReader.openWorkbook(WorkbookReader.scala:56) at com.crealytics.spark.excel.WorkbookReader.withWorkbook(WorkbookReader.scala:14) at com.crealytics.spark.excel.WorkbookReader.withWorkbook$(WorkbookReader.scala:13) at com.crealytics.spark.excel.StreamingWorkbookReader.withWorkbook(WorkbookReader.scala:47) at com.crealytics.spark.excel.ExcelRelation.excerpt$lzycompute(ExcelRelation.scala:31) at com.crealytics.spark.excel.ExcelRelation.excerpt(ExcelRelation.scala:31) at com.crealytics.spark.excel.ExcelRelation.headerCells$lzycompute(ExcelRelation.scala:33) at com.crealytics.spark.excel.ExcelRelation.headerCells(ExcelRelation.scala:33) at com.crealytics.spark.excel.ExcelRelation.$anonfun$inferSchema$1(ExcelRelation.scala:148) at scala.Option.getOrElse(Option.scala:138) at com.crealytics.spark.excel.ExcelRelation.inferSchema(ExcelRelation.scala:147) at com.crealytics.spark.excel.ExcelRelation.<init>(ExcelRelation.scala:40) at com.crealytics.spark.excel.DefaultSource.createRelation(DefaultSource.scala:40) at com.crealytics.spark.excel.DefaultSource.createRelation(DefaultSource.scala:18) at com.crealytics.spark.excel.DefaultSource.createRelation(DefaultSource.scala:12) at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:318) at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:223) at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:211) at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:178) at ExcelSparkParser$.readExcel(ExcelSparkParser.scala:86) at ExcelSparkParser$.$anonfun$main$3(ExcelSparkParser.scala:51) at ExcelSparkParser$.$anonfun$main$3$adapted(ExcelSparkParser.scala:48) at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36) at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:198) at ExcelSparkParser$.main(ExcelSparkParser.scala:48) at ExcelSparkParser.main(ExcelSparkParser.scala)
Envirorment:
- Scala 2.12.8 (tested also 2.12.0)
- Spark Core/SQL/Avro 2.4.0 (also tested on 2.4.3)
- Spark excel 0.12.0
- Running locally on my machine
I’m able to make it work only using an older version of spark-excel, to be precise version 0.11.2 , same spark versione and same scala version. scala 2.11.x and spark-excel 0.11.1 are also working.
Thank you very much
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:23
Top GitHub Comments
I get the same error. When using the option maxRowsInMemory you get the above error. When removing that option the dependency error disappears.
I’m new to spark-excel so maybe not entirely accurate but that was my observation.
Exception in thread “main” java.lang.NoSuchMethodError: com.monitorjbl.xlsx.StreamingReader$Builder.open(Ljava/io/InputStream;)Lshadeio/poi/ss/usermodel/Workbook;
I’ve released
0.12.4
withxlsx-streamer
shaded. This should hopefully fix this issue. If it doesn’t, please reopen.