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

Jackson 2.9.5, 2.9.6 incompatible with snakeyaml 1.20, 1.21 #81

Closed
yborovikov opened this issue Apr 25, 2018 · 12 comments
Closed

Jackson 2.9.5, 2.9.6 incompatible with snakeyaml 1.20, 1.21 #81

yborovikov opened this issue Apr 25, 2018 · 12 comments
Labels
yaml Issue related to YAML format backend

Comments

@yborovikov
Copy link

A backwards-incompatible (with jackson 2.9.5) change was introduced in snakeyaml 1.20, so anyone trying to use the latest released versions of jackson and snakeyaml would run into a problem:

java.lang.NoSuchMethodError: org.yaml.snakeyaml.events.MappingStartEvent.<init>(Ljava/lang/String;Ljava/lang/String;ZLorg/yaml/snakeyaml/error/Mark;Lorg/yaml/snakeyaml/error/Mark;Ljava/lang/Boolean;)V

    at com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.writeStartObject(YAMLGenerator.java:489)
    at com.fasterxml.jackson.core.base.GeneratorBase.writeStartObject(GeneratorBase.java:286)
    at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:626)
    at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:33)
    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:3893)
    at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3207)
yborovikov pushed a commit to yborovikov/jackson-dataformats-text that referenced this issue Apr 25, 2018
@Dico200
Copy link

Dico200 commented Jul 26, 2018

Running into the same issue.

Specifically, just using jackson-dataformat-yaml isn't working. I am shadowing the snakeyaml dependency because the classpath has another incompatible version, but still running into issues.

@cowtowncoder
Copy link
Member

@Dico200 and you did check with 2.9.6 which has been out for while now?

@cthiebaud
Copy link

@cowtowncoder the issue is still open with 2.9.6

@Dico200
Copy link

Dico200 commented Aug 2, 2018

Yes, 2.9.6

@Dico200
Copy link

Dico200 commented Aug 2, 2018

I resolved my problem. I found more transitive dependencies for snakeyaml that were overriding the version. But snakeyaml making this unnecessary breaking change isn't appreciated, for sure. I didn't see any warnings for it, and the version bump is similar to any other.

This isn't responsibility of Jackson, though.

@ahgittin
Copy link

I have opened https://bitbucket.org/asomov/snakeyaml/issues/412/restore-the-boolean-constructors-for to try to facilitate this. I've seen this error in other projects too. No fun!

@ahgittin
Copy link

Once snakeyaml 1.22 is out this problem should go away so long as versions 1.20/1.21 are avoided.

@Sufod
Copy link

Sufod commented Aug 21, 2018

Same issue here :(

@cthiebaud
Copy link

I confirm the issue is fixed with snakeyaml 1.23

@yborovikov
Copy link
Author

Awesome, I'll close #82 now, and this one once snakeyaml 1.23 is released.

@soberich
Copy link

@yborovikov Man, thanks a lot, I was have to repackage jackson-dataformats for that purpose only
and raised a relevant issue swagger-api/swagger-core#2925
thank you for that PR

@cthiebaud
Copy link

FYI, snakeyaml 1.23 is released since 2018-08-27, cf.

https://search.maven.org/artifact/org.yaml/snakeyaml

or

https://repo1.maven.org/maven2/org/yaml/snakeyaml/1.23/

@cowtowncoder cowtowncoder reopened this Aug 31, 2018
@cowtowncoder cowtowncoder changed the title [yaml] Jackson 2.9.5 is incompatible with snakeyaml 1.20+ Jackson 2.9.5 is incompatible with snakeyaml 1.20, 1.21 Aug 31, 2018
@cowtowncoder cowtowncoder added the yaml Issue related to YAML format backend label Aug 31, 2018
@cowtowncoder cowtowncoder changed the title Jackson 2.9.5 is incompatible with snakeyaml 1.20, 1.21 Jackson 2.9.5, 2.9.6 incompatible with snakeyaml 1.20, 1.21 Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
yaml Issue related to YAML format backend
Projects
None yet
Development

No branches or pull requests

7 participants