XStream
  1. XStream
  2. XSTR-681

NullPointerException when calling createObjectOutputStream() and toXML() concurrently

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.4.1
    • Fix Version/s: None
    • Component/s: Core, IO
    • Labels:
      None
    • JDK version and platform:
      Java HotSpot Server VM "1.6.0_07"; Linux

      Description

      Hi,

      following up on our discussion about XStream's thread safety on the mailing list, I found a problem when calling createObjectOutputStream() and toXML() concurrently. I'll attach a minimal example, see below for the stack trace.

      According to your explanations about the thread safety that XStream guarantees, this seems a clear bug.

      Thanks!

      Exception in thread "Thread-4154" java.lang.NullPointerException
      at com.sun.xml.internal.stream.writers.UTF8OutputStreamWriter.write(UTF8OutputStreamWriter.java:94)
      at com.sun.xml.internal.stream.writers.UTF8OutputStreamWriter.write(UTF8OutputStreamWriter.java:129)
      at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeStartDocument(XMLStreamWriterImpl.java:1109)
      at com.thoughtworks.xstream.io.xml.StaxWriter.<init>(StaxWriter.java:74)
      at com.thoughtworks.xstream.io.xml.StaxDriver.createStaxWriter(StaxDriver.java:141)
      at com.thoughtworks.xstream.io.xml.StaxDriver.createStaxWriter(StaxDriver.java:145)
      at com.thoughtworks.xstream.io.xml.StaxDriver.createWriter(StaxDriver.java:129)
      at com.thoughtworks.xstream.XStream.createObjectOutputStream(XStream.java:1575)
      at XStreamTest6$1.run(XStreamTest6.java:24)
      at java.lang.Thread.run(Thread.java:619)

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Michael Pradel
        • Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: