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
When using XStreamMarshaller for serializing object to JSON by customizing StreamDriver to skip root node resulting in empty output. Configuration of StreamDriver illustrated by the following snapshot
final XStreamMarshaller marshaller = new XStreamMarshaller();
marshaller.setStreamDriver(new JsonHierarchicalStreamDriver() {
public HierarchicalStreamWriter createWriter(Writer writer) {
return new JsonWriter(writer, JsonWriter.DROP_ROOT_MODE);
}
});
At the same time using XSTream directly works just fine.
final XStream xStream = new XStream(new JsonHierarchicalStreamDriver() {
public HierarchicalStreamWriter createWriter(Writer writer) {
return new JsonWriter(writer, JsonWriter.DROP_ROOT_MODE);
}
});
Can you indicate how you use the marshaller/xstream instance later on? Specifically: are you writing to a DOM tree, an OutputStream, a Writer, XMLStreamWriter, etc?
Yevhen Yaremchuk opened SPR-6939 and commented
When using XStreamMarshaller for serializing object to JSON by customizing StreamDriver to skip root node resulting in empty output. Configuration of StreamDriver illustrated by the following snapshot
At the same time using XSTream directly works just fine.
Affects: 3.0 GA
Referenced from: commits ac9a625
The text was updated successfully, but these errors were encountered: