Skip to content

Implement MessagePackFactory.copy() method #453

Closed

Description

@mrniko

Hi!

MessagePackFactory should override copy method to avoid such exception during ObjectMapper.copy() method invocation:

java.lang.IllegalStateException: Failed copy(): org.msgpack.jackson.dataformat.MessagePackFactory (version: 2.9.4) does not override copy(); it has to
at com.fasterxml.jackson.core.JsonFactory._checkInvalidCopy(JsonFactory.java:332)
at com.fasterxml.jackson.core.JsonFactory.copy(JsonFactory.java:320)
at com.fasterxml.jackson.databind.ObjectMapper.(ObjectMapper.java:499)
at com.fasterxml.jackson.databind.ObjectMapper.copy(ObjectMapper.java:617)
at org.redisson.codec.JsonJacksonCodec.(JsonJacksonCodec.java:106)
at org.redisson.codec.MsgPackJacksonCodec.(MsgPackJacksonCodec.java:31)

Activity

  1. xerial commented on Jan 29, 2018

    @xerial
    Member

    @komamitsu What do you think?

  2. komamitsu commented on Feb 4, 2018

    @komamitsu
    Member

    @mrniko Thanks for reporting this issue. Fixed it at #454

  3. mrniko commented on Apr 13, 2018

    @mrniko
    Author

    @komamitsu Hi! I'm afraid bug is not fixed completely redisson/redisson#1314 (comment)

  4. komamitsu commented on Apr 14, 2018

    @komamitsu
    Member

    Yeah, the test I wrote checked only the case that MessagePackFactory has ExtensionTypeCustomDeserializers...
    https://github.com/msgpack/msgpack-java/blob/develop/msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/MessagePackFactoryTest.java#L69-L79

    This can be a workaround. But anyway I'll fix it soon.

    ObjectMapper copy = new ObjectMapper(new MessagePackFactory()
                             .setExtTypeCustomDesers(new ExtensionTypeCustomDeserializers())).copy();
    
  5. mrniko commented on Apr 16, 2018

    @mrniko
    Author

    @komamitsu

    Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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