Hi there
I am attempting to change a legacy monolith application which uses java
serialisation as it’s persistence mechanism to use ArangoDB.
I’m encountering a problem when persisting objects which contain other
objects because this results in the following exception:
VPackValueTypeException: Expecting type OBJECT`
I’m using Arango’s Java Driver as opposed to Arango’s spring data.
I have tried using Arango’s default serialization as well as writing my own
serializer, alongside this I have also tried using Jackson as the
serializer.
Below is an example of one of my serializers.
public class ArangoDbChunkSerializer extends ArangoDbSerializerDeserializer
implements VPackSerializer<Chunk>
{
protected static final String CHUNK_NAME = "chunk";
protected static final String CHUNK_SIZE = "chunkSize";
protected static final String ITEMS = "items";
@Override
public void serialize(VPackBuilder builder, String attribute, Chunk value,
VPackSerializationContext context)
throws VPackException
{
builder.add(attribute, ValueType.OBJECT, false);
builder.add(SERIALIZABLE_CLASS_NAME, value.getSerializableClassName());
builder.add(CHUNK_SIZE, value.getChunkSize());
VPack vPack = new VPack.Builder()
.registerSerializer(Row.class, new ArangoDbRowSerializer())
.build();
VPackSlice vPackSlice = vPack.serialize(value.getItems());
builder.add(vPackSlice);
builder.close();
}
}
The exception occurs inside
builder.close();
Any help would be awesome - thanks for reading this : )
--
Follow VizExplorer on LinkedIn <http://bit.ly/2fkNThb>and Twitter
<http://bit.ly/2fkMYxd>
<http://bit.ly/2fkQx6D>
<http://bit.ly/2EZpsn3>The information
contained in this email may be
private and/or confidential. It has been sent
for the sole use of the
intended recipient(s). If the reader of this message is
not an intended
recipient, you are hereby notified that any unauthorized
review, use,
disclosure, dissemination, distribution, or copying of this
communication,
or any of its contents, is strictly prohibited. If you have
received this
communication in error, please contact the sender by reply email
and
destroy all copies of the original message.
--
You received this message because you are subscribed to the Google Groups
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.