Common Issues with StAX
Here are a couple of errors you might run into:
Provider com.bea.xml.stream.MXParserFactory not found
-
This indicates that you only have the API JAR in your classpath, not an actual implementation. The default implementation of javax.xml.stream.XMLInputFactory is com.bea.xml.stream.com.bea.xml.stream.MXParserFactory.
Current state of the parser is X But expected state is Y
-
This indicates you are attempting to call a method on XMLStreamReader that is not valid for the current event. See Table 8-3 for a list of valid methods for each event.