You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to marshall Java object using JAXB API. Using EXIResult object works all right.
But when I try to do it through StaXEncoder class within method like this:
public void marshalToExiStream(CmmMessage jaxbMessage, OutputStream outputStream) throws EXIException, IOException, JAXBException {
StAXEncoder encoder = new StAXEncoder(exiFactory);
encoder.setOutputStream(outputStream);
produceMarshaller().marshal(jaxbMessage, encoder);
}
I receive such error because deflate stream is finished:
Caused by: java.io.IOException: write beyond end of stream
at java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:201)
at java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:188)
at com.siemens.ct.exi.io.channel.ByteEncoderChannel.encode(ByteEncoderChannel.java:70)
at com.siemens.ct.exi.io.channel.AbstractEncoderChannel.encodeUnsignedInteger(AbstractEncoderChannel.java:151)
at com.siemens.ct.exi.datatype.strings.StringEncoderImpl.writeValue(StringEncoderImpl.java:71)
at com.siemens.ct.exi.datatype.StringDatatype.writeValue(StringDatatype.java:81)
at com.siemens.ct.exi.types.TypedTypeEncoder.writeValue(TypedTypeEncoder.java:70)
at com.siemens.ct.exi.core.EXIBodyEncoderReordered.closeBlock(EXIBodyEncoderReordered.java:197)
at com.siemens.ct.exi.core.EXIBodyEncoderReordered.flush(EXIBodyEncoderReordered.java:278)
at com.siemens.ct.exi.api.stream.StAXEncoder.flush(StAXEncoder.java:549)
at com.sun.xml.internal.bind.v2.runtime.output.XMLStreamWriterOutput.endDocument(XMLStreamWriterOutput.java:97)
at com.sun.xml.internal.bind.v2.runtime.output.ForkXmlOutput.endDocument(ForkXmlOutput.java:59)
at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.endDocument(XMLSerializer.java:836)
at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.postwrite(MarshallerImpl.java:362)
at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:309)
at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:163)
The text was updated successfully, but these errors were encountered:
mkrzempek
changed the title
Problem with marshal object with JAXB and StAXEncoder
Problem with marshall object with JAXB and StAXEncoder
Apr 28, 2017
I try to marshall Java object using JAXB API. Using EXIResult object works all right.
But when I try to do it through StaXEncoder class within method like this:
I receive such error because deflate stream is finished:
The text was updated successfully, but these errors were encountered: