1. Okapi Framework
  2. Okapi and localization
  3. XLIFF Toolkit
  4. Issues

Issues

Issue #17 new

NullPointer in Weblogic using XLIFFReader

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 {
      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)

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

  2. Log in to comment