JIRA plugin v2 Apache POI XMLEventFactory: Provider com.ctc.wstx.stax.WstxEventFactory not found

Hi,

I've added the Apache POI dependency to my JIRA plugin in order to add the ability to create Excel spreadsheets.

I've been able to create a simple spreadsheet with data populated in cells using the HSSFWorkbook.  But when I change my code to use the XSSFWorkbook (instead of HSSFWorkbook, all other code unchanged), then I'm getting the following run-time error:

java.util.ServiceConfigurationError: javax.xml.stream.XMLEventFactory: Provider com.ctc.wstx.stax.WstxEventFactory not found 
// Workbook workbook = new HSSFWorkbook(); // this works
Workbook workbook = new XSSFWorkbook(); // this gets the run-time error

 

Can this be some sort of jar conflict?
Here is the Apache POI dependency that I added to my pom.xml:

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.15</version>
</dependency>

 I looked up the jar that has the com.ctc.wstx.stax.WstxEventFactory class and it belongs to wstx-asl-x.x.x.jar ... do I need to add a dependency to this?  Or add it to the Import-Package section?

Thanks in advance for any help!

1 answer

1 accepted

This widget could not be displayed.

I found the solution!  I added another dependency (a jar library which contains the com.ctc.wstx.stax.WstxEventFactory class) so the following is what I needed in my pom.xml:

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<groupId>com.ctc.wstx</groupId>
<artifactId>woodstox-osgi</artifactId>
<version>3.2.1.1</version>
</dependency>

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

169 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you