Hi, I am trying to use -
final XMLOutputFactory2 xmlOutputFactory = (XMLOutputFactory2) XMLOutputFactory2.newInstance();//XMLOutputFactory.newInstance();
final XMLStreamWriter2 xmlStreamWriter = (XMLStreamWriter2) xmlOutputFactory.createXMLStreamWriter(new FileWriter(file));
Error I am getting -
Caused by: java.lang.ClassCastException: com.ctc.wstx.stax.WstxOutputFactory cannot be cast to javax.xml.stream.XMLtputFactory
on line 1.
I have gone through -
https://jira.atlassian.com/browse/JRASERVER-26214
did not really understand any of them or what I am supposed to change.
Specific condition when I am getting this error -
When I am running my code in Http thread(i.e) the main thread code works fine, but when I am using a worker thread this error is thrown.
My pom.xml -
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>com.ctc.wstx</groupId>
<artifactId>woodstox-osgi</artifactId>
<version>3.2.1.1</version>
</dependency>