The problem here is to do with the build path. I had an old version of Stax-api being picked up somewhere.
Java XMLInputFactory Error
-
30-05-2022 - |
Domanda
I have some code like:
import javax.xml.stream.XMLEventReader;
...
XMLInputFactory xmlin = XMLInputFactory.newInstance()
which has been written in Eclipse.
This code produces an error like:
Caught: java.lang.ClassCastException: com.bea.xml.stream.MXParserFactory cannot be cast to javax.xml.stream.XMLInputFactory
Which I can't work out at the moment. I suspect it's something to do with a library clash (similar to Woodstox stax and java stax conflict) but I'm not sure if that's correct, or how to resolve it.
If anyone can point me in a direction to start understanding this behaviour that would be great!
Thanks, Arlo
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow