XMLEventFactory cannot be created when exporting data to XLSX Format
Asked by Samer Sboui:

Hi developers, i got this error while trying to export data in XLSX format ! How should i fix it ?

javax.xml.stream.FactoryConfigurationError: Provider for class javax.xml.stream.XMLEventFactory cannot be created  
\[INFO\] \[talledLocalContainer\] at javax.xml.stream.FactoryFinder.findServiceProvider(FactoryFinder.java:370)  
\[INFO\] \[talledLocalContainer\] at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:313)  
\[INFO\] \[talledLocalContainer\] at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:227)  
\[INFO\] \[talledLocalContainer\] at javax.xml.stream.XMLEventFactory.newInstance(XMLEventFactory.java:64)  
\[INFO\] \[talledLocalContainer\] at org.apache.poi.openxml4j.opc.internal.marshallers.PackagePropertiesMarshaller.\<clinit\>(PackagePropertiesMarshaller.java:41)  
\[INFO\] \[talledLocalContainer\] at org.apache.poi.openxml4j.opc.OPCPackage.init(OPCPackage.java:161)  
\[INFO\] \[talledLocalContainer\] at org.apache.poi.openxml4j.opc.OPCPackage.\<init\>(OPCPackage.java:141)  
\[INFO\] \[talledLocalContainer\] at org.apache.poi.openxml4j.opc.ZipPackage.\<init\>(ZipPackage.java:72)  
\[INFO\] \[talledLocalContainer\] at org.apache.poi.openxml4j.opc.OPCPackage.create(OPCPackage.java:394)  
\[INFO\] \[talledLocalContainer\] at org.apache.poi.xssf.usermodel.XSSFWorkbook.newPackage(XSSFWorkbook.java:480)  
\[INFO\] \[talledLocalContainer\] at org.apache.poi.xssf.usermodel.XSSFWorkbook.\<init\>(XSSFWorkbook.java:247)  
\[INFO\] \[talledLocalContainer\] at org.apache.poi.xssf.usermodel.XSSFWorkbook.\<init\>(XSSFWorkbook.java:239)

....

....

....

... 304 more  
\[INFO\] \[talledLocalContainer\] Caused by: java.util.ServiceConfigurationError: javax.xml.stream.XMLEventFactory: Provider com.ctc.wstx.stax.WstxEventFactory could not be instantiated  
\[INFO\] \[talledLocalContainer\] at java.util.ServiceLoader.fail(ServiceLoader.java:232)  
\[INFO\] \[talledLocalContainer\] at java.util.ServiceLoader.access$100(ServiceLoader.java:185)  
\[INFO\] \[talledLocalContainer\] at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)  
\[INFO\] \[talledLocalContainer\] at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)  
\[INFO\] \[talledLocalContainer\] at java.util.ServiceLoader$1.next(ServiceLoader.java:480)  
\[INFO\] \[talledLocalContainer\] at javax.xml.stream.FactoryFinder$1.run(FactoryFinder.java:353)  
\[INFO\] \[talledLocalContainer\] at java.security.AccessController.doPrivileged(Native Method)  
\[INFO\] \[talledLocalContainer\] at javax.xml.stream.FactoryFinder.findServiceProvider(FactoryFinder.java:341)  
\[INFO\] \[talledLocalContainer\] ... 304 more  
\[INFO\] \[talledLocalContainer\] Caused by: java.lang.LinkageError: loader constraint violation: when resolving overridden method "com.ctc.wstx.stax.WstxEventFactory.createAttribute(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljavax/xml/stream/events/Attribute;" the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) of the current class, com/ctc/wstx/stax/WstxEventFactory, and its superclass loader (instance of \<bootloader\>), have different Class objects for the type javax/xml/stream/events/Attribute used in the signature  
\[INFO\] \[talledLocalContainer\] at java.lang.Class.getDeclaredConstructors0(Native Method)  
\[INFO\] \[talledLocalContainer\] at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)  
\[INFO\] \[talledLocalContainer\] at java.lang.Class.getConstructor0(Class.java:3075)  
\[INFO\] \[talledLocalContainer\] at java.lang.Class.newInstance(Class.java:412)


Answers:
author: Shannon S
body: Samer,

You mentioned developers - are you developing an add-on that is causing this error? How exactly are you exporting the XLSX data from Confluence?

Let us know exactly what you did when you ran into this error, and please also include your Confluence version.

Lastly, from your logs, do you see any that are listed as \[ERROR\] rather than \[INFO\]? That should provide us with further details.

Regards,

Shannon

comments: author: Samer Sboui
body: yeah, i'm developing a confluence add-on and i got this error.


author: Shannon S
body: Samer,

Thank you for confirming.

In that case, we have [a separate Community for developing add-ons](https://community.developer.atlassian.com/) for our products. You may have better luck there.

Regards,

Shannon


Tags: ms-excel