Jörn Franke
2018-09-30 16:57:36 UTC
Hi,
I get the following exception when I run my POI based application on a
certain platform (Apache Flink):
javax.xml.stream.FactoryConfigurationError: Provider
com.bea.xml.stream.EventFactory not found
This is not on Android and it is POI 4.0.0 using JDK8. The same code runs
fine on other platforms (e.g. MR, Hive, Spark) (the only difference is that
different platforms of course have different jars in the classpath).
It is only when writing a file (reading is no problem!).
I suspect some strange dependency on the classpath (jaxb, xmlbeans 2.x
etc.).
Any idea on how I can find more easily the root cause?
MSExcelWriter:
https://github.com/ZuInnoTe/hadoopoffice/blob/master/fileformat/src/main/java/org/zuinnote/hadoop/office/format/common/writer/msexcel/MSExcelWriter.java
Full stack trace:
Caused by: javax.xml.stream.FactoryConfigurationError: Provider
com.bea.xml.stream.EventFactory not found
at
javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:176)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
at
javax.xml.stream.XMLEventFactory.newInstance(XMLEventFactory.java:30)
at
org.apache.poi.openxml4j.opc.internal.marshallers.PackagePropertiesMarshaller.<clinit>(PackagePropertiesMarshaller.java:41)
at
org.apache.poi.openxml4j.opc.OPCPackage.<init>(OPCPackage.java:140)
at
org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:78)
at
org.apache.poi.openxml4j.opc.OPCPackage.create(OPCPackage.java:365)
at
org.apache.poi.xssf.usermodel.XSSFWorkbook.newPackage(XSSFWorkbook.java:495)
at
org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:261)
at
org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:257)
at
org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:245)
at
org.zuinnote.hadoop.office.format.common.writer.msexcel.MSExcelWriter.create(MSExcelWriter.java:177)
at
org.zuinnote.hadoop.office.format.common.OfficeWriter.create(OfficeWriter.java:96)
at
org.zuinnote.flink.office.AbstractSpreadSheetFlinkFileOutputFormat.open(AbstractSpreadSheetFlinkFileOutputFormat.java:94)
at
org.apache.flink.runtime.operators.DataSinkTask.invoke(DataSinkTask.java:202)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:703)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException:
com.bea.xml.stream.EventFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at
org.apache.flink.runtime.execution.librarycache.FlinkUserCodeClassLoaders$ChildFirstClassLoader.loadClass(FlinkUserCodeClassLoaders.java:129)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at
javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:68)
... 17 more
I get the following exception when I run my POI based application on a
certain platform (Apache Flink):
javax.xml.stream.FactoryConfigurationError: Provider
com.bea.xml.stream.EventFactory not found
This is not on Android and it is POI 4.0.0 using JDK8. The same code runs
fine on other platforms (e.g. MR, Hive, Spark) (the only difference is that
different platforms of course have different jars in the classpath).
It is only when writing a file (reading is no problem!).
I suspect some strange dependency on the classpath (jaxb, xmlbeans 2.x
etc.).
Any idea on how I can find more easily the root cause?
MSExcelWriter:
https://github.com/ZuInnoTe/hadoopoffice/blob/master/fileformat/src/main/java/org/zuinnote/hadoop/office/format/common/writer/msexcel/MSExcelWriter.java
Full stack trace:
Caused by: javax.xml.stream.FactoryConfigurationError: Provider
com.bea.xml.stream.EventFactory not found
at
javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:176)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
at
javax.xml.stream.XMLEventFactory.newInstance(XMLEventFactory.java:30)
at
org.apache.poi.openxml4j.opc.internal.marshallers.PackagePropertiesMarshaller.<clinit>(PackagePropertiesMarshaller.java:41)
at
org.apache.poi.openxml4j.opc.OPCPackage.<init>(OPCPackage.java:140)
at
org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:78)
at
org.apache.poi.openxml4j.opc.OPCPackage.create(OPCPackage.java:365)
at
org.apache.poi.xssf.usermodel.XSSFWorkbook.newPackage(XSSFWorkbook.java:495)
at
org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:261)
at
org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:257)
at
org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:245)
at
org.zuinnote.hadoop.office.format.common.writer.msexcel.MSExcelWriter.create(MSExcelWriter.java:177)
at
org.zuinnote.hadoop.office.format.common.OfficeWriter.create(OfficeWriter.java:96)
at
org.zuinnote.flink.office.AbstractSpreadSheetFlinkFileOutputFormat.open(AbstractSpreadSheetFlinkFileOutputFormat.java:94)
at
org.apache.flink.runtime.operators.DataSinkTask.invoke(DataSinkTask.java:202)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:703)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException:
com.bea.xml.stream.EventFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at
org.apache.flink.runtime.execution.librarycache.FlinkUserCodeClassLoaders$ChildFirstClassLoader.loadClass(FlinkUserCodeClassLoaders.java:129)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at
javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:68)
... 17 more