question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provider com.bea.xml.stream.EventFactory not found

See original GitHub issue

I try to read an xlsx file from an InputStream

            workbook = new XSSFWorkbook(is);

which yields

org.apache.poi.javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.EventFactory not found
     at org.apache.poi.javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72)
     at org.apache.poi.javax.xml.stream.FactoryFinder.find(FactoryFinder.java:178)
     at org.apache.poi.javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
     at org.apache.poi.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:161)
     at org.apache.poi.openxml4j.opc.OPCPackage.<init>(OPCPackage.java:141)
     at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:96)
     at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:342)
     at org.apache.poi.util.PackageHelper.open(PackageHelper.java:37)
     at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:285)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:21 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
Xosmondcommented, Apr 18, 2018

I went into this problem too, the workaround there not fixed the problem.

package javax.xml.stream;

    public static XMLEventFactory newInstance() throws FactoryConfigurationError {
        return (XMLEventFactory)FactoryFinder.find("javax.xml.stream.XMLEventFactory", "com.bea.xml.stream.EventFactory");
    }

The problem comes from there.

SOLVED WITH:

System.setProperty("javax.xml.stream.XMLInputFactory", "com.fasterxml.aalto.stax.InputFactoryImpl")
System.setProperty("javax.xml.stream.XMLOutputFactory", "com.fasterxml.aalto.stax.OutputFactoryImpl")
System.setProperty("javax.xml.stream.XMLEventFactory", "com.fasterxml.aalto.stax.EventFactoryImpl")

and adding stax to gradle:

implementation 'com.fasterxml:aalto-xml:1.0.0'

3reactions
Akansh0581commented, Jun 13, 2018

Add the following to your gradle file: implementation ‘com.fasterxml:aalto-xml:1.0.0’ And relax…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Provider com.bea.xml.stream.EventFactory not found
How to solve this issue? Adding this line on build.gradle: implementation 'com.fasterxml:aalto-xml:1.1.0'. doesn't ...
Read more >
Provider com.bea.xml.stream.EventFactory not found
Hi All, I am trying to read an .xlsx file, using Groovy but I keep on gett8ing this message. Caught: javax.xml.stream.FactoryConfigurationError: Provider
Read more >
com.bea.xml.stream.EventFactory Maven / Gradle / Ivy
com.bea.xml.stream.EventFactory maven / gradle build tool code. The class is part of the package ➦ Group: stax ➦ Artifact: stax ➦ Version: 1.2.0....
Read more >
Re: Caught: javax.xml.stream.FactoryConfigurationError
Re: Caught: javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.EventFactory not found ... Hi, Are you trying to run the code ...
Read more >
android8 factory.db,Provider com.bea.xml.stream ... - CSDN博客
android8 factory.db,Provider com.bea.xml.stream.EventFactory not found. weixin_39692271 于 2021-05-28 17:35:07 发布 525 收藏. 文章标签: android8 factory.db.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found