Hi Dave,
From the stack-trace's lines:
at org.xadisk.additional.XAFileInputStreamWrapper.read(XAFileInputStreamWrapper.java:77)
at org.glassfish.jersey.message.internal.ReaderWriter.writeTo(ReaderWriter.java:115)
it appears that jersey is using the xadisk-inputstream at a point when the transaction linked to the stream is already completed (hence we see this exception, as expected).
Actually, the streams (input or output) of xadisk cannot be "exported/leaked" to any other code which would use these after the time of transaction completion. In this case,
we are exporting the inputstream, and by the time jersey uses it, the transaction is already complete.
For xadisk-outputstream in this example, we are not really exporting anything out of the transaction: the transaction starts, xadisk-outputstream gets created, which is written using
a normal inputstream (non-xadisk), and the transaction completes. Then, that xadisk-outputstream is no longer used. So it worked for that case.
Thanks,
Nitin