Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

writeObjectRef is not implemented #136

Closed
bognari opened this issue May 15, 2019 · 1 comment
Closed

writeObjectRef is not implemented #136

bognari opened this issue May 15, 2019 · 1 comment

Comments

@bognari
Copy link

bognari commented May 15, 2019

Hi, when I use my setup from #135 I get this exception:

Caused by: com.fasterxml.jackson.core.JsonGenerationException: No native support for writing Object Ids
	at com.fasterxml.jackson.core.JsonGenerator.writeObjectRef(JsonGenerator.java:1393)
	at com.fasterxml.jackson.databind.ser.impl.WritableObjectId.writeAsId(WritableObjectId.java:37)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase._serializeWithObjectId(BeanSerializerBase.java:615)
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:148)
	at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContentsUsing(CollectionSerializer.java:171)
	at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents(CollectionSerializer.java:116)
	at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:107)
	at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:25)
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:727)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:719)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase._serializeWithObjectId(BeanSerializerBase.java:631)
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:148)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
	at com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3905)
	at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsBytes(ObjectMapper.java:3243)
	at org.litote.kmongo.jackson.JacksonCodec.encode(JacksonCodec.kt:185)

because KMongoBsonGenerator does not implement the method writeObjectRef from JsonGenerator.

@zigzago
Copy link
Member

zigzago commented May 15, 2019

Thanks for reporting. The fix is in the snapshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants