NullPointer in Weblogic using XLIFFReader

Issue #17 new
Fred Gracely
created an issue

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 {
      StreamSource e = this.validateAndGetInput(file, uri, string, stream);
      XMLInputFactory fact = XMLInputFactory.newInstance();
      fact.setProperty("", Boolean.valueOf(true));
      fact.setProperty("", 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)

  1. Chase Tingley

    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/ also has this problem. The other callers mostly use InputStream and should be ok.

  2. Log in to comment