Skip to content

Having trouble serializing Ebean classes with Jackson module #8

@jamie-nxtgencare

Description

@jamie-nxtgencare

Hi.

I'm receiving the following error message when trying to serialize an enhanced ebean model object:

com.fasterxml.jackson.databind.JsonMappingException: Type id handling not implemented for type <ebean type> (by serializer of type io.ebean.jackson.CommonBeanSerializer)

I'm using a library to store serialized objects in a cache, however, I've stripped all of my code down to the bare bones to try to troubleshoot this issue and can duplicate it simply with:

ObjectMapper mapper = new ObjectMapper().registerModule(new JacksonEbeanModule());
mapper.writeValueAsString(<new EbeanEntity()>);

That being said, I've been able to create a new entity the exact same way and convert it to JSON using eBeanServer.toJson(obj), so as far as I can tell there's nothing wrong with my object.

I'm also not sure if I have a version mismatch or something:

Ebean

compile 'io.ebean:ebean:11.3.1'
compile 'io.ebean:ebean-spring-txn:10.1.1'

ebean-jackson:
compile group: 'io.ebean', name: 'ebean-jackson', version: '10.1.1'

I'm bringing in jackson as a dependency to another jackson library:

compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.8'

It's version matches the version of that jar: 2.8.8.

Let me know if this is an issue on my end or an actual problem. If you need more details about the contents of my model objects, I'd be happy to oblige, however, I've tried this with a number of different models and they all have the same problem; tracing through the code, it never even calls CommonBeanSerializer.serialize, so it's not even getting to the point where it's looking at the contents of the object yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions