NullPointer in Weblogic using XLIFFReader
The XMLInputFactory within WebLogic (weblogic.xml.stax.XMLStreamInputFactory) has the following wonderful implementation of createXMLStreamReader(Source source):
public XMLStreamReader createXMLStreamReader(Source source) throws XMLStreamException {
return null;
}
This causes a null pointer when using XLIFFReader since it fully trusts the factory to provide an XMLStreamReader for a source:
private void open(File file, URI uri, String string, InputStream stream) {
try {
this.close();
StreamSource e = this.validateAndGetInput(file, uri, string, stream);
XMLInputFactory fact = XMLInputFactory.newInstance();
fact.setProperty("javax.xml.stream.isCoalescing", Boolean.valueOf(true));
fact.setProperty("javax.xml.stream.supportDTD", Boolean.valueOf(false));
this.reader = fact.createXMLStreamReader(e);
Obviously, this is a problem with the weblogic implementation and not necessarily your code (why do they just return null?) It supports InputStreams, Readers and XMLStreamReaders but not Source. I thought you might want to know about it.
Comments (3)
-
-
- edited description
-
I did a quick check of the main Okapi codebase for this as well; I think
./okapi/steps/xmlvalidation/src/main/java/net/sf/okapi/steps/xmlvalidation/XMLValidationStep.java
also has this problem. The other callers mostly useInputStream
and should be ok. - Log in to comment
Thanks a lot for the info. We'll see if we can use something else than Source.